org.formaria.swing
Class Table

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by org.formaria.swing.Table
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable, RowSelector, ErrorDisplay, ListenerHelper, ModelHolder, PersistentState, StyleComponent, AdaptedTable
Direct Known Subclasses:
TableModelView

public class Table
extends javax.swing.JTable
implements ModelHolder, StyleComponent, RowSelector, ListenerHelper, javax.swing.event.ListSelectionListener, PersistentState, AdaptedTable, ErrorDisplay

Provides a wrapper for the JTable and offer some compatibility with the AWT version of the Table.

Copyright (c) Formaria Ltd., 2008
License: see license.txt $Revision: 2.12 $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Color altUnselectedBackground
           
protected  java.awt.Color altUnselectedForeground
           
protected  Project currentProject
          The owner project and the context in which this object operates.
protected  boolean doTranslation
           
protected  boolean editable
           
protected  java.lang.String errorMessage
           
protected  int errorStatus
           
protected  java.lang.String headerStyle
           
protected  HandlerInvoker invoker
           
protected  int oldRowSelection
           
protected  java.lang.String rendererClass
           
protected  java.util.Hashtable renderers
           
protected  TableModelAdapter tableModelAdapter
           
protected  boolean updateModelSelection
           
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Table()
          Create a new table
 
Method Summary
 void addHandler(java.lang.Object page, java.lang.String handlerType, java.lang.String methodName)
          Add an event handler response method to a component such that the page's response method is invoked when the event occurs
 void addRenderer(int column, javax.swing.table.TableCellRenderer renderer)
          Add a cell renderer for the specified column
 void clearSelection()
          Deselects all selected columns and rows.
protected  javax.swing.table.JTableHeader createDefaultTableHeader()
           
 void displayAsColorField(int column, java.util.Hashtable colors)
          Display the field formatted with a background color from the hashtable such that the field value acts as a key into the hashtable of colors
 void displayAsNumericField(int column, java.text.Format format)
          Display the field as a numeric value
 void first()
          Move to the first row
 BaseModel getBaseModel()
          Retrieve the TableModel.
 javax.swing.table.TableCellEditor getCellEditor(int row, int column)
          Retrieves the TableCellEditor for a cell if one has been specified with the "editor" attribute
 BaseModel getCellModel(java.lang.String rowName)
           
 javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)
          Get a render for this cell
 java.lang.String getCellValue(java.lang.String rowName)
           
 double getCellValueAsDouble(java.lang.String rowName)
           
 DataModel getDataModel()
          Get the underlying model.
 java.lang.String getFieldName(int column, java.lang.String field)
          Get the displayable field name
 java.lang.String getFieldValue(int fieldIdx)
          Gets a field value as a string from the currently selected row
 java.lang.String getFieldValue(int rowIdx, int fieldIdx)
          Gets a field value as a string from the specified row
 java.lang.String getHeaderStyle()
          Retrieve the name of the header style
 ModelListener getParentListener()
           
 BaseModel getRow(int i)
          Retrieve the row of the TableModelAdapter which represents the passed index
 boolean getScrollableTracksViewportHeight()
          Force the scroll pane to set the component size if there is no data - otherwise the table would have no height
 boolean getTranslated()
          Get the translateable state of the table
 java.lang.Object getValue(int fieldIdx)
          Gets a field value object from the currently selected row
 java.lang.Object getValue(int rowIdx, int fieldIdx)
          Gets a field value object from the specified row
 boolean isCellEditable(int row, int column)
          Retrieves the TableCellEditor for a cell if one has been specified with the "editor" attribute
 boolean isInteractiveTable()
          Deprecated.  
 void last()
          Move to the last row
 void next()
          Move to the next row
 void paint(java.awt.Graphics g)
          Paint the component, rendering the error badge if necessary
 java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer, int row, int column)
           
 void prev()
          Move to the previous row
 void restoreState(XmlElement stateElement)
          Restore the application state
 void saveState(XmlElement stateElement)
          Save the application state
 void setAltStyle(java.lang.String style)
          Set the style of the alternate rows
 void setAltUnselectedColors(java.awt.Color frgd, java.awt.Color bkgd)
          Set the colors for alternate ( odd ) row colors
 void setBorder(java.lang.String borderType)
          Set the border type
 void setBorderStyle(java.lang.String styleName)
          Set the style of the border
 void setBuddy(Table table)
          Method for use by the TableSplitter
 void setCellValue(BaseModel templateModel, java.lang.String col, java.lang.String attrib, java.lang.String value)
           
 void setColWidth(int columnIdx, int width)
          Set the column width.
 void setDataModel(DataModel aModel)
          Set the model data.
 void setEditable(boolean value)
          Set the editable state
 void setErrorMessage(java.lang.String errorMsg)
          Set the error message
 void setErrorStatus(int status)
          Set the error status
 void setGridColor(java.awt.Color color)
          Set the grid color for both tables
 void setGridStyle(java.lang.String style)
          Set the style of the s
 void setHeaderStyle(java.lang.String style)
          Set the style of the header data
 void setInteractiveTable(boolean state)
          Deprecated.  
 void setModelAdapter(TableModelAdapter xmodel)
          Set the DataModel which we will be generating the table from
 void setRendererClass(java.lang.String className)
          Set the renderer.
 void setRollOverRowIndex(int idx)
           
 void setRowHeight(int h)
          Sets the height, in pixels, of all cells to rowHeight, revalidates, and repaints.
 void setRowHeight(int row, int rowHeight)
          Sets the height for row to rowHeight, revalidates, and repaints.
 void setSelectedRow(int idx)
          Sets the indexof the selected row
 void setSelectedStyle(java.lang.String style)
          Set the style of the selected row
 void setSelectionMode(java.lang.String value)
          Set the table selection mode
 void setSelectionStyle(java.lang.String style)
          Set the style of the selected row
 void setStyle(java.lang.String style)
          Set the general style of the Table
 void setTranslated(boolean state)
          Set the translateable state of the model
 void setUpdateModelSelection(boolean doUpdate)
          Tie the model selection to this table's selection
 void setViewportBackground(java.awt.Color viewportBkColor)
          Set the background color of the table's viewport
