Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.spi.viewmodel/2 1.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.spi.viewmodel
Class Models.CompoundModel

    java.lang.Object
      org.netbeans.spi.viewmodel.Models.CompoundModel

All Implemented Interfaces:
  Model, NodeActionsProvider, NodeModel, TableModel, TreeExpansionModel, TreeModel

Enclosing class:
  Models

    public static final class Models.CompoundModel

extends Object
implements TreeModel, NodeModel, NodeActionsProvider, TableModel, TreeExpansionModel

This model encapsulates all currently supported models.

See Also:
  `Models.createCompoundModel(java.util.List)`

Field Summary

Fields inherited from interface org.netbeans.spi.viewmodel.TreeModel
`ROOT`

Method Summary
`void` | `addModelListener(ModelListener l)` Registers given listener.
`Action[]` | `getActions(Object node)` Returns set of actions for given node.
`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.
`ColumnModel[]` | `getColumns()` Returns sorted array of `ColumnModel`s.
`String` | `getDisplayName(Object node)` Returns display name for given node.
`String` | `getHelpId()` Get a help ID for this model.
`String` | `getIconBase(Object node)` Returns icon for given node.
`Object` | `getRoot()` Returns the root node of the tree or null, if the tree is empty.
`String` | `getShortDescription(Object node)` Returns tooltip for given node.
`Object` | `getValueAt(Object node, String columnID)` Returns value to be displayed in column `columnID` and row identified by `node`.
`boolean` | `isExpanded(Object node)` Defines default state (collapsed, expanded) of given node.
`boolean` | `isLeaf(Object node)` Returns true if node is leaf.
`boolean` | `isReadOnly(Object node, String columnID)` Returns true if value displayed in column `columnID` and row `node` is read only.
`void` | `nodeCollapsed(Object node)` Called when given node is collapsed.
`void` | `nodeExpanded(Object node)` Called when given node is expanded.
`void` | `performDefaultAction(Object node)` Performs default action for given node.
`void` | `removeModelListener(ModelListener l)` Unregisters given listener.
`void` | `setValueAt(Object node, String columnID, Object value)` Changes a value displayed in column `columnID` and row `node`.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getHelpId

    public String getHelpId()

  Get a help ID for this model.

  Returns:
    The help ID defined for the properties sheets, or `null`.
  Since:
    1.7

### getRoot

    public Object getRoot()

  Returns the root node of the tree or null, if the tree is empty.

  Specified by:
    `getRoot` in interface `TreeModel`
  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.

  Specified by:
    `getChildren` in interface `TreeModel`
  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 dchildren for given node type

### getChildrenCount

    public int getChildrenCount(Object node)
                         throws UnknownTypeException

  Returns number of children for given node.

  Specified by:
    `getChildrenCount` in interface `TreeModel`
  Parameters:
    `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(Object node)
                   throws UnknownTypeException

  Returns true if node is leaf.

  Specified by:
    `isLeaf` in interface `TreeModel`
  Returns:
    true if node is leaf
  Throws:
    `UnknownTypeException` - if this TreeModel implementation is not able to resolve dchildren for given node type

### getDisplayName

    public String getDisplayName(Object node)
                          throws UnknownTypeException

  Returns display name for given node.

  Specified by:
    `getDisplayName` in interface `NodeModel`
  Returns:
    display name for given node
  Throws:
    `UnknownTypeException` - if this NodeModel implementation is not able to resolve display name for given node type

### getShortDescription

    public String getShortDescription(Object node)
                               throws UnknownTypeException

  Returns tooltip for given node.

  Specified by:
    `getShortDescription` in interface `NodeModel`
  Returns:
    tooltip for given node
  Throws:
    `UnknownTypeException` - if this NodeModel implementation is not able to resolve tooltip for given node type

### getIconBase

    public String getIconBase(Object node)
                       throws UnknownTypeException

  Returns icon for given node.

  Specified by:
    `getIconBase` in interface `NodeModel`
  Returns:
    icon for given node
  Throws:
    `UnknownTypeException` - if this NodeModel implementation is not able to resolve icon for given node type

### performDefaultAction

    public void performDefaultAction(Object node)
                              throws UnknownTypeException

  Performs default action for given node.

  Specified by:
    `performDefaultAction` in interface `NodeActionsProvider`
  Throws:
    `UnknownTypeException` - if this NodeActionsProvider implementation is not able to resolve actions for given node type

