SPT Core API

com.sptci.echo2.table
Class RowSetTable

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.app.Table
          extended by com.sptci.echo2.table.RowSetTable
All Implemented Interfaces:
Serializable, RenderIdSupport
Direct Known Subclasses:
DatabaseTable

public class RowSetTable
extends Table

A Table used to display data contained in a RowSetTableModel.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: RowSetTable.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-09-19
See Also:
Serialized Form

Nested Class Summary
protected  class RowSetTable.DefaultActionListener
          The default ActionListener for the table.
 
Field Summary
 
Fields inherited from class nextapp.echo2.app.Table
ACTION_LISTENERS_CHANGED_PROPERTY, AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY, COLUMN_MODEL_CHANGED_PROPERTY, DEFAULT_HEADER_RENDERER_CHANGED_PROPERTY, DEFAULT_RENDERER_CHANGED_PROPERTY, DEFAULT_TABLE_CELL_RENDERER, HEADER_ROW, HEADER_VISIBLE_CHANGED_PROPERTY, INPUT_ACTION, MODEL_CHANGED_PROPERTY, PROPERTY_ACTION_COMMAND, PROPERTY_BORDER, PROPERTY_INSETS, PROPERTY_ROLLOVER_BACKGROUND, PROPERTY_ROLLOVER_BACKGROUND_IMAGE, PROPERTY_ROLLOVER_ENABLED, PROPERTY_ROLLOVER_FONT, PROPERTY_ROLLOVER_FOREGROUND, PROPERTY_SELECTION_BACKGROUND, PROPERTY_SELECTION_BACKGROUND_IMAGE, PROPERTY_SELECTION_ENABLED, PROPERTY_SELECTION_FONT, PROPERTY_SELECTION_FOREGROUND, PROPERTY_WIDTH, SELECTION_CHANGED_PROPERTY, SELECTION_MODEL_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
protected RowSetTable()
          Default constructor.
  RowSetTable(RowSetTableModel model)
          Create a new table using the specified model for its data.
 
Method Summary
 void addSelectionListener(SelectionListener<RowSet,RowSetTable> listener)
          Adds a selection listener to be notified of row selections.
 void dispose()
          Over-ridden to close the RowSet associated with this table's model.
protected  void fireRowSelection()
          Notifies configured SelectionListener of row selections.
 RowSetTableModel getModel()
          Over-ridden to return a properly type-cast model.
 void init()
          Initialise the table model.
 void removeSelectionListener(SelectionListener<RowSet,RowSetTable> listener)
          Remove a selection listener from being notified of row selections.
 void setModel(TableModel model)
          Over-ridden to throw IllegalArgumentException if the specified model is not an instance of RowSetTableModel.
 
Methods inherited from class nextapp.echo2.app.Table
addActionListener, createDefaultColumnsFromModel, doRender, getActionCommand, getBorder, getCellComponent, getColumnModel, getDefaultHeaderRenderer, getDefaultRenderer, getInsets, getRolloverBackground, getRolloverBackgroundImage, getRolloverFont, getRolloverForeground, getSelectionBackground, getSelectionBackgroundImage, getSelectionFont, getSelectionForeground, getSelectionModel, getWidth, hasActionListeners, invalidate, isAutoCreateColumnsFromModel, isHeaderVisible, isRolloverEnabled, isSelectionEnabled, processInput, removeActionListener, setActionCommand, setAutoCreateColumnsFromModel, setBorder, setColumnModel, setDefaultHeaderRenderer, setDefaultRenderer, setHeaderVisible, setInsets, setRolloverBackground, setRolloverBackgroundImage, setRolloverEnabled, setRolloverFont, setRolloverForeground, setSelectionBackground, setSelectionBackgroundImage, setSelectionEnabled, setSelectionFont, setSelectionForeground, setSelectionModel, setWidth, validate
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowSetTable

protected RowSetTable()
Default constructor.


RowSetTable

public RowSetTable(RowSetTableModel model)
            throws IllegalArgumentException
Create a new table using the specified model for its data.

Parameters:
model - The underlying data model to use for the table.
Throws:
IllegalArgumentException - If the specified model does not implement RowSetTableModel.
Method Detail

init

public void init()
Initialise the table model.

Overrides:
init in class Component

getModel

public RowSetTableModel getModel()
Over-ridden to return a properly type-cast model.

Overrides:
getModel in class Table
Returns:
The properly type cast model instance.

setModel

public void setModel(TableModel model)
              throws IllegalArgumentException
Over-ridden to throw IllegalArgumentException if the specified model is not an instance of RowSetTableModel.

Overrides:
setModel in class Table
Parameters:
model - The model to use for this table.
Throws:
IllegalArgumentException - If the specified model does not implement RowSetTableModel.

dispose

public void dispose()
Over-ridden to close the RowSet associated with this table's model.

Overrides:
dispose in class Component
See Also:
RowSetTableModel.dispose()

addSelectionListener

public void addSelectionListener(SelectionListener<RowSet,RowSetTable> listener)
Adds a selection listener to be notified of row selections.

Parameters:
listener - The listener to add.
See Also:
Component.getEventListenerList()

removeSelectionListener

public void removeSelectionListener(SelectionListener<RowSet,RowSetTable> listener)
Remove a selection listener from being notified of row selections.

Parameters:
listener - The listener to remove.

fireRowSelection

protected void fireRowSelection()
                         throws RuntimeException
Notifies configured SelectionListener of row selections.

Throws:
RuntimeException - If errors are encountered while fetching the RowSet with the cursor postiion at the selected row.

SPT Core API