net.rim.blackberry.api.bbm.platform.ui.chat.container
Class BasicReplyFieldManager

java.lang.Object
  |
  +--net.rim.device.api.ui.Field
        |
        +--net.rim.device.api.ui.ScrollView
              |
              +--net.rim.device.api.ui.Manager
                    |
                    +--net.rim.device.api.ui.container.VerticalFieldManager
                          |
                          +--net.rim.blackberry.api.bbm.platform.ui.chat.container.BasicReplyFieldManager
All Implemented Interfaces:
AdjustmentListener, FieldVisibleRectChangeListener, IComponent, InputMethodListener, ToggleFieldProvider

public class BasicReplyFieldManager
extends VerticalFieldManager
implements ToggleFieldProvider

A reply field that can to be added to your chat screen as is. It uses ReplyField, SmileyButton, and ReplyFieldManager to arrange the fields. This field can be toggled (collapsed and not collapsed).

Since:
BBM SDK 1.0

Field Summary
protected  boolean _isCollapsed
          If the state is collapsed, this field is not showing.
protected  ReplyField _replyField
          Reply field
protected  SmileyButton _smileyButton
          Smiley button
 
Constructor Summary
BasicReplyFieldManager(ReplyField replyField, SmileyButton smileyButton)
          Creates an instance of the field.
 
Method Summary
protected  Manager createReplyFieldAndSmileyButtonManager()
          Returns a new instance of the manager that will contain the reply field and the smiley button.
protected  Field createReplyFieldContainer()
          Creates a default look for the reply field.
protected  Manager createReplyFieldScroller()
          Returns a new instance of the manager that contains the reply field.
protected  Field createReplyFieldTopBorder()
          Returns a new instance of a field that will appear above the reply field acting as a separator from the fields above.
protected  Field createSmileyButtonContainer()
          Returns the smiley button as it was provided.
 ReplyField getReplyField()
          Returns the reply field used for entering text.
 SmileyButton getSmileyButton()
          Returns the smiley button.
 Field getToggleField()
          Returns this.
 boolean isCollapsed()
          The field is hidden if the state is collapsed.
 void paint(Graphics graphics)
          Paints itself only if the state is not collapsed.
 void toggle()
          Changes the state.
 

Field Detail

_isCollapsed

protected boolean _isCollapsed
If the state is collapsed, this field is not showing.
Since:
BBM SDK 1.0

_replyField

protected ReplyField _replyField
Reply field
Since:
BBM SDK 1.0

_smileyButton

protected SmileyButton _smileyButton
Smiley button
Since:
BBM SDK 1.0
Constructor Detail

BasicReplyFieldManager

public BasicReplyFieldManager(ReplyField replyField,
                              SmileyButton smileyButton)
Creates an instance of the field. Creates a default look for the reply field inside a container. Adds the container and the smiley button.
Parameters:
replyField - reply field
smileyButton - smiley button
Throws:
NullPointerException - if a null parameter is provided
Since:
BBM SDK 1.0
Method Detail

createReplyFieldAndSmileyButtonManager

protected Manager createReplyFieldAndSmileyButtonManager()
Returns a new instance of the manager that will contain the reply field and the smiley button. Returns a ReplyFieldManager by default. Override to customize your manager.
Returns:
manager that will contain the reply field and the smiley button
Since:
BBM SDK 1.0

createReplyFieldContainer

protected Field createReplyFieldContainer()
Creates a default look for the reply field. Adds the reply field provided in the constructor into a container. The field returned is added to this manager. The container limits the height of the reply field and gives it a rounded border. Override this method to create a different look for your reply field.
Returns:
field that will be added to the manager
Since:
BBM SDK 1.0

createReplyFieldScroller

protected Manager createReplyFieldScroller()
Returns a new instance of the manager that contains the reply field. By default, the manager is restricted to one line of text. Override to provide your own manager.
Returns:
manager that contains the reply field
Since:
BBM SDK 1.0

createReplyFieldTopBorder

protected Field createReplyFieldTopBorder()
Returns a new instance of a field that will appear above the reply field acting as a separator from the fields above. By default, a ThinSeparatorField is used.
Returns:
separator for the reply field and the fields above
Since:
BBM SDK 1.0

createSmileyButtonContainer

protected Field createSmileyButtonContainer()
Returns the smiley button as it was provided. The field returned is added to this manager. Override to create a customized look to your button.
Returns:
smiley button that will be added to this field
Since:
BBM SDK 1.0

getReplyField

public ReplyField getReplyField()
Returns the reply field used for entering text.
Returns:
reply field used for entering text
Since:
BBM SDK 1.0

getSmileyButton

public SmileyButton getSmileyButton()
Returns the smiley button.
Returns:
smiley button
Since:
BBM SDK 1.0

getToggleField

public Field getToggleField()
Returns this.
Returns:
this field
Since:
BBM SDK 1.0

isCollapsed

public boolean isCollapsed()
The field is hidden if the state is collapsed.
Returns:
true if the field is hidden; false otherwise
Since:
BBM SDK 1.0
See Also:
ToggleFieldProvider.isCollapsed()

paint

public void paint(Graphics graphics)
Paints itself only if the state is not collapsed.
Parameters:
graphics - graphic context
Since:
BBM SDK 1.0

toggle

public void toggle()
Changes the state. If the field is hidden, displays it; if the field is showing, hides it.
Since:
BBM SDK 1.0
See Also:
ToggleFieldProvider.toggle()



Copyright 1999- Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.