protected  void translateTable(TableModelAdapter model)
          Deprecated.  
 void update()
          The model is modified and the UI needs to be updated.
 void updateBuddy()
           
 void updateTable()
          Force the table to update itself
 void valueChanged(javax.swing.event.ListSelectionEvent le)
          The row selection has changes, update the model if required.
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.formaria.aria.data.RowSelector
getSelectedRow
 

Field Detail

currentProject

protected Project currentProject
The owner project and the context in which this object operates.


tableModelAdapter

protected TableModelAdapter tableModelAdapter

updateModelSelection

protected boolean updateModelSelection

invoker

protected HandlerInvoker invoker

oldRowSelection

protected int oldRowSelection

headerStyle

protected java.lang.String headerStyle

editable

protected boolean editable

doTranslation

protected boolean doTranslation

altUnselectedForeground

protected java.awt.Color altUnselectedForeground

altUnselectedBackground

protected java.awt.Color altUnselectedBackground

renderers

protected java.util.Hashtable renderers

rendererClass

protected java.lang.String rendererClass

errorStatus

protected int errorStatus

errorMessage

protected java.lang.String errorMessage
Constructor Detail

Table

public Table()
Create a new table

Method Detail

createDefaultTableHeader

protected javax.swing.table.JTableHeader createDefaultTableHeader()
Overrides:
createDefaultTableHeader in class javax.swing.JTable

update

public void update()
Description copied from interface: ModelHolder
The model is modified and the UI needs to be updated.

Specified by:
update in interface ModelHolder

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Force the scroll pane to set the component size if there is no data - otherwise the table would have no height

Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable
Overrides:
getScrollableTracksViewportHeight in class javax.swing.JTable

updateTable

public void updateTable()
Force the table to update itself


updateBuddy

public void updateBuddy()

addHandler

public void addHandler(java.lang.Object page,
                       java.lang.String handlerType,
                       java.lang.String methodName)
                throws java.lang.NoSuchMethodException
Add an event handler response method to a component such that the page's response method is invoked when the event occurs

Specified by:
addHandler in interface ListenerHelper
Parameters:
page - the page containing the method
handlerType - the type of event handler
methodName - the method to invoke
Throws:
java.lang.NoSuchMethodException - cannot add the handler

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent le)
The row selection has changes, update the model if required.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Overrides:
valueChanged in class javax.swing.JTable
Parameters:
le - the list selection event

setModelAdapter

public void setModelAdapter(TableModelAdapter xmodel)
Set the DataModel which we will be generating the table from

Specified by:
setModelAdapter in interface AdaptedTable
Parameters:
xmodel - The DataModel of data

getDataModel

public DataModel getDataModel()
Get the underlying model.

