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

TableModel (NetBeans View Model) - NetBeans API Javadoc 4.1.0

 

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

public 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

public 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

public 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

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.