List.ItemIterator<T>, List.ListListenerList<T>
Sequence.Tree<T>
Constructor and Description |
---|
TreeBranch() |
TreeBranch(Image icon) |
TreeBranch(Image icon,
Image expandedIcon,
String text) |
TreeBranch(Image icon,
String text) |
TreeBranch(String text) |
Modifier and Type | Method and Description |
---|---|
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.
|
public TreeBranch()
public TreeBranch(Image icon)
public TreeBranch(String text)
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
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
public int indexOf(TreeNode treeNode)
Sequence
public boolean isEmpty()
Collection
isEmpty
in interface Collection<TreeNode>
public int getLength()
List
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 ListenerList<ListListener<TreeNode>> getListListeners()
List
getListListeners
in interface List<TreeNode>