|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.component.ChatField
This field combines the message list manager, reply field, and a toggler to create an embedded chat experience. This field supports a collapsed and non-collapsed states. If the manager is non-collapsed, it means the reply field is showing in the foreground and the message list manager is partially hidden by the reply field. If the manager is collapsed, it means the reply field is not showing and the message list field is in the foreground. This allows the user to have a chat experience while saving screen space. The toggle field which is positioned below the reply field can be used to toggle the state and visibility of fields.
| Field Summary | ||
protected boolean |
_isCollapsed
Indicates whether the the reply field is hiding or showing. |
|
protected ToggleFieldProvider |
_messageList
Message list manager |
|
protected ReplyField |
_replyField
Reply field |
|
protected ToggleFieldProvider |
_replyFieldManager
Reply field manager |
|
protected SmileyButton |
_smileyButton
Smiley button |
|
protected ToggleFieldProvider |
_toggler
Toggle field |
|
| Constructor Summary | ||
ChatField()
Creates an instance of the chat field. |
||
ChatField(long displayStyle,
int borderStyle)
Creates an instance of the chat field. |
||
| Method Summary | ||
protected void |
addChatFields()
Adds each field created in the constructor to the manager. |
|
void |
addMessage(MessageFieldProvider message)
Adds a message to the message list manager. |
|
protected Manager |
createAllFieldsManager()
Returns a new instance of the manager which will contain all of the fields. |
|
protected Manager |
createMessageListAndReplyFieldManager()
Creates a new instance of the manager that will contain the message list and the reply field. |
|
protected ToggleFieldProvider |
createMessageListManager(long displayStyle,
int borderStyle)
Returns a new instance of the manager for messages. |
|
protected ReplyField |
createReplyField()
Returns a new instance of the reply field. |
|
protected ToggleFieldProvider |
createReplyFieldManager(ReplyField replyField,
SmileyButton smileyButton)
Returns a manager for the reply field and the smiley button. |
|
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 SmileyButton |
createSmileyButton()
Returns a new instance of the smiley button. |
|
protected Field |
createToggleAndReplyFieldSeparator()
Returns a new instance of the field that will separate the reply field from the toggle field. |
|
protected ToggleFieldProvider |
createToggleChatDisplayField()
Returns a new instance of the chat toggler. |
|
ToggleFieldProvider |
getMessageListField()
Returns the message list field. |
|
ReplyField |
getReplyField()
Returns the reply field. |
|
ToggleFieldProvider |
getReplyFieldManager()
Returns the reply field manager. |
|
Field |
getToggleField()
Returns this manager. |
|
ToggleFieldProvider |
getToggler()
Returns the toggler. |
|
protected boolean |
invokeAction(int action)
If the leaf field that has focus is the toggler and the action is ACTION_INVOKE, toggles the state by calling toggle() and
returns true; otherwise, uses the super implementation. |
|
boolean |
isCollapsed()
If the manager is not collapsed, it means the reply field is showing in the foreground and the message list manager is partially hidden by the reply field. |
|
protected boolean |
keyChar(char key,
int status,
int time)
If the user selects enter, calls invokeAction with ACTION_INVOKE as
a parameter. |
|
protected int |
nextFocus(int direction,
int axis)
Skip focus on the messages field when the state is not collapsed (i.e. message list is hidden). |
|
void |
removeAllMessages()
Removes all messages that have been added in MessageListManager. |
|
void |
toggle()
Toggle the state of the field. |
|
| Field Detail |
protected boolean _isCollapsed
protected ToggleFieldProvider _replyFieldManager
| Constructor Detail |
public ChatField()
public ChatField(long displayStyle,
int borderStyle)
create() methods when creating each field.displayStyle - style bit passed to the BasicMessageListManager when a message list is created;
USE_ALL_HEIGHT is supported.borderStyle - style passed to the BasicMessageListManager when a message list is created| Method Detail |
protected void addChatFields()
public void addMessage(MessageFieldProvider message)
MessageListManager.SCROLL_HOTKEY_BOTTOM flag if the focus is not on a field
that is a MessageFieldProvider.message - message to be addedNullPointerException - if the chat field is nullIllegalArgumentException - if getMessageListField() has been overridden
to return a class of type that is not MessageListManagerprotected Manager createAllFieldsManager()
VerticalFieldManager. Override if you want your own manager.protected Manager createMessageListAndReplyFieldManager()
OverlappingFieldManager by default. Override if you want to customize this manager.protected ToggleFieldProvider createMessageListManager(long displayStyle, int borderStyle)
displayStyle - style bit passed to the BasicMessageListManager when a message list is created;
USE_ALL_HEIGHT is supported.borderStyle - style passed to the BasicMessageListManager when a message list is createdprotected ReplyField createReplyField()
protected ToggleFieldProvider createReplyFieldManager(ReplyField replyField, SmileyButton smileyButton)
BasicReplyFieldManager.
Override to customize the look and feel of this field.replyField - reply fieldsmileyButton - smiley buttonprotected Field createReplyFieldTopBorder()
ThinSeparatorField.protected SmileyButton createSmileyButton()
protected Field createToggleAndReplyFieldSeparator()
ThinSeparatorField with a light gray background.protected ToggleFieldProvider createToggleChatDisplayField()
public ToggleFieldProvider getMessageListField()
public ReplyField getReplyField()
public ToggleFieldProvider getReplyFieldManager()
public Field getToggleField()
ToggleFieldProvider.getToggleField()public ToggleFieldProvider getToggler()
protected boolean invokeAction(int action)
ACTION_INVOKE, toggles the state by calling toggle() and
returns true; otherwise, uses the super implementation.public boolean isCollapsed()
true if the manager is collapsed; false otherwise
protected boolean keyChar(char key,
int status,
int time)
invokeAction with ACTION_INVOKE as
a parameter. Otherwise, uses the super implementation.
protected int nextFocus(int direction,
int axis)
VerticalFieldManager#nextFocus(int direction, int axis)public void removeAllMessages()
MessageListManager.IllegalArgumentException - if getMessageListField() has been overridden
to return a class of type that is not MessageListManagerpublic void toggle()
toggle() on the message list, reply field and toggler.
Sets the focus on the reply field if the state is not collapsed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.