|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Item
javax.microedition.lcdui.CustomItem
de.enough.polish.ui.FakeCustomItem
de.enough.polish.ui.FakeContainerCustomItem
de.enough.polish.ui.TreeItem
public class TreeItem
Provides a tree of items that can contain several branches.
Each tree branch behaves like a normal J2ME Polish container, so you can specify view-types, columns, colspans, etc.
Copyright (c) Enough Software 2005 - 2009
history
16-Feb-2005 - rob creation
| Field Summary | |
|---|---|
ArrayList |
treeModelChildrenList
|
| Fields inherited from class de.enough.polish.ui.FakeContainerCustomItem |
|---|
allowCycling, autoFocusEnabled, autoFocusIndex, containerView, enableScrolling, focusAllStyle, focusedIndex, focusedItem, focusedStyleFirst, focusedStyleLast, isExpandItems, itemsList, itemStyle, lastPointerPressTime, lastPointerPressY, lastPointerPressYOffset, plainStyle, SCROLL_DEFAULT, SCROLL_SMOOTH, scrollHeight, scrollSmooth, targetYOffset, yOffset |
| Fields inherited from class javax.microedition.lcdui.CustomItem |
|---|
KEY_PRESS, KEY_RELEASE, KEY_REPEAT, NONE, POINTER_DRAG, POINTER_PRESS, POINTER_RELEASE, TRAVERSE_HORIZONTAL, TRAVERSE_VERTICAL |
| Constructor Summary | |
|---|---|
TreeItem(String label)
Creates a new tree item. |
|
TreeItem(String label,
Style style)
Creates a new tree item. |
|
TreeItem(String label,
TreeModel model)
Creates a new tree item. |
|
TreeItem(String label,
TreeModel model,
Style style)
Creates a new tree item. |
|
| Method Summary | |
|---|---|
void |
appendToNode(Item node,
Item item)
Adds the specified item to this tree. |
void |
appendToNode(Item node,
Item item)
Adds the specified item to this tree. |
void |
appendToNode(Item node,
Item item,
Style childStyle)
Adds the specified item to this tree. |
Item |
appendToNode(Item node,
String text,
Image image)
Adds the specified text/image to this tree. |
Item |
appendToNode(Item node,
String text,
Image image)
Adds the specified text/image to this tree. |
Item |
appendToNode(Item node,
String text,
Image image,
Style childStyle)
Adds the specified text/image to this tree. |
void |
appendToRoot(Item item)
Adds the specified item to this tree. |
void |
appendToRoot(Item item)
Adds the specified item to this list. |
void |
appendToRoot(Item item,
Style childStyle)
Adds the specified item to this list. |
Item |
appendToRoot(String text,
Image image)
Appends the specified text and image to this list. |
Item |
appendToRoot(String text,
Image image,
Style rootStyle)
Appends the specified text and image to this list and provides it with the given style. |
void |
collapseAll()
Collapses all branches of this TreeItem. |
protected de.enough.polish.ui.TreeItem.Node |
convertToNode(Item treeElement)
Converts a TreeItem into a node (if not realized before) |
protected Style |
focus(Style focusStyle,
int direction)
Focuses this item. |
Item[] |
getSelectedPath()
Retrieves the currently selected path of this tree item. |
Object[] |
getSelectedPathAsAttributes(Object key)
Retrieves the currently selected path of this tree item. |
boolean |
remove(Item item)
Removes the specified item from this list. |
void |
removeAll()
Clears this list. |
void |
setSelectedPathByAttribute(Object key,
Object[] values)
Opens the tree and focuses the specified items. |
void |
setStyle(Style style)
Sets the style of this item. |
| Methods inherited from class javax.microedition.lcdui.CustomItem |
|---|
getGameAction, getInteractionModes, invalidate, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, sizeChanged, traverse, traverseOut |
| Methods inherited from class javax.microedition.lcdui.Item |
|---|
getPreferredHeight, getPreferredWidth, removeCommand, setPreferredSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public ArrayList treeModelChildrenList
| Constructor Detail |
|---|
public TreeItem(String label)
label - the label of this item
public TreeItem(String label,
Style style)
label - the label of this itemstyle - the style
public TreeItem(String label,
TreeModel model)
label - the label of this itemmodel - the data model for this tree
public TreeItem(String label,
TreeModel model,
Style style)
label - the label of this itemmodel - the data model for this treestyle - the style| Method Detail |
|---|
public void appendToRoot(Item item)
item - the item that should be added
public void appendToNode(Item node,
Item item)
node - the parent node that has been previously added to this treeitem - the item that should be added
public Item appendToNode(Item node,
String text,
Image image)
node - the parent node that has been previously added to this treetext - the textimage - the image
public boolean remove(Item item)
item - the item that should be removed
public Item appendToRoot(String text,
Image image)
text - the textimage - the image
public Item appendToRoot(String text,
Image image,
Style rootStyle)
text - the textimage - the imagerootStyle - the style
public void appendToRoot(Item item)
item - the item that should be added
public void appendToRoot(Item item,
Style childStyle)
item - the item that should be addedchildStyle - the style
public Item appendToNode(Item node,
String text,
Image image)
node - the parent node that has been previously added to this treetext - the textimage - the image
public Item appendToNode(Item node,
String text,
Image image,
Style childStyle)
node - the parent node that has been previously added to this treetext - the textimage - the imagechildStyle - the style
public void appendToNode(Item node,
Item item)
node - the parent node that has been previously added to this treeitem - the item that should be addedprotected de.enough.polish.ui.TreeItem.Node convertToNode(Item treeElement)
treeElement - an item within this tree
public void appendToNode(Item node,
Item item,
Style childStyle)
node - the parent node that has been previously added to this treeitem - the item that should be addedchildStyle - the stylepublic void removeAll()
public void setStyle(Style style)
FakeCustomItem
setStyle in class FakeContainerCustomItemstyle - the new style for this item.public Item[] getSelectedPath()
public Object[] getSelectedPathAsAttributes(Object key)
key - the key that is used for querying attributes from the focused item
UiAccess.setAttribute(Item, Object, Object),
UiAccess.getAttribute(Item, Object)
public void setSelectedPathByAttribute(Object key,
Object[] values)
key - the attribute keyvalues - the values that are set for each item / nodeUiAccess.setAttribute(Item, Object, Object),
UiAccess.getAttribute(Item, Object)
protected Style focus(Style focusStyle,
int direction)
FakeCustomItem
focus in class FakeContainerCustomItemfocusStyle - the style which is used to indicate the focused statedirection - the direction from which this item is focused,
either Canvas.UP, Canvas.DOWN, Canvas.LEFT, Canvas.RIGHT or 0.
When 0 is given, the direction is unknown.
public void collapseAll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||