Class ExpandableNode
java.lang.Object
org.eclipse.jface.viewers.internal.ExpandableNode
The expandable placeholder element to be used for viewer items that represent
an expandable tree or table element.
The idea of ExpandableNode
is to allow viewers to show only some
subset of children that would otherwise all appear below parent element. The
main purpose of this is to prevent UI freezes with viewers that can offer lot
of elements but can't efficiently handle such amount using SWT.
The node consists of a parent element, list of all children of this parent and the offset to which child elements are supposed to be created and shown in the viewer.
-
Constructor Summary
ConstructorDescriptionExpandableNode
(Object[] children, int startOffSet, int limit, StructuredViewer viewer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(Object element) Client can useAbstractTableViewer.add(Object[])
to add an element beyond visible range.boolean
Returns true if the given element is present in the all elements.Object[]
Returns original list of elements of the parent.getLabel()
Returns label shown for the node in the viewer.int
getLimit()
int
The viewer is supposed to show subset of original elements as children of this node up to this offset (but not including it).Object[]
This method returns those children of the current node which are supposed to be not created / shown yet in the viewer.
-
Constructor Details
-
ExpandableNode
- Parameters:
children
- non null list of childrenstartOffSet
- first not shown item indexlimit
- current child limit of the viewerviewer
- owner of the node
-
-
Method Details
-
getOffset
public int getOffset()The viewer is supposed to show subset of original elements as children of this node up to this offset (but not including it). In other worlds, this is the index of first invisible element under this node.- Returns:
- current offset in the original list of elements
-
getLimit
public int getLimit()- Returns:
- limit value
-
getRemainingElements
This method returns those children of the current node which are supposed to be not created / shown yet in the viewer.- Returns:
- all remaining elements from original array starting with the element at offset index
-
getAllElements
Returns original list of elements of the parent.- Returns:
- original list of elements of the parent
-
getLabel
Returns label shown for the node in the viewer.- Returns:
- label shown for the node in the viewer
-
addElement
Client can useAbstractTableViewer.add(Object[])
to add an element beyond visible range. It must be tracked to render whenExpandableNode
node is clicked. -
contains
Returns true if the given element is present in the all elements.- Returns:
- returns if it finds in all the elements.
-