### getActions

    public Action[] getActions(Object node)
                        throws UnknownTypeException

  Returns set of actions for given node.

  Specified by:
    `getActions` in interface `NodeActionsProvider`
  Returns:
    display name for given node
  Throws:
    `UnknownTypeException` - if this NodeActionsProvider implementation is not able to resolve actions for given node type

### getColumns

    public ColumnModel[] getColumns()

  Returns sorted array of `ColumnModel`s.

  Returns:
    sorted array of ColumnModels

### getValueAt

    public Object getValueAt(Object node,
                             String columnID)
                      throws UnknownTypeException

  Description copied from interface: `TableModel`
  Returns value to be displayed in column `columnID` and row identified by `node`. Column ID is defined in by `ColumnModel.getID()`, and rows are defined by values returned from `TreeModel.getChildren(java.lang.Object, int, int)`.

  Specified by:
    `getValueAt` in interface `TableModel`
  Parameters:
    `node` - a object returned from `TreeModel.getChildren(java.lang.Object, int, int)` for this row
    `columnID` - a id of column defined by `ColumnModel.getID()`
  Returns:
    value of variable representing given position in tree table.
  Throws:
    `UnknownTypeException` - if there is no TableModel defined for given parameter type

### isReadOnly

    public boolean isReadOnly(Object node,
                              String columnID)
                       throws UnknownTypeException

  Description copied from interface: `TableModel`
  Returns true if value displayed in column `columnID` and row `node` is read only. Column ID is defined in by `ColumnModel.getID()`, and rows are defined by values returned from `TreeModel.getChildren(java.lang.Object, int, int)`.

  Specified by:
    `isReadOnly` in interface `TableModel`
  Parameters:
    `node` - a object returned from `TreeModel.getChildren(java.lang.Object, int, int)` for this row
    `columnID` - a id of column defined by `ColumnModel.getID()`
  Returns:
    true if variable on given position is read only
  Throws:
    `UnknownTypeException` - if there is no TableModel defined for given parameter type

### setValueAt

    public void setValueAt(Object node,
                           String columnID,
                           Object value)
                    throws UnknownTypeException

  Description copied from interface: `TableModel`
  Changes a value displayed in column `columnID` and row `node`. Column ID is defined in by `ColumnModel.getID()`, and rows are defined by values returned from `TreeModel.getChildren(java.lang.Object, int, int)`.

  Specified by:
    `setValueAt` in interface `TableModel`
  Parameters:
    `node` - a object returned from `TreeModel.getChildren(java.lang.Object, int, int)` for this row
    `columnID` - a id of column defined by `ColumnModel.getID()`
    `value` - a new value of variable on given position
  Throws:
    `UnknownTypeException` - if there is no TableModel defined for given parameter type

### isExpanded

    public boolean isExpanded(Object node)
                       throws UnknownTypeException

  Defines default state (collapsed, expanded) of given node.

  Specified by:
    `isExpanded` in interface `TreeExpansionModel`
  Parameters:
    `node` - a node
  Returns:
    default state (collapsed, expanded) of given node
  Throws:
    `UnknownTypeException`

### nodeExpanded

    public void nodeExpanded(Object node)

  Called when given node is expanded.

  Specified by:
    `nodeExpanded` in interface `TreeExpansionModel`
  Parameters:
    `node` - a expanded node

### nodeCollapsed

    public void nodeCollapsed(Object node)

  Called when given node is collapsed.

  Specified by:
    `nodeCollapsed` in interface `TreeExpansionModel`
  Parameters:
    `node` - a collapsed node

### addModelListener

    public void addModelListener(ModelListener l)

  Registers given listener.

  Specified by:
    `addModelListener` in interface `NodeModel`
  Specified by:
    `addModelListener` in interface `TableModel`
  Specified by:
    `addModelListener` in interface `TreeModel`
  Parameters:
    `l` - the listener to add

### removeModelListener

    public void removeModelListener(ModelListener l)

  Unregisters given listener.

  Specified by:
    `removeModelListener` in interface `NodeModel`
  Specified by:
    `removeModelListener` in interface `TableModel`
  Specified by:
    `removeModelListener` in interface `TreeModel`
  Parameters:
    `l` - the listener to remove

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.spi.viewmodel/2 1.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.