|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.content.TreeNode
org.apache.pivot.wtk.content.TreeBranch
public class TreeBranch
Default tree branch implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pivot.collections.List |
---|
List.ItemIterator<T>, List.ListListenerList<T> |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
TreeBranch()
|
|
TreeBranch(Image icon)
|
|
TreeBranch(Image icon,
Image expandedIcon,
String text)
|
|
TreeBranch(Image icon,
String text)
|
|
TreeBranch(String text)
|
Method Summary | |
---|---|
int |
add(TreeNode treeNode)
Adds an item to the list. |
void |
clear()
Removes all elements from the collection. |
TreeNode |
get(int index)
Retrieves the item at the given index. |
Comparator<TreeNode> |
getComparator()
Returns the collection's sort order. |
Image |
getExpandedIcon()
|
int |
getLength()
Returns the length of the list. |
ListenerList<ListListener<TreeNode>> |
getListListeners()
Returns the list listener list. |
int |
indexOf(TreeNode treeNode)
Returns the index of an item in the sequence. |
void |
insert(TreeNode treeNode,
int index)
Inserts an item into the list. |
boolean |
isEmpty()
Tests the emptiness of the collection. |
Iterator<TreeNode> |
iterator()
|
Sequence<TreeNode> |
remove(int index,
int count)
Removes one or more items from the sequence. |
int |
remove(TreeNode treeNode)
Removes the first occurrence of the given item from the sequence. |
void |
setComparator(Comparator<TreeNode> comparator)
Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order. |
void |
setExpandedIcon(Image expandedIcon)
|
void |
setExpandedIcon(String expandedIconName)
Sets the tree branch's expanded icon by resource name. |
void |
setExpandedIcon(URL iconURL)
Sets the tree branch's expanded icon by URL. |
String |
toString()
|
TreeNode |
update(int index,
TreeNode treeNode)
Updates the item at the given index. |
Methods inherited from class org.apache.pivot.wtk.content.TreeNode |
---|
getIcon, getParent, getText, getUserData, setIcon, setIcon, setIcon, setParent, setText, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TreeBranch()
public TreeBranch(Image icon)
public TreeBranch(String text)
public TreeBranch(Image icon, String text)
public TreeBranch(Image icon, Image expandedIcon, String text)
Method Detail |
---|
public Image getExpandedIcon()
public void setExpandedIcon(Image expandedIcon)
public void setExpandedIcon(URL iconURL)
If the icon already exists in the application context resource cache, the cached value will be used. Otherwise, the icon will be loaded synchronously and added to the cache.
iconURL
- The location of the expanded icon to set.public void setExpandedIcon(String expandedIconName)
expandedIconName
- The resource name of the expanded icon to set.setExpandedIcon(URL)
public int add(TreeNode treeNode)
List
add
in interface List<TreeNode>
add
in interface Sequence<TreeNode>
treeNode
- The item to be added to the sequence.
ListListener.itemInserted(List, int)
public void insert(TreeNode treeNode, int index)
List
insert
in interface List<TreeNode>
insert
in interface Sequence<TreeNode>
treeNode
- The item to be added to the list.index
- The index at which the item should be inserted. Must be a value between
0 and getLength().ListListener.itemInserted(List, int)
public TreeNode update(int index, TreeNode treeNode)
List
update
in interface List<TreeNode>
update
in interface Sequence<TreeNode>
index
- The index of the item to update.treeNode
- The item that will replace any existing value at the given index.
ListListener.itemUpdated(List, int, Object)
public int remove(TreeNode treeNode)
Sequence
remove
in interface Sequence<TreeNode>
treeNode
- The item to remove.
Sequence.remove(int, int)
public Sequence<TreeNode> remove(int index, int count)
Sequence
remove
in interface List<TreeNode>
remove
in interface Sequence<TreeNode>
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
ListListener.itemsRemoved(List, int, Sequence)
public void clear()
Collection
clear
in interface Collection<TreeNode>
clear
in interface List<TreeNode>
ListListener.itemsRemoved(List, int, Sequence)
public TreeNode get(int index)
Sequence
get
in interface Sequence<TreeNode>
index
- The index of the item to retrieve.public int indexOf(TreeNode treeNode)
Sequence
indexOf
in interface Sequence<TreeNode>
treeNode
- The item to locate.
public boolean isEmpty()
Collection
isEmpty
in interface Collection<TreeNode>
public int getLength()
List
getLength
in interface List<TreeNode>
getLength
in interface Sequence<TreeNode>
public Comparator<TreeNode> getComparator()
Collection
getComparator
in interface Collection<TreeNode>
Collection.setComparator(Comparator)
public void setComparator(Comparator<TreeNode> comparator)
Collection
Calling this method more than once with the same comparator will re-sort the collection.
setComparator
in interface Collection<TreeNode>
setComparator
in interface List<TreeNode>
comparator
- The comparator used to order elements in the collection, or null if the
collection is unsorted.ListListener.comparatorChanged(List, Comparator)
public Iterator<TreeNode> iterator()
iterator
in interface Iterable<TreeNode>
public ListenerList<ListListener<TreeNode>> getListListeners()
List
getListListeners
in interface List<TreeNode>
public String toString()
toString
in class TreeNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |