|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreeModelExt<Node>
An extra interface that can be implemented with TreeModel
to control the sorting of the data model.
Method Summary | |
---|---|
void |
sort(Comparator<Node> cmpr,
boolean ascending)
It called when TreeModel or Tree has to sort
the content. |
Method Detail |
---|
void sort(Comparator<Node> cmpr, boolean ascending)
TreeModel
or Tree
has to sort
the content.
After sorting, this model shall notify the instances of
TreeDataListener
(registered thru AbstractTreeModel.addTreeDataListener(org.zkoss.zul.event.TreeDataListener)
)
to update the content.
Typically you have to notify with
new TreeDataEvent(this, TreeDataEvent.CONTENTS_CHANGED, parent, -1, -1)
to denote all data are changed (and reloading is required).
The comparator assigned to, say, Treecol.setSortAscending(java.util.Comparator>)
is passed to method as the cmpr argument.
Thus, developers could use it as a tag to know which column
or what kind of order to sort.
Notice that the comparator is capable to sort under the order specified
in the ascending parameter. In other words, you could ignore the
ascending parameter (which is used only for providing additional information)
cmpr
- the comparator assigned to Treecol.setSortAscending(java.util.Comparator>)
and other relative methods. If developers didn't assign any one,
the default comparator is used.
Notice that it is capable to sort the data in the correct order,
you could ignore the ascending parameter.ascending
- whether to sort in the ascending order (or in
the descending order, if false). Notice that it is used only to
provide additional information. To sort the data correctly, you could
count on the cmpr parameter only.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |