|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object thinwire.ui.Menu.Item
public static class Menu.Item
An object that represents an item in a Menu
component.
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ITEM_ENABLED
|
static java.lang.String |
PROPERTY_ITEM_KEY_PRESS_COMBO
|
Fields inherited from interface thinwire.ui.HierarchyComponent.Item |
---|
PROPERTY_ITEM_IMAGE, PROPERTY_ITEM_TEXT, PROPERTY_ITEM_USER_OBJECT |
Constructor Summary | |
---|---|
Menu.Item()
Constructs a new Item with no text and no image. |
|
Menu.Item(java.lang.String text)
Constructs a new Item with the specified text and no image. |
|
Menu.Item(java.lang.String text,
java.lang.String image)
Constructs a new Item with the specified text and image. |
|
Menu.Item(java.lang.String text,
java.lang.String image,
java.lang.String keyPressCombo)
Constructs a new Item with the specified text and image. |
Method Summary | |
---|---|
java.util.List<I> |
getChildren()
Get the List that contains the children of this item. |
H |
getHierarchy()
|
java.lang.String |
getImage()
Get the image file name that is displayed on the left side of the item. |
ImageInfo |
getImageInfo()
Returns an immutable ImageInfo class that provides information
about the assigned image, such as width, height, format, etc. |
int |
getIndex()
A convenience method that returns the index of this item in it's parents children List. |
java.lang.String |
getKeyPressCombo()
Get a text representation of the key combo that will activate this item. |
java.lang.Object |
getParent()
Get the parent object of this item. |
java.lang.String |
getText()
Get the text that is displayed for the item in the menu. |
java.lang.Object |
getUserObject()
Get the user defined value for this item. |
boolean |
hasChildren()
|
boolean |
isEnabled()
Returns whether the item is selectable (enabled). |
void |
setEnabled(boolean enabled)
Sets the enabled property of the item |
void |
setImage(java.lang.String image)
Set the image file name that is displayed on the left side of the item. |
void |
setKeyPressCombo(java.lang.String keyPressCombo)
Set the key combo / shortcut that will activate this item. |
void |
setText(java.lang.String text)
Set the text that is displayed for the item in the menu. |
void |
setUserObject(java.lang.Object value)
Set a user defined value for this item. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_ITEM_ENABLED
public static final java.lang.String PROPERTY_ITEM_KEY_PRESS_COMBO
Constructor Detail |
---|
public Menu.Item()
public Menu.Item(java.lang.String text)
text
- the text to display for the item.public Menu.Item(java.lang.String text, java.lang.String image)
text
- the text to display for the item.image
- the image to display to the left of the text of the item.public Menu.Item(java.lang.String text, java.lang.String image, java.lang.String keyPressCombo)
text
- the text to display for the item.image
- the image to display to the left of the text of the item.keyPressCombo
- the key combination to associate to this Menu.Item.Method Detail |
---|
public final boolean isEnabled()
public final void setEnabled(boolean enabled)
enabled
- True to make editable, false to disable the component (Default = true)public java.lang.String getKeyPressCombo()
public void setKeyPressCombo(java.lang.String keyPressCombo)
keyPressCombo
- key combo to assign to this item.KeyPressEvent.encodeKeyPressCombo(boolean, boolean, boolean, String)
public java.lang.String toString()
public java.lang.String getText()
HierarchyComponent.Item
getText
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public void setText(java.lang.String text)
HierarchyComponent.Item
setText
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
text
- the text that should be displayed for the item.public java.lang.String getImage()
HierarchyComponent.Item
getImage
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public void setImage(java.lang.String image)
HierarchyComponent.Item
setImage
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
image
- the name of the image file that should be displayed for the item.public ImageInfo getImageInfo()
HierarchyComponent.Item
ImageInfo
class that provides information
about the assigned image, such as width, height, format, etc.
getImageInfo
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
ImageInfo
describing this item's image.public java.lang.Object getUserObject()
HierarchyComponent.Item
getUserObject
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public void setUserObject(java.lang.Object value)
HierarchyComponent.Item
setUserObject
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public int getIndex()
HierarchyComponent.Item
item.getParent().getChildren().indexOf(item);
.
getIndex
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public H getHierarchy()
getHierarchy
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public java.lang.Object getParent()
HierarchyComponent.Item
getParent
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public boolean hasChildren()
hasChildren
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
public java.util.List<I> getChildren()
HierarchyComponent.Item
List
that contains the children of this item.
getChildren
in interface HierarchyComponent.Item<H extends thinwire.ui.AbstractHierarchyComponent,I extends thinwire.ui.AbstractHierarchyComponent.Item>
List
that contains the children of this item or an empty List
if there are no
children.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |