net.rim.blackberry.api.bbm.platform.ui.chat.component
Class ToggleChatDisplayField

java.lang.Object
  |
  +--net.rim.device.api.ui.Field
        |
        +--net.rim.blackberry.api.bbm.platform.ui.chat.component.ToggleChatDisplayField
All Implemented Interfaces:
IComponent, InputMethodListener, ToggleFieldProvider

public class ToggleChatDisplayField
extends Field
implements ToggleFieldProvider

A horizontal bar with an arrow bitmap in the middle. When the field is in the collapsed state, the arrow is pointing up; when the field is in the non-collapsed state, the arrow is pointing down. This field can be used to control the visibility of the embedded chat fields. Due to the limited screen space, the reply field can be drawn to cover the messages field. Toggling this field can be used to bring the messages field in background (and reply field in foreground).

Since:
BBM SDK 1.0

Constructor Summary
ToggleChatDisplayField()
          Creates an instance of the field which is focusable and takes up all the width.
 
Method Summary
 int getPreferredHeight()
          Returns the preferred height.
 int getPreferredWidth()
          Returns the preferred width.
 Field getToggleField()
          Returns the toggle field.
protected  boolean invokeAction(int action)
          Toggles the field and repaints the field.
 boolean isCollapsed()
          Returns the state of the field.
protected  void layout(int width, int height)
          Lay out the field.
protected  void paint(Graphics graphics)
          Paint the field.
 void toggle()
          Toggles the value returned by ToggleFieldProvider.isCollapsed().
 

Constructor Detail

ToggleChatDisplayField

public ToggleChatDisplayField()
Creates an instance of the field which is focusable and takes up all the width. Sets the background.
Since:
BBM SDK 1.0
Method Detail

getPreferredHeight

public int getPreferredHeight()
Returns the preferred height.
Returns:
preferred height
Since:
BBM SDK 1.0

getPreferredWidth

public int getPreferredWidth()
Returns the preferred width.
Returns:
preferred width
Since:
BBM SDK 1.0

getToggleField

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

invokeAction

protected boolean invokeAction(int action)
Toggles the field and repaints the field.
Since:
BBM SDK 1.0
See Also:
Field#invokeAction(int action)

isCollapsed

public boolean isCollapsed()
Returns the state of the field.
Since:
BBM SDK 1.0

Following copied from interface: ToggleFieldProvider
Returns:
true if the toggle field represents a collapsed state

layout

protected void layout(int width,
                      int height)
Lay out the field.
Since:
BBM SDK 1.0
See Also:
Field#layout(int width, int height)

paint

protected void paint(Graphics graphics)
Paint the field.
Since:
BBM SDK 1.0
See Also:
Field#paint(Graphics graphics)

toggle

public void toggle()
Toggles the value returned by ToggleFieldProvider.isCollapsed(). Repaints the field.
Since:
BBM SDK 1.0



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.