public interface PageableChildren
The interface marks the model implementing class as a 'pageable' class.
For all elements implementing this interface, when user expands the tree
in explorer, getChildren()
method with ChildrenState
parameter is used to get children.
Traditionally, getChildren()
without parameter is used
to get all the children of a tree node.
Modifier and Type | Interface and Description |
---|---|
static class |
PageableChildren.ChildrenState
Represents the state of currently provided children.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<Element> |
getChildren(PageableChildren.ChildrenState cookie)
The method is called by a tree when user expands the tree node which
wraps the element implementing
PageableChildren interface. |
java.util.Iterator<Element> getChildren(PageableChildren.ChildrenState cookie)
The method is called by a tree when user expands the tree node which
wraps the element implementing PageableChildren
interface. In
such case, it provides empty ChildrenState
instance, i.e.
cookie.get() == null
. It is up to model to fill the
cookie
instance with state object. When method is finished,
the tree will check the cookie object. If set, i.e.
cookie.get() != null
, it knows that it got only first batch
of children and more results are available. It will create placeholder
node at the end of children, called show more items....
When the placeholder node is clicked, this method is called again,
but it provides cookie
from previous run. Model can read the
value set in previous run and should provide another batch. Then it
has to set cookie
object again to make a new mark.
Once all children are read from model, the model should set
cookie
to null value. The tree will know that all the children
are available and will not create the placeholder at the end of the
tree.
cookie
- children state holderPageableChildren.ChildrenState