org.apache.pivot.wtk.content
Class TreeBranch

java.lang.Object
  extended by org.apache.pivot.wtk.content.TreeNode
      extended by org.apache.pivot.wtk.content.TreeBranch
All Implemented Interfaces:
Iterable<TreeNode>, org.apache.pivot.collections.Collection<TreeNode>, org.apache.pivot.collections.List<TreeNode>, org.apache.pivot.collections.Sequence<TreeNode>

public class TreeBranch
extends TreeNode
implements org.apache.pivot.collections.List<TreeNode>

Default tree branch implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.List
org.apache.pivot.collections.List.ItemIterator<T>, org.apache.pivot.collections.List.ListListenerList<T>
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
org.apache.pivot.collections.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)
           
 void clear()
           
 TreeNode get(int index)
           
 Comparator<TreeNode> getComparator()
           
 Image getExpandedIcon()
           
 int getLength()
           
 org.apache.pivot.util.ListenerList<org.apache.pivot.collections.ListListener<TreeNode>> getListListeners()
           
 int indexOf(TreeNode treeNode)
           
 void insert(TreeNode treeNode, int index)
           
 boolean isEmpty()
           
 Iterator<TreeNode> iterator()
           
 org.apache.pivot.collections.Sequence<TreeNode> remove(int index, int count)
           
 int remove(TreeNode treeNode)
           
 void setComparator(Comparator<TreeNode> comparator)
           
 void setExpandedIcon(Image expandedIcon)
           
 void setExpandedIcon(String expandedIconName)
          Sets the tree branch's expanded icon by resource name.
 void setExpandedIcon(URL expandedIconURL)
          Sets the tree branch's expanded icon by URL.
 String toString()
           
 TreeNode update(int index, TreeNode treeNode)
           
 
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

TreeBranch

public TreeBranch()

TreeBranch

public TreeBranch(Image icon)

TreeBranch

public TreeBranch(String text)

TreeBranch

public TreeBranch(Image icon,
                  String text)

TreeBranch

public TreeBranch(Image icon,
                  Image expandedIcon,
                  String text)
Method Detail

getExpandedIcon

public Image getExpandedIcon()

setExpandedIcon

public void setExpandedIcon(Image expandedIcon)

setExpandedIcon

public void setExpandedIcon(URL expandedIconURL)
Sets the tree branch's expanded icon by URL.

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.

Parameters:
expandedIconURL - The location of the expanded icon to set.

setExpandedIcon

public void setExpandedIcon(String expandedIconName)
Sets the tree branch's expanded icon by resource name.

Parameters:
expandedIconName - The resource name of the expanded icon to set.
See Also:
setExpandedIcon(URL)

add

public int add(TreeNode treeNode)
Specified by:
add in interface org.apache.pivot.collections.List<TreeNode>
Specified by:
add in interface org.apache.pivot.collections.Sequence<TreeNode>

insert

public void insert(TreeNode treeNode,
                   int index)
Specified by:
insert in interface org.apache.pivot.collections.List<TreeNode>
Specified by:
insert in interface org.apache.pivot.collections.Sequence<TreeNode>

update

public TreeNode update(int index,
                       TreeNode treeNode)
Specified by:
update in interface org.apache.pivot.collections.List<TreeNode>
Specified by:
update in interface org.apache.pivot.collections.Sequence<TreeNode>

remove

public int remove(TreeNode treeNode)
Specified by:
remove in interface org.apache.pivot.collections.Sequence<TreeNode>

remove

public org.apache.pivot.collections.Sequence<TreeNode> remove(int index,
                                                              int count)
Specified by:
remove in interface org.apache.pivot.collections.List<TreeNode>
Specified by:
remove in interface org.apache.pivot.collections.Sequence<TreeNode>

clear

public void clear()
Specified by:
clear in interface org.apache.pivot.collections.Collection<TreeNode>
Specified by:
clear in interface org.apache.pivot.collections.List<TreeNode>

get

public TreeNode get(int index)
Specified by:
get in interface org.apache.pivot.collections.Sequence<TreeNode>

indexOf

public int indexOf(TreeNode treeNode)
Specified by:
indexOf in interface org.apache.pivot.collections.Sequence<TreeNode>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface org.apache.pivot.collections.Collection<TreeNode>

getLength

public int getLength()
Specified by:
getLength in interface org.apache.pivot.collections.List<TreeNode>
Specified by:
getLength in interface org.apache.pivot.collections.Sequence<TreeNode>

getComparator

public Comparator<TreeNode> getComparator()
Specified by:
getComparator in interface org.apache.pivot.collections.Collection<TreeNode>

setComparator

public void setComparator(Comparator<TreeNode> comparator)
Specified by:
setComparator in interface org.apache.pivot.collections.Collection<TreeNode>
Specified by:
setComparator in interface org.apache.pivot.collections.List<TreeNode>

iterator

public Iterator<TreeNode> iterator()
Specified by:
iterator in interface Iterable<TreeNode>

getListListeners

public org.apache.pivot.util.ListenerList<org.apache.pivot.collections.ListListener<TreeNode>> getListListeners()
Specified by:
getListListeners in interface org.apache.pivot.collections.List<TreeNode>

toString

public String toString()
Overrides:
toString in class TreeNode