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

TreeModel (NetBeans View Model) - NetBeans API Javadoc 5.0.0

 

org.netbeans.spi.viewmodel
Interface TreeModel

All Superinterfaces:
Model
All Known Implementing Classes:
Models.CompoundModel

public interface TreeModel
extends Model

Defines data model for tree.


Field Summary
static String ROOT
          Constant for root node.
 
Method Summary
 void addModelListener(ModelListener l)
          Registers given listener.
 Object[] getChildren(Object parent, int from, int to)
          Returns children for given parent on given indexes.
 int getChildrenCount(Object node)
          Returns number of children for given node.
 Object getRoot()
          Returns the root node of the tree or null, if the tree is empty.
 boolean isLeaf(Object node)
          Returns true if node is leaf.
 void removeModelListener(ModelListener l)
          Unregisters given listener.
 

Field Detail

ROOT

public static final String ROOT
Constant for root node. This root node should be used if root node does not represent any valuable information and should not be visible in tree.

See Also:
Constant Field Values
Method Detail

getRoot

public Object getRoot()
Returns the root node of the tree or null, if the tree is empty.

Returns:
the root node of the tree or null

getChildren

public Object[] getChildren(Object parent,
                            int from,
                            int to)
                     throws UnknownTypeException
Returns children for given parent on given indexes.

Parameters:
parent - a parent of returned nodes
from - a start index
to - a end index
Returns:
children for given parent on given indexes
Throws:
UnknownTypeException - if this TreeModel implementation is not able to resolve children for given node type

isLeaf

public boolean isLeaf(Object node)
               throws UnknownTypeException
Returns true if node is leaf.

Returns:
true if node is leaf
Throws:
UnknownTypeException - if this TreeModel implementation is not able to resolve dchildren for given node type

getChildrenCount

public int getChildrenCount(Object node)
                     throws UnknownTypeException
Returns number of children for given node.

Parameters:
node - the parent node
Returns:
the children count
Throws:
UnknownTypeException - if this TreeModel implementation is not able to resolve children for given node type
Since:
1.1

addModelListener

public void addModelListener(ModelListener l)
Registers given listener.

Parameters:
l - the listener to add

removeModelListener

public void removeModelListener(ModelListener l)
Unregisters given listener.

Parameters:
l - the listener to remove

 

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