|
|||||||||
| 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.component.ButtonField
Contains a button control.
Use a FieldChangeListener to get notifications when the user
presses the button in this field.
Behaviour
Displays a button.
| Field Summary | ||
static int |
BARE
Don't draw button outline. |
|
| Fields inherited from class net.rim.device.api.ui.Field |
EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, READONLY, USE_ALL_HEIGHT, USE_ALL_WIDTH |
| Fields inherited from interface net.rim.device.api.ui.DrawStyle |
BASELINE, BOTTOM, ELLIPSIS, HALIGN_MASK, HCENTER, HDEFAULT, HFULL, LEADING, LEFT, RIGHT, TOP, TRAILING, TRUNCATE_BEGINNING, VALIGN_MASK, VCENTER, VDEFAULT, VFULL |
| Constructor Summary | ||
ButtonField()
Constructs a new ButtonField instance. |
||
ButtonField(long style)
Constructs a new ButtonField instance with provided style. |
||
ButtonField(String label)
Constructs a new ButtonField instance with provided label. |
||
ButtonField(String label,
long style)
Constructs a new ButtonField instance with provided label and style. |
||
| Method Summary | ||
protected void |
drawFocus(Graphics graphics,
boolean on)
Draws the focus indicator for this field. |
|
String |
getLabel()
Retrieves this field's label. |
|
int |
getPreferredHeight()
Retrieves this field's preferred height. |
|
int |
getPreferredWidth()
Retrieves this field's preferred width. |
|
protected boolean |
keyChar(char key,
int status,
int time)
Traps ENTER key generation events. |
|
protected void |
layout(int width,
int height)
Lays out this field's contents. |
|
protected void |
paint(Graphics graphics)
Redraws this field. |
|
void |
setLabel(String label)
Sets label string for this field. |
|
protected boolean |
trackwheelClick(int status,
int time)
Indicates a trackwheel click event. |
|
| Methods inherited from class net.rim.device.api.ui.Field |
drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getChangeListener, getContextMenu, getCookie, getExtent, getFieldStyle, getFocusListener, getFocusRect, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getOriginal, getScreen, getStyle, getTop, getWidth, invalidate, invalidate, isDirty, isEditable, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isVisible, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, moveFocus, moveFocus, onFocus, onUnfocus, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setFont, setMuddy, setPosition, trackwheelUnclick, updateLayout |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int BARE
Bare buttons show only the button label. Non-bare buttons show a rounded rectangular border around the button label.
| Constructor Detail |
public ButtonField(long style)
style - Field style for the button: can be a combation of any
generic field style, BARE,
DrawStyle.ELLIPSIS, Field.FOCUSABLE and Field.NON_FOCUSABLE.public ButtonField(String label)
Provided a label string to show, this method builds a button field in the default style.
label - Label string for the button.public ButtonField(String label, long style)
Provided a label string to show, and a style, this method builds a button field using your style.
label - Label string for the button.style - Field style for the button: can be a combation of any
generic field style, BARE,
DrawStyle.ELLIPSIS, Field.FOCUSABLE and Field.NON_FOCUSABLE.| Method Detail |
protected void drawFocus(Graphics graphics, boolean on)
This field's manager invokes this method after painting this field. The manager initializes the graphics object passed in for drawing with field-local coordinates.
This msethod inverts the focus rect obtained from
Field.getFocusRect(net.rim.device.api.ui.XYRect).
graphics - Graphics context used for drawing the focus.on - True if the focus should be set; otherwise, false.public String getLabel()
public int getPreferredWidth()
This field's manager invokes this method to assist in its layout.
getPreferredWidth in class Fieldpublic int getPreferredHeight()
This field's manager invokes this method to assist in its layout.
getPreferredHeight in class Field
protected boolean keyChar(char key,
int status,
int time)
This method handles and consumes a key generation event, if it's the ENTER key that's generated; otherwise, this method does nothing and does not consume the event.
key - Character generated by the event.status - Modifier key status (this parameter is ignored).time - Ticks since device reset (this parameter is ignored).
protected void layout(int width,
int height)
This field's manager invokes this method during the layout process to instruct this field to arrange its contents, given an amount of available space.
width - Amount of available horizontal space.height - Amount of available vertical space.public void setLabel(String label)
label - Label string for this field.
protected boolean trackwheelClick(int status,
int time)
The system invokes this method when passing on a trackwheel click event. This method is transparent, and the event is not consumed.
trackwheelClick in class Fieldstatus - State of the modifier keys.time - Ticks since device reset.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.