jMobileCore toolkit

com.jmobilecore.ui.core
Class ListLabel

java.lang.Object
  extended by com.jmobilecore.ui.core.Component
      extended by com.jmobilecore.ui.core.Label
          extended by com.jmobilecore.ui.core.ListLabel
All Implemented Interfaces:
ListComponent

public class ListLabel
extends Label
implements ListComponent

Provides a text label for display as part of List component. ListLabel is focusable.

Author:
Greg Gridin

Field Summary
protected  java.lang.Object actionCommand
          This field indicates the command has been issued by a particular list label.
protected  int shortcut
          A key stoke that ia associated with a list label.
 
Fields inherited from class com.jmobilecore.ui.core.Label
text
 
Fields inherited from class com.jmobilecore.ui.core.Component
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width
 
Constructor Summary
ListLabel(java.lang.String label)
          Create a list label
ListLabel(java.lang.String label, javax.microedition.lcdui.Font font, int shortcut)
          Create a list label of specified font with an associated keyboard shortcut.
ListLabel(java.lang.String label, javax.microedition.lcdui.Font font, int shortcut, java.lang.Object action)
          Create a list label with an associated keyboard shortcut and custom action.
 
Method Summary
 void destructor()
          Class destructor.
 java.lang.Object getAction()
          Get the object representing the ListLabel's action This method is required by ListComponent interface
 int getShortcut()
          Get the key code shortcut for this ListLabel This method is required by ListComponent interface
 void setAction(java.lang.Object action)
          Sets the object as ListLabel's action This method is required by ListComponent interface
 void setShortcut(int shortcut)
          Sets the key code shortcut for this ListLabel This method is required by ListComponent interface
 
Methods inherited from class com.jmobilecore.ui.core.Label
createTitleLabel, getText, paint, setText
 
Methods inherited from class com.jmobilecore.ui.core.Component
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyPressed, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jmobilecore.ui.core.ListComponent
getFont, getText, setFont, setText
 

Field Detail

actionCommand

protected java.lang.Object actionCommand
This field indicates the command has been issued by a particular list label. By default the actionCommand is the label of the list label, unless it has been explicitly set to a different value.


shortcut

protected int shortcut
A key stoke that ia associated with a list label. To remove you have to assign to it PlatformCanvas.KEY_UNDEFINED value

Constructor Detail

ListLabel

public ListLabel(java.lang.String label)
Create a list label

Parameters:
label - the label for this list label.

ListLabel

public ListLabel(java.lang.String label,
                 javax.microedition.lcdui.Font font,
                 int shortcut)
Create a list label of specified font with an associated keyboard shortcut.

Parameters:
label - the label for this list label.
font - the label font
shortcut - key code associated with list label

ListLabel

public ListLabel(java.lang.String label,
                 javax.microedition.lcdui.Font font,
                 int shortcut,
                 java.lang.Object action)
Create a list label with an associated keyboard shortcut and custom action.

Parameters:
label - the label for this list label.
font - the label font
shortcut - key code associated witha list label
action - custom action for the ListLabel
Method Detail

destructor

public void destructor()
Class destructor. Helps VM to perform garbage collection

Overrides:
destructor in class Component

getAction

public java.lang.Object getAction()
Get the object representing the ListLabel's action This method is required by ListComponent interface

Specified by:
getAction in interface ListComponent
Returns:
the object associated with this ListLabel

getShortcut

public int getShortcut()
Get the key code shortcut for this ListLabel This method is required by ListComponent interface

Specified by:
getShortcut in interface ListComponent
Returns:
the keycode shortcut

setAction

public void setAction(java.lang.Object action)
Sets the object as ListLabel's action This method is required by ListComponent interface

Specified by:
setAction in interface ListComponent
Parameters:
action - the object - new action value

setShortcut

public void setShortcut(int shortcut)
Sets the key code shortcut for this ListLabel This method is required by ListComponent interface

Specified by:
setShortcut in interface ListComponent
Parameters:
shortcut - the keycode - new shortcut value

jMobileCore toolkit