org.netbeans.spi.viewmodel/2 1.9.22

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

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

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

getChildren

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

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

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

void addModelListener(ModelListener l)
Registers given listener.

Parameters:
l - the listener to add

removeModelListener

void removeModelListener(ModelListener l)
Unregisters given listener.

Parameters:
l - the listener to remove

org.netbeans.spi.viewmodel/2 1.9.22

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