org.openide.nodes
Class Index.ArrayChildren
java.lang.Object
|
+--org.openide.nodes.Children
|
+--org.openide.nodes.Children.Array
|
+--org.openide.nodes.Index.ArrayChildren
- All Implemented Interfaces:
- Cloneable, Index, Node.Cookie
- Enclosing class:
- Index
- public static class Index.ArrayChildren
- extends Children.Array
- implements Index
Reorderable children list stored in an array.
Field Summary |
protected Index |
support
Support instance for delegation of some Index methods. |
support
protected Index support
- Support instance for delegation of some
Index
methods.
Index.ArrayChildren
public Index.ArrayChildren()
- Constructor for the support.
initCollection
protected Collection initCollection()
- If default constructor is used, then this method is called to lazily create
the collection. Even it claims that it returns Collection only subclasses
of List are valid values.
This implementation returns ArrayList.
- Overrides:
initCollection
in class Children.Array
- Returns:
- any List collection.
reorder
public void reorder(int[] perm)
- Description copied from interface:
Index
- Reorder all children with a given permutation.
- Specified by:
reorder
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
perm
- permutation with the length of current nodes- Throws:
IllegalArgumentException
- if the permutation is not valid
reorder
public void reorder()
- Invokes a dialog for reordering children using
IndexedCustomizer
.
- Specified by:
reorder
in interface Index
move
public void move(int x,
int y)
- Description copied from interface:
Index
- Move the element at the
x
-th position to the y
-th position. All
elements after the y
-th position are moved down.
- Specified by:
move
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
x
- the position to remove the element fromy
- the position to insert the element to- Throws:
IndexOutOfBoundsException
- if an index is out of bounds
exchange
public void exchange(int x,
int y)
- Description copied from interface:
Index
- Exchange two elements.
- Specified by:
exchange
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
x
- position of the first elementy
- position of the second element- Throws:
IndexOutOfBoundsException
- if an index is out of bounds
moveUp
public void moveUp(int x)
- Description copied from interface:
Index
- Move an element up.
- Specified by:
moveUp
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
x
- index of element to move up- Throws:
IndexOutOfBoundsException
- if an index is out of bounds
moveDown
public void moveDown(int x)
- Description copied from interface:
Index
- Move an element down.
- Specified by:
moveDown
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
x
- index of element to move down- Throws:
IndexOutOfBoundsException
- if an index is out of bounds
indexOf
public int indexOf(Node node)
- Description copied from interface:
Index
- Get the index of a given node.
- Specified by:
indexOf
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
node
- node to find index of- Returns:
- index of the node, or
-1
if no such node was found
addChangeListener
public void addChangeListener(ChangeListener chl)
- Description copied from interface:
Index
- Add a new listener to the listener list. The listener will be notified of
any change in the order of the nodes.
- Specified by:
addChangeListener
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
chl
- new listener
removeChangeListener
public void removeChangeListener(ChangeListener chl)
- Description copied from interface:
Index
- Remove a listener from the listener list.
- Specified by:
removeChangeListener
in interface Index
- Following copied from interface:
org.openide.nodes.Index
- Parameters:
chl
- listener to remove
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.