|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--brf.j2me.dynaworks.ui.TreeItem
A TreeItem represents an item in a tree structure.
| Field Summary | |
private java.util.Vector |
children
list of children. |
protected boolean |
expanded
true if the children are visible |
private int |
image
Image number in an image list of the tree |
private TreeItem |
parent
reference to parent item |
private java.lang.String |
text
label of the item |
int |
userData
data associated with the node. |
| Constructor Summary | |
TreeItem(java.lang.String t,
int img)
Creates a TreeItem. |
|
| Method Summary | |
void |
addChild(TreeItem child)
adds a child item to this item |
void |
collapse()
collapses a parent item. |
int |
countVisibleDescendants()
Return the number of visible descendants |
void |
expand()
expands a parent item. |
TreeItem[] |
getChildren()
Return a vector of children |
int |
getImage()
get the image id of this node. |
TreeItem |
getParent()
get the parent of this node. |
java.lang.String |
getText()
get the next of this node. |
boolean |
hasChild(TreeItem item)
Check if this item holds the specified child |
boolean |
hasChildren()
Return true if item has children. |
boolean |
isExpanded()
|
boolean |
removeChild(TreeItem child)
removes the given child from the list of children |
void |
setImage(int img)
sets the image number. |
void |
setParent(TreeItem parent)
set the parent item. |
void |
setText(java.lang.String t)
sets the item text. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected boolean expanded
private java.lang.String text
private int image
private java.util.Vector children
private TreeItem parent
public int userData
| Constructor Detail |
public TreeItem(java.lang.String t,
int img)
It is set to visible if the parent is visible.
t - the textinr - the image number in the image listpar - a reference to this items parent, or null if it has none.| Method Detail |
public void expand()
public void collapse()
public boolean isExpanded()
public void setText(java.lang.String t)
t - the text.public java.lang.String getText()
public void setImage(int img)
img - the image number.public int getImage()
public TreeItem getParent()
public void setParent(TreeItem parent)
parent - TreeItem - reference to new parentpublic int countVisibleDescendants()
public void addChild(TreeItem child)
child - TreeItem - the child TreeItem to be addedpublic boolean removeChild(TreeItem child)
child - TreeItem - the child to be removed from the listpublic boolean hasChild(TreeItem item)
item - TreeItem - child to be searchedpublic TreeItem[] getChildren()
public boolean hasChildren()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||