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

TableModel (NetBeans View Model) - NetBeans API Javadoc 5.5.1

org.netbeans.spi.viewmodel/2 1.9.31

org.netbeans.spi.viewmodel
Interface TableModel

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

public interface TableModel
extends Model

Adds support for columns to basic TreeModel.


Method Summary
 void addModelListener(ModelListener l)
          Registers given listener.
 Object getValueAt(Object node, String columnID)
          Returns value to be displayed in column columnID and row identified by node.
 boolean isReadOnly(Object node, String columnID)
          Returns true if value displayed in column columnID and row node is read only.
 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.
 

Method Detail

getValueAt

Object getValueAt(Object node,
                  String columnID)
                  throws UnknownTypeException
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).

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

boolean isReadOnly(Object node,
                   String columnID)
                   throws UnknownTypeException
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).

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

void setValueAt(Object node,
                String columnID,
                Object value)
                throws UnknownTypeException
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).

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

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.31

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