net.sourceforge.java.util.gui.jface.viewers
Interface ITreeElement

All Known Subinterfaces:
IMutableTreeElement
All Known Implementing Classes:
MutableTreeElement

public interface ITreeElement

Basic interface to build tree structures.

Author:
Sebastian Machhausen

Method Summary
 boolean allowsSubElements()
           Returns true if the receiver allows sub elements.
 ITreeElement getElementAt(int index)
           Returns the ITreeElement at the specified index.
 ITreeElement[] getElements()
           Returns the elements in the ITreeElement.
 int getIndex(ITreeElement element)
           Returns the index of the specified element in the ITreeElement.
 ITreeElement getParent()
           Returns the parent of the ITreeElement
 int getSize()
           Returns the number of elements in the ITreeElement.
 boolean hasSubElements()
           Returns true if the ITreeNode contains any sub elements.
 boolean isSubElement(ITreeElement element)
           Returns true if the specified element is a sub element, i.e. a descendant of the ITreeElement.
 

Method Detail

getElements

public ITreeElement[] getElements()

Returns the elements in the ITreeElement.

Returns:
the elements in the ITreeElement

allowsSubElements

public boolean allowsSubElements()

Returns true if the receiver allows sub elements.

Returns:
true if sub elements are allowed; false otherwise

getElementAt

public ITreeElement getElementAt(int index)

Returns the ITreeElement at the specified index.

Parameters:
index - the index to query the ITreeElement for
Returns:
the ITreeElement at the specified index

getSize

public int getSize()

Returns the number of elements in the ITreeElement.

Returns:
the number of elements in the ITreeElement<

getIndex

public int getIndex(ITreeElement element)

Returns the index of the specified element in the ITreeElement.

Parameters:
element - the ITreeElement to get the index for
Returns:
the index of the specified element in the ITreeElement

getParent

public ITreeElement getParent()

Returns the parent of the ITreeElement

Returns:
the parent of the ITreeElement

hasSubElements

public boolean hasSubElements()

Returns true if the ITreeNode contains any sub elements.

Returns:
true if the ITreeNode has any sub elements; false otherwise

isSubElement

public boolean isSubElement(ITreeElement element)

Returns true if the specified element is a sub element, i.e. a descendant of the ITreeElement.

Parameters:
element - the element for which to test the posterity
Returns:
true if the specified element is a sub element, i.e. a descendant of the ITreeElement; false otherwise