|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object thinwire.ui.Tree.Item
public static final class Tree.Item
An object that represents an item in a Tree
component.
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ITEM_EXPANDED
|
static java.lang.String |
PROPERTY_ITEM_SELECTED
|
Fields inherited from interface thinwire.ui.HierarchyComponent.Item |
---|
PROPERTY_ITEM_IMAGE, PROPERTY_ITEM_TEXT, PROPERTY_ITEM_USER_OBJECT |
Constructor Summary | |
---|---|
Tree.Item()
Constructs a new Item with no text and no image. |
|
Tree.Item(java.lang.String text)
Constructs a new Item with the specified text and no image. |
|
Tree.Item(java.lang.String text,
java.lang.String image)
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.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 |
isExpanded()
Get the expanded state of the item. |
boolean |
isSelected()
Get the selected state of the item. |
void |
setExpanded(boolean expanded)
Set the expanded state 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 |
setSelected(boolean selected)
Set the selected state of the 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_SELECTED
public static final java.lang.String PROPERTY_ITEM_EXPANDED
Constructor Detail |
---|
public Tree.Item()
public Tree.Item(java.lang.String text)
text
- the text to display for the item.public Tree.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.Method Detail |
---|
public boolean isSelected()
public void setSelected(boolean selected)
selected
- true if you want to select the item, false if you want to unselect it and select the root item.
java.lang.IllegalStateException
- if the item has not been added to a tree.public boolean isExpanded()
public void setExpanded(boolean expanded)
expanded
- true if you want to expand this branch item and show its children, false if you want to collapse it and
hide the children.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 |