Returns:
the model

setDataModel

public void setDataModel(DataModel aModel)
Description copied from interface: ModelHolder
Set the model data.

Specified by:
setDataModel in interface ModelHolder
Parameters:
aModel - the model node containing the data to be used by the component

setStyle

public void setStyle(java.lang.String style)
Set the general style of the Table

Specified by:
setStyle in interface StyleComponent
Parameters:
style - Style

setViewportBackground

public void setViewportBackground(java.awt.Color viewportBkColor)
Set the background color of the table's viewport

Parameters:
viewportBkColor - the viewport background color

setHeaderStyle

public void setHeaderStyle(java.lang.String style)
Set the style of the header data

Parameters:
style - Style

getHeaderStyle

public java.lang.String getHeaderStyle()
Retrieve the name of the header style

Returns:
the header style name;

setSelectionStyle

public void setSelectionStyle(java.lang.String style)
Set the style of the selected row

Parameters:
style - Style

setSelectedStyle

public void setSelectedStyle(java.lang.String style)
Set the style of the selected row

Parameters:
style - Style

setBorderStyle

public void setBorderStyle(java.lang.String styleName)
Set the style of the border

Parameters:
styleName - the style name

setAltStyle

public void setAltStyle(java.lang.String style)
Set the style of the alternate rows

Parameters:
style - Style

setGridStyle

public void setGridStyle(java.lang.String style)
Set the style of the s

Parameters:
style - Style

setAltUnselectedColors

public void setAltUnselectedColors(java.awt.Color frgd,
                                   java.awt.Color bkgd)
Set the colors for alternate ( odd ) row colors

Parameters:
frgd - the foreground color
bkgd - the background color

setGridColor

public void setGridColor(java.awt.Color color)
Set the grid color for both tables

Overrides:
setGridColor in class javax.swing.JTable
Parameters:
color - the new grid color

setRowHeight

public void setRowHeight(int h)
Sets the height, in pixels, of all cells to rowHeight, revalidates, and repaints. The height of the cells will be equal to the row height minus the row margin.

Overrides:
setRowHeight in class javax.swing.JTable
Parameters:
rowHeight - new row height
Throws:
java.lang.IllegalArgumentException - if rowHeight is less than 1
See Also:
JTable.getRowHeight()

setRowHeight

public void setRowHeight(int row,
                         int rowHeight)
Sets the height for row to rowHeight, revalidates, and repaints. The height of the cells in this row will be equal to the row height minus the row margin.

Overrides:
setRowHeight in class javax.swing.JTable
Parameters:
row - the row whose height is being changed
rowHeight - new row height, in pixels
Throws:
java.lang.IllegalArgumentException - if rowHeight is less than 1
Since:
1.3

isInteractiveTable

public boolean isInteractiveTable()
Deprecated. 

Check the if the table is interactive

Returns:
true if the table supports user interaction

setInteractiveTable

public void setInteractiveTable(boolean state)
Deprecated. 

Set the user interaction state

Parameters:
state - true for an user interactive table.

setSelectedRow

public void setSelectedRow(int idx)
Sets the indexof the selected row

Specified by:
setSelectedRow in interface RowSelector
Parameters:
idx - the new selected row

clearSelection

public void clearSelection()
Deselects all selected columns and rows.

Overrides:
clearSelection in class javax.swing.JTable

setTranslated

public void setTranslated(boolean state)
Set the translateable state of the model

Parameters:
state - 'true' for a transalted table

getTranslated

public boolean getTranslated()
Get the translateable state of the table

Returns:
true if the table is translateable

first

public void first()
Move to the first row


prev

public void prev()
Move to the previous row


next

public void next()
Move to the next row


last

public void last()
Move to the last row


setUpdateModelSelection

public void setUpdateModelSelection(boolean doUpdate)
Tie the model selection to this table's selection

Parameters:
doUpdate - true to tie the selections together, false to ignore

setColWidth

public void setColWidth(int columnIdx,
                        int width)
Set the column width. Sets the maximum width as a workaround for a Swing problem

Parameters:
columnIdx - the column index
width - the new width

setRendererClass

public void setRendererClass(java.lang.String className)
Set the renderer. The renderer should be set prior to any rendering of the component.

Parameters:
className - the full clas name

setBorder

public void setBorder(java.lang.String borderType)
Set the border type

Parameters:
borderType - "0" for none

setEditable

public void setEditable(boolean value)
Set the editable state

Parameters:
value - the new state

