public interface ReorderableTreeModelFilter extends TreeModelFilter
Node
will contain
an implementation of Index
in it's lookup if
canReorder(org.netbeans.spi.viewmodel.ReorderableTreeModel, java.lang.Object)
returns true
.Modifier and Type | Method and Description |
---|---|
boolean |
canReorder(ReorderableTreeModel original,
Object parent)
Provide if this filter implementation can reorder children nodes.
|
void |
reorder(ReorderableTreeModel original,
Object parent,
int[] perm)
Reorder children nodes with a given permutation.
|
addModelListener, getChildren, getChildrenCount, getRoot, isLeaf, removeModelListener
boolean canReorder(ReorderableTreeModel original, Object parent) throws UnknownTypeException
original
- The original ReorderableTreeModelparent
- The parent node of children that are test for reordertrue
if this model can handle reordering of children,
false
otherwiseUnknownTypeException
- if this model implementation is not
able to decide the reorder capability for given node typevoid reorder(ReorderableTreeModel original, Object parent, int[] perm) throws UnknownTypeException
parent
- The parent node of children that are being reorderedperm
- permutation with the length of current child nodes. The permutation
lists the new positions of the original nodes, that is, for nodes
[A,B,C,D]
and permutation [0,3,1,2]
, the final
order would be [A,C,D,B]
.IllegalArgumentException
- if the permutation is not validUnknownTypeException
- if this model implementation is not
able to perform the reorder for given node type