D - The class of the model object displayed in the table.public class Table<D> extends Table
Table used to display instances
of objects of the type specified.
© Copyright 2007 Sans Pareil Technologies, Inc.
| Modifier and Type | Class and Description |
|---|---|
protected class |
Table.DefaultActionListener
The default
ActionListener for the
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_PROPERTYCHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_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| Modifier | Constructor and Description |
|---|---|
protected |
Table()
Default constructor.
|
|
Table(TableModel<D> model)
Create a new table using the specified model for its data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(D row)
Add the specified object to the end of the backing table model.
|
void |
addSelectionListener(SelectionListener<D,? extends Table> listener)
Adds a selection listener to be notified of row selections.
|
void |
deleteRow(D rowData)
Delete the row(s) containing the specified object from the model.
|
void |
deleteRow(int row)
Delete the specified row from the model.
|
protected TableNavigation |
fetchNavigation(Component parent)
Returns the associated
TableNavigation component for this
table. |
protected void |
fireRowSelection()
Notifies configured
SelectionListener of row selections. |
TableModel<D> |
getModel()
Over-ridden to return a properly type-cast model.
|
void |
init()
Life-cyle method invoked when the component is added to the
component hierarchy.
|
void |
insertRow(int row,
D rowData)
Insert the specified object at the specified row index into the backing
table model.
|
void |
removeSelectionListener(SelectionListener<D,? extends Table> listener)
Remove a selection listener from being notified of row selections.
|
void |
setModel(TableModel model)
Over-ridden to only allow instances of
TableModel. |
protected void |
updateNavigation()
Updates the associated
TableNavigation component for this
table. |
void |
updateRow(int row,
D rowData)
Replace the row specified with the object specified.
|
add, addActionListener, createDefaultColumnsFromModel, doRender, getActionCommand, getBorder, getColumnModel, getDefaultHeaderRenderer, getDefaultRenderer, getInsets, getRolloverBackground, getRolloverBackgroundImage, getRolloverFont, getRolloverForeground, getSelectionBackground, getSelectionBackgroundImage, getSelectionFont, getSelectionForeground, getSelectionModel, getWidth, hasActionListeners, invalidate, isAutoCreateColumnsFromModel, isHeaderVisible, isRolloverEnabled, isSelectionEnabled, processInput, remove, removeActionListener, setActionCommand, setAutoCreateColumnsFromModel, setBorder, setColumnModel, setDefaultHeaderRenderer, setDefaultRenderer, setHeaderVisible, setInsets, setRolloverBackground, setRolloverBackgroundImage, setRolloverEnabled, setRolloverFont, setRolloverForeground, setSelectionBackground, setSelectionBackgroundImage, setSelectionEnabled, setSelectionFont, setSelectionForeground, setSelectionModel, setWidth, validateadd, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOfprotected Table()
public Table(TableModel<D> model)
TableModel.init() method is invoked, so callers do not need
to initialise the table model.model - The underlying data model to use for the table.public void init()
public void addSelectionListener(SelectionListener<D,? extends Table> listener)
listener - The listener to add.Component.getEventListenerList()public void removeSelectionListener(SelectionListener<D,? extends Table> listener)
listener - The listener to remove.public void setModel(TableModel model)
TableModel.setModel in class Tablemodel - The table model to use for this component.IllegalArgumentException - If the specified table mode is not
an instance of TableModel.public TableModel<D> getModel()
public void addRow(D row)
ListSelectionModel may be
affected through this method only.row - The data object that is to be added to the model.TableModel.addRow(Object),
updateNavigation()public void insertRow(int row,
D rowData)
ListSelectionModel may be
affected through this method only.row - The index at which the object is to be inserted.rowData - The object that is to be added to the model.TableModel.insertRow(int, D),
updateNavigation()public void deleteRow(int row)
ListSelectionModel may be affected through
this method only.row - The index of the row that is to be deleted.TableModel.deleteRow( int ),
updateNavigation()public void deleteRow(D rowData)
ListSelectionModel may be affected
through this method only.rowData - The object that is to be removed.deleteRow( int )public void updateRow(int row,
D rowData)
ListSelectionModel may be affected
through this method only.row - The index at which the object is to be updated.rowData - The new object that is to be used in the model.TableModel.updateRow(int, D)protected void fireRowSelection()
SelectionListener of row selections.protected void updateNavigation()
TableNavigation component for this
table.fetchNavigation( Component )protected TableNavigation fetchNavigation(Component parent)
TableNavigation component for this
table.parent - The component whose children are to iterated over.null.