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

TreeModelFilter (NetBeans View Model) - NetBeans API Javadoc 4.1.0

 

org.netbeans.spi.viewmodel
Interface TreeModelFilter

All Superinterfaces:
Model

public interface TreeModelFilter
extends Model

Filters content of some original tree of nodes (represented by TreeModel).


Method Summary
 void addModelListener(ModelListener l)
          Registers given listener.
 Object[] getChildren(TreeModel original, Object parent, int from, int to)
          Returns filtered children for given parent on given indexes.
 int getChildrenCount(TreeModel original, Object node)
          Returns number of filterred children for given node.
 Object getRoot(TreeModel original)
          Returns filtered root of hierarchy.
 boolean isLeaf(TreeModel original, Object node)
          Returns true if node is leaf.
 void removeModelListener(ModelListener l)
          Unregisters given listener.
 

Method Detail

getRoot

public Object getRoot(TreeModel original)
Returns filtered root of hierarchy.

Parameters:
original - the original tree model
Returns:
filtered root of hierarchy

getChildren

public Object[] getChildren(TreeModel original,
                            Object parent,
                            int from,
                            int to)
                     throws UnknownTypeException
Returns filtered children for given parent on given indexes. Typically you should get original nodes (original.getChildren (...)), and modify them, or return it without modifications. You should not throw UnknownTypeException directly from this method!

Parameters:
original - the original tree model
parent - a parent of returned nodes
Returns:
children for given parent on given indexes
Throws:
UnknownTypeException - this exception can be thrown from original.getChildren (...) method call only!

getChildrenCount

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

Parameters:
original - the original tree model
node - the parent node
Returns:
true if node is leaf
Throws:
UnknownTypeException - if this TreeModel implementation is not able to resolve children for given node type

isLeaf

public boolean isLeaf(TreeModel original,
                      Object node)
               throws UnknownTypeException
Returns true if node is leaf. You should not throw UnknownTypeException directly from this method!

Parameters:
original - the original tree model
Returns:
true if node is leaf
Throws:
UnknownTypeException - this exception can be thrown from original.isLeaf (...) method call only!

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 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.