站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

Index.ArrayChildren (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.nodes
Class Index.ArrayChildren

java.lang.Object
  extended byorg.openide.nodes.Children
      extended byorg.openide.nodes.Children.Array
          extended byorg.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.


Nested Class Summary
 
Nested classes inherited from class org.openide.nodes.Children
Children.Array, Children.Keys, Children.Map, Children.SortedArray, Children.SortedMap
 
Nested classes inherited from class org.openide.nodes.Index
Index.ArrayChildren, Index.KeysChildren, Index.Support
 
Field Summary
protected  Index support
          Support instance for delegation of some Index methods.
 
Fields inherited from class org.openide.nodes.Children.Array
nodes
 
Fields inherited from class org.openide.nodes.Children
LEAF, MUTEX
 
Constructor Summary
Index.ArrayChildren()
          Constructor for the support.
 
Method Summary
 void addChangeListener(ChangeListener chl)
          Add a new listener to the listener list.
 void exchange(int x, int y)
          Exchange two elements.
 int indexOf(Node node)
          Get the index of a given node.
protected  Collection initCollection()
          If default constructor is used, then this method is called to lazily create the collection.
 void move(int x, int y)
          Move the element at the x-th position to the y-th position.
 void moveDown(int x)
          Move an element down.
 void moveUp(int x)
          Move an element up.
 void removeChangeListener(ChangeListener chl)
          Remove a listener from the listener list.
 void reorder()
          Invokes a dialog for reordering children using IndexedCustomizer.
 void reorder(int[] perm)
          Reorder all children with a given permutation.
 
Methods inherited from class org.openide.nodes.Children.Array
add, clone, refresh, remove
 
Methods inherited from class org.openide.nodes.Children
addNotify, findChild, getNode, getNodes, getNodes, getNodesCount, isInitialized, nodes, removeNotify
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openide.nodes.Index
getNodes, getNodesCount
 

Field Detail

support

protected Index support
Support instance for delegation of some Index methods.

Constructor Detail

Index.ArrayChildren

public Index.ArrayChildren()
Constructor for the support.

Method Detail

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
Parameters:
perm - permutation with the length of current nodes

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
Parameters:
x - the position to remove the element from
y - the position to insert the element to

exchange

public void exchange(int x,
                     int y)
Description copied from interface: Index
Exchange two elements.

Specified by:
exchange in interface Index
Parameters:
x - position of the first element
y - position of the second element

moveUp

public void moveUp(int x)
Description copied from interface: Index
Move an element up.

Specified by:
moveUp in interface Index
Parameters:
x - index of element to move up

moveDown

public void moveDown(int x)
Description copied from interface: Index
Move an element down.

Specified by:
moveDown in interface Index
Parameters:
x - index of element to move down

indexOf

public int indexOf(Node node)
Description copied from interface: Index
Get the index of a given node.

Specified by:
indexOf in interface 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
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
Parameters:
chl - listener to remove


Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.