jMobileCore toolkit

com.jmobilecore.ui.core
Class ListImage

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

public class ListImage
extends ImageComponent
implements ListComponent

Provides an image for display as part of List component. ListImage is focusable.

Author:
Greg Gridin

Field Summary
protected  java.lang.Object actionCommand
          This field indicates the command has been issued by a particular list item.
protected  int shortcut
          A key stoke that ia associated with a list item.
protected  java.lang.String text
          The textual description of the image.
 
Fields inherited from class com.jmobilecore.ui.core.ImageComponent
image
 
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
ListImage(javax.microedition.lcdui.Image image)
          Create a list image
ListImage(javax.microedition.lcdui.Image image, int shortcut)
          Create a list image with an associated keyboard shortcut.
ListImage(javax.microedition.lcdui.Image image, int shortcut, java.lang.Object action)
          Create a list image with an associated keyboard shortcut and custom action.
 
Method Summary
 void destructor()
          Default destructor.
 java.lang.Object getAction()
          Get the object representing the ListImage's action This method is required by ListComponent interface
 int getShortcut()
          Get the key code shortcut for this ListImage This method is required by ListComponent interface
 java.lang.String getText()
          Get textual representation of the ListImage component 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 ListImage This method is required by ListComponent interface
 void setText(java.lang.String text)
          Sets the key code shortcut for this ListImage component This method is required by ListComponent interface
 
Methods inherited from class com.jmobilecore.ui.core.ImageComponent
paint, setHeight
 
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
 
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, setFont
 

Field Detail

actionCommand

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

See Also:
getAction(), setAction(java.lang.Object)

shortcut

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

See Also:
getShortcut(), setShortcut(int)

text

protected java.lang.String text
The textual description of the image.

See Also:
getText(), setText(java.lang.String)
Constructor Detail

ListImage

public ListImage(javax.microedition.lcdui.Image image)
Create a list image

Parameters:
image - the label for this list image.

ListImage

public ListImage(javax.microedition.lcdui.Image image,
                 int shortcut)
Create a list image with an associated keyboard shortcut.

Parameters:
image - the label for this list image.
shortcut - key code associated witha list image.

ListImage

public ListImage(javax.microedition.lcdui.Image image,
                 int shortcut,
                 java.lang.Object action)
Create a list image with an associated keyboard shortcut and custom action.

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

destructor

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

Overrides:
destructor in class ImageComponent

getAction

public java.lang.Object getAction()
Get the object representing the ListImage'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 ListImage This method is required by ListComponent interface

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

getText

public java.lang.String getText()
Get textual representation of the ListImage component This method is required by ListComponent interface

Specified by:
getText in interface ListComponent
Returns:
the textual representation of the component

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 ListImage This method is required by ListComponent interface

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

setText

public void setText(java.lang.String text)
Sets the key code shortcut for this ListImage component This method is required by ListComponent interface

Specified by:
setText in interface ListComponent
Parameters:
text - the new textual representation of the component

jMobileCore toolkit