net.sourceforge.esw.widgets.adapters
Class NodeTableAdapter

java.lang.Object
  |
  +--net.sourceforge.esw.util.SupportObject
        |
        +--net.sourceforge.esw.widgets.adapters.NodeTableAdapter
All Implemented Interfaces:
java.util.EventListener, ISupportObject, ITableAdapter, java.beans.PropertyChangeListener, java.io.Serializable

public class NodeTableAdapter
extends SupportObject
implements ITableAdapter, java.beans.PropertyChangeListener

This class will adapt an INode to a JTable for viewing.

See Also:
Serialized Form

Fields inherited from class net.sourceforge.esw.util.SupportObject
id, properties, propertyChildren, propertyListeners, vetoableChildren, vetoableListeners
 
Constructor Summary
NodeTableAdapter()
          Creates a new NodeTableAdapter
NodeTableAdapter(INode aNode)
          Creates a new NodeTableAdapter
 
Method Summary
 java.lang.String[] getColumnNames()
          Returns the names of the columns
 int getRowCount()
          Returns the number of rows to be displayed in the Viewer
 java.lang.Object getSelectedObject(int aRow)
          Returns the selected Object
 java.lang.Object getValueAt(int aRow, int aColumn)
          Returns the value at the specified column
 boolean isCellEditable(int aRow, int aColumn)
          Is the cell editable at the specifed row and column
 void propertyChange(java.beans.PropertyChangeEvent aPropertyChangeEvent)
          Listens for property change events
 void setModel(java.lang.Object aModel)
          Sets the model for the table
 void setValueAt(java.lang.Object aValue, int aRow, int aColumn)
          Sets the value at a specified row and column
 
Methods inherited from class net.sourceforge.esw.util.SupportObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.esw.util.ISupportObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty
 

Constructor Detail

NodeTableAdapter

public NodeTableAdapter(INode aNode)
Creates a new NodeTableAdapter
Parameters:
aDyna - the INode to display

NodeTableAdapter

public NodeTableAdapter()
Creates a new NodeTableAdapter
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent aPropertyChangeEvent)
Listens for property change events
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
aPropertyChangeEvent - The event of the PropertyChangeEvent

getColumnNames

public java.lang.String[] getColumnNames()
Returns the names of the columns
Specified by:
getColumnNames in interface ITableAdapter
Returns:
the names of the columns

getRowCount

public int getRowCount()
Returns the number of rows to be displayed in the Viewer
Specified by:
getRowCount in interface ITableAdapter
Returns:
the number of rows to be displayed in the Viewer

getValueAt

public java.lang.Object getValueAt(int aRow,
                                   int aColumn)
Returns the value at the specified column
Specified by:
getValueAt in interface ITableAdapter
Parameters:
aRow - the row to retrieve this data from
aColumn - the Column to return the data at
Returns:
the Object at the specified column from the DataStruture

isCellEditable

public boolean isCellEditable(int aRow,
                              int aColumn)
Is the cell editable at the specifed row and column
Specified by:
isCellEditable in interface ITableAdapter
Parameters:
aRow - the row to get check for edit-ness
aColumn - the column to check for edit-ness
Returns:
whether the cell at the row/column is editable

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int aRow,
                       int aColumn)
Sets the value at a specified row and column
Specified by:
setValueAt in interface ITableAdapter
Parameters:
aValue - the value to set to
aRow - The row to edit
aColumn - the column to set the value of

getSelectedObject

public java.lang.Object getSelectedObject(int aRow)
Returns the selected Object
Specified by:
getSelectedObject in interface ITableAdapter
Parameters:
aRow - the row to return the object from
Returns:
the Object selected at the given row

setModel

public void setModel(java.lang.Object aModel)
Sets the model for the table
Specified by:
setModel in interface ITableAdapter
Parameters:
model - the model for the table


Copyright 2002 Free Software Foundation. All Rights Reserved.