setSelectionMode

public void setSelectionMode(java.lang.String value)
Set the table selection mode

Parameters:
value - 'multiple' for ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, other wise ListSelectionModel.SINGLE_INTERVAL_SELECTION

getValue

public java.lang.Object getValue(int fieldIdx)
Gets a field value object from the currently selected row

Parameters:
fieldIdx - the field offset
Returns:
the value

getValue

public java.lang.Object getValue(int rowIdx,
                                 int fieldIdx)
Gets a field value object from the specified row

Parameters:
rowIdx - the row offset
fieldIdx - the field offset
Returns:
the value

getFieldValue

public java.lang.String getFieldValue(int fieldIdx)
Gets a field value as a string from the currently selected row

Parameters:
fieldIdx - the field offset
Returns:
the value

getFieldValue

public java.lang.String getFieldValue(int rowIdx,
                                      int fieldIdx)
Gets a field value as a string from the specified row

Parameters:
rowIdx - the row offset
fieldIdx - the field offset
Returns:
the value

getFieldName

public java.lang.String getFieldName(int column,
                                     java.lang.String field)
Get the displayable field name

Specified by:
getFieldName in interface AdaptedTable
Parameters:
column - the column index
field -
Returns:

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Retrieves the TableCellEditor for a cell if one has been specified with the "editor" attribute

Overrides:
isCellEditable in class javax.swing.JTable
Parameters:
row - the row/record index (zero based)
column - the column/field index (zero based)

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int column)
Retrieves the TableCellEditor for a cell if one has been specified with the "editor" attribute

Overrides:
getCellEditor in class javax.swing.JTable
Parameters:
row - the row/record index (zero based)
column - the column/field index (zero based)

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                           int column)
Get a render for this cell

Overrides:
getCellRenderer in class javax.swing.JTable

displayAsNumericField

public void displayAsNumericField(int column,
                                  java.text.Format format)
Display the field as a numeric value

Parameters:
column - the column or field index
format - format the number format to use in displaying the field

displayAsColorField

public void displayAsColorField(int column,
                                java.util.Hashtable colors)
Display the field formatted with a background color from the hashtable such that the field value acts as a key into the hashtable of colors

Parameters:
column - the column or field index
colors - the color hashtable

addRenderer

public void addRenderer(int column,
                        javax.swing.table.TableCellRenderer renderer)
Add a cell renderer for the specified column

Parameters:
column - the column or field index

translateTable

protected void translateTable(TableModelAdapter model)
Deprecated. 

Uses the Translator Singleton instance to translate the contents of the table.

Parameters:
model - The table model

getBaseModel

public BaseModel getBaseModel()
Retrieve the TableModel.

Returns:
TableModelAdapter if it is of this type otherwise null

getRow

public BaseModel getRow(int i)
Retrieve the row of the TableModelAdapter which represents the passed index

Parameters:
i - the row required
Returns:
the row as an BaseModel

setCellValue

public void setCellValue(BaseModel templateModel,
                         java.lang.String col,
                         java.lang.String attrib,
                         java.lang.String value)

getCellValue

public java.lang.String getCellValue(java.lang.String rowName)

getCellModel

public BaseModel getCellModel(java.lang.String rowName)

getCellValueAsDouble

public double getCellValueAsDouble(java.lang.String rowName)

getParentListener

public ModelListener getParentListener()

setBuddy

public void setBuddy(Table table)
Method for use by the TableSplitter

Parameters:
buddy -

setRollOverRowIndex

public void setRollOverRowIndex(int idx)

prepareRenderer

public java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer,
                                          int row,
                                          int column)
Overrides:
prepareRenderer in class javax.swing.JTable

restoreState

public void restoreState(XmlElement stateElement)
Restore the application state

Specified by:
restoreState in interface PersistentState

saveState

public void saveState(XmlElement stateElement)
Save the application state

Specified by:
saveState in interface PersistentState
Parameters:
stateElement - the elements to hold the page state

paint

public void paint(java.awt.Graphics g)
Paint the component, rendering the error badge if necessary

Overrides:
paint in class javax.swing.JComponent
Parameters:
g -

setErrorStatus

public void setErrorStatus(int status)
Set the error status

Specified by:
setErrorStatus in interface ErrorDisplay
Parameters:
status -

setErrorMessage

public void setErrorMessage(java.lang.String errorMsg)
Set the error message

Specified by:
setErrorMessage in interface ErrorDisplay
Parameters:
errorMsg - the message text