com.retek.commons.gui.table
Class RLayerTable

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.retek.commons.gui.widget.RPanel
                      extended bycom.retek.commons.gui.table.RLayerTable
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ComponentListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, REventListener, java.io.Serializable

public class RLayerTable
extends RPanel
implements java.beans.PropertyChangeListener, java.awt.event.ComponentListener, java.awt.event.FocusListener

BUGS #1) NO REFRESH OF ROWS AFTER PROPERTIES CHANGES #2) TABLE MOVES ON THE FIRST COLLAPSE OR EXPAND.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
RLayerTable()
          Creates a new RLayerTable that only allows one level of rows.
RLayerTable(int levels)
          Creates a new RLayerTable that allows multiple levels of rows.
 
Method Summary
 void addRow(int level, java.lang.String[] values)
          Adds a row of values to the table at the specified row level.
 void addRow(int level, java.lang.String[] values, java.lang.Object object)
          Adds a row of values to the table at the specified row level, along with an object to store within the row.
 void addRow(java.lang.String[] values)
          Adds a row of values to the table as a primary row.
 void addRow(java.lang.String[] values, java.lang.Object object)
          Adds a row of values along with an object to store to the table as a primary row.
 void clear()
          Clears the table of all rows.
 void clearSelection()
          Clears the table selection.
 void componentHidden(java.awt.event.ComponentEvent event)
           
 void componentMoved(java.awt.event.ComponentEvent event)
           
 void componentResized(java.awt.event.ComponentEvent event)
          Implements the component listener method.
 void componentShown(java.awt.event.ComponentEvent event)
           
 int findRowForObject(java.lang.Object object)
          Finds a row index for given object stored within a row.
 void focusGained(java.awt.event.FocusEvent event)
          Implements the FocusListener method.
 void focusLost(java.awt.event.FocusEvent event)
          Implements the FocusListener method.
 java.lang.Object getDataObject(int row)
          Retrieves the stored object within the row.
 int getFocusIndex()
          Retrieves the index of the current row with focus.
 int getRowCount()
          Retrieves the number of rows in the table.
 java.lang.Object getSelectedObject()
          Retrieves the stored object within the selected row.
 java.lang.Object getSelectedPrimaryObject()
          Retrieves the stored object within the primary row of the selected row.
 int getSelectedPrimaryRow()
          Retrieves the index of the primary row for the current selected row.
 java.lang.String[] getSelectedPrimaryValues()
          Retrieves the row values used to display information within the primary row associated to the selected row.
 int getSelectedRow()
          Retrieves the selected row number/index.
 java.lang.String[] getSelectedValues()
          Retrieves the row values used to display information within the selected row.
 java.lang.String[] getValues(int row)
          Retrieves the values for a row.
 boolean hasDataObject(java.lang.Object object)
          Retrieves whether or not the table contains the specified data object.
 void insertRow(int level, int rowIndex, java.lang.String[] values)
          Inserts a row into the table at the specified row number.
 void insertRow(int level, int rowIndex, java.lang.String[] values, java.lang.Object object)
          Inserts a row into the table at the specified row number.
 void insertRow(int rowIndex, java.lang.String[] values)
          Inserts a row into the table at the specified row number.
 boolean isEmpty()
          Retrieves whether or not the table is empty.
 boolean isFirstRowFocused()
           
 boolean isFirstRowSelected()
          Retrieves whether or not the first row of the table is selected.
 boolean isLastRowFocused()
           
 boolean isLastRowSelected()
          Retrieves whether or not the last row of the table is selected.
 void performActionEvent(RActionEvent event)
          Parses all received RActionEvents and calls the appropriate method.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Executes a repaint whenever a property change event is received.
 void removeRow(int rowIndex)
          Remove the row identified by the given row number.
 void removeRow(java.lang.Object object)
          Remove the row identified by the given object.
 void resort()
          Sorts the information in the table based on the last column used to sort.
 void selectNextRow()
          Selects the previous row in the table.
 void selectPreviousRow()
          Selects the next row in the table.
 void setBackground(java.awt.Color background)
          Assigns the background color to the table.
 void setColumnBackground(int level, int column, java.awt.Color background)
          Assigns the background color to a specific column within a specific row level of the table.
 void setColumnBackground(java.lang.String column, java.awt.Color background)
          Assigns the background color to all primary rows..
 void setColumnCount(int level, int columns)
          Assigns a number of columns to a particular row by level.
 void setColumnFont(int level, int column, java.awt.Font font)
          Assigns a font to a specific row level and column of the table.
 void setColumnFont(java.lang.String column, java.awt.Font font)
          Assigns a font to a column of the primary row level.
 void setColumnFontStyle(int level, int column, int style, int size)
          Alters the font of a particular row level and column.
 void setColumnFontStyle(java.lang.String label, int style, int size)
          Alters the font of a column of the primary row.
 void setColumnForeground(int level, int column, java.awt.Color foreground)
          Assigns the foreground color to a specific column within a specific row level of the table.
 void setColumnForeground(java.lang.String column, java.awt.Color foreground)
          Assigns the foreground color to all primary rows..
 void setColumnGap(int gap)
          Assigns a column gap to all the columns within the primary a row.
 void setColumnGap(int level, int gap)
          Assigns a column gap to all the columns within the specified row level.
 void setColumnIcon(int level, int column, java.lang.String filename)
          Assigns an icon to a column within a row level.
 void setColumnIcon(java.lang.String label, java.lang.String filename)
          Assigns an icon to a column in the primary row.
 void setColumnLabels(java.util.List list)
          Assigns the column header labels using a list.
 void setColumnLabels(java.lang.String[] labels)
          Assigns the column header labels using a string array.
 void setColumnMask(int level, int column, Mask mask)
          Assigns a mask to a column within a row level.
 void setColumnMask(java.lang.String label, Mask mask)
          Assigns a mask to a column within the primary row.
 void setColumnType(int level, int column, int columnType)
          Assigns a column type to a particular column.
 void setColumnType(java.lang.String label, int columnType)
          Assigns a column type to a particular column.
 void setColumnWidth(int level, int column, int width)
          Assigns a column width to a specific column of a specific row level of the table.
 void setColumnWidth(java.lang.String label, int width)
          Assigns a column width to a specific column of the primary row.
 void setComponentType(int level, int column, int componentType)
          Assigns the component type based on row level and column.
 void setComponentType(java.lang.String label, int componentType)
          Assigns the component type of the primary row by header label.
 void setDefaultSortColumns(int[] defaultSortColumns)
          Sets the default columns to sort on.
 void setDoubleClickCommand(java.lang.String command)
          Assigns a double click action command.
 void setFont(java.awt.Font font)
          Assigns a font to the table.
 void setFontStyle(int style, int size)
          Alters the default font of the table to the new style and size.
 void setForeground(java.awt.Color foreground)
          Assigns the foreground color to the table.
 void setIndentation(int level, int indentation)
          Assigns an indentation to a row by its level.
 void setJustification(int level, int column, int justification)
          Assigns a justification to a particular column..
 void setJustification(java.lang.String label, int justification)
          Assigns a justification to a particular column..
 void setMnemonic(java.lang.String label, char mnemonic)
          Assigns a mnemonic to a column in the header row.
 void setRowBackground(int level, java.awt.Color background)
          Assigns the background color to a specific row of the table by its level.
 void setRowFont(int level, java.awt.Font font)
          Assigns a font to a specific row level of the table.
 void setRowFontStyle(int level, int style, int size)
          Alters the font of a particular row level.
 void setRowForeground(int level, java.awt.Color foreground)
          Assigns the foreground color to a specific row of the table by its level.
 void setRowHeight(int height)
          Assigns the row height of the table.
 void setRowHeight(int level, int height)
          Assigns the row height of the table.
 void setSelectedBackground(java.awt.Color background)
          Assigns the selection background of the table.
 void setSelectedRow(int row)
          Selects the row.
 void setSelectedRow(java.lang.Object object)
          Selects the row based on a data object.
 void setSelectionForeground(java.awt.Color foreground)
          Assigns the selection foreground of the table.
 void setSingleClickCommand(java.lang.String command)
          Assigns a single click action command.
 void setSortingEnabled(boolean enabled)
          Enables or disables sorting on the table.
 void toggleExpansionMode()
          Reverses the expansion mode on the layer.
 void updateRow(int rowIndex, java.lang.String[] values)
          Updates a row in the table identified by the row number.
 void updateRow(java.lang.Object object, java.lang.String[] values)
          Updates a row in the table identified by an object.
 
Methods inherited from class com.retek.commons.gui.widget.RPanel
addREventListener, getFocusCycleComponents, notifyREventListeners, notifyREventListeners, performErrorEvent, removeAllREventListeners, removeREventListener, repaintPanel, setEmptyBorder, setEmptyBorder, setFocusCycleComponents, setLineBorder, setLineBorder, setLoweredBevelBorder, setMinimumHeight, setRaisedBevelBorder, setTitleBorder, setTitleBorder, setTitleBorder, setTitleBorder
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 

Constructor Detail

RLayerTable

public RLayerTable()
Creates a new RLayerTable that only allows one level of rows.


RLayerTable

public RLayerTable(int levels)
Creates a new RLayerTable that allows multiple levels of rows.

Parameters:
levels - The number of row levels to be allowed in the table.
Method Detail

setColumnLabels

public void setColumnLabels(java.util.List list)
Assigns the column header labels using a list.

Parameters:
list - A list of column header labels (strings).

setColumnLabels

public void setColumnLabels(java.lang.String[] labels)
Assigns the column header labels using a string array.

Parameters:
labels - The column header labels to assign to the table.

setColumnCount

public void setColumnCount(int level,
                           int columns)
Assigns a number of columns to a particular row by level. The number of columns in the primary row (level 0) is assigned by the declaration of table column headers.

Parameters:
level - The row level to assign a particular number of columns to.
columns - The number of columns to assign to the particular row level.

setIndentation

public void setIndentation(int level,
                           int indentation)
Assigns an indentation to a row by its level.

Parameters:
level - The row level of the row to indent.
indentation - The number of pixels to indent the

setRowHeight

public void setRowHeight(int height)
Assigns the row height of the table.

Parameters:
height - The row height of the table (in pixels).

setRowHeight

public void setRowHeight(int level,
                         int height)
Assigns the row height of the table.

Parameters:
height - The row height of the table (in pixels).

setComponentType

public void setComponentType(java.lang.String label,
                             int componentType)
Assigns the component type of the primary row by header label.

Parameters:
label - The header label of the column to assign the type.

setComponentType

public void setComponentType(int level,
                             int column,
                             int componentType)
Assigns the component type based on row level and column. It should be noted that this determines what widget is used to display the information. This resets column information to the default values for the widget. This means that other values such as mask, justification and column type should be set after the component.

Parameters:
level - The row level.
column - The column index.

setColumnMask

public void setColumnMask(java.lang.String label,
                          Mask mask)
Assigns a mask to a column within the primary row.

Parameters:
label - The header label of the column to assign the mask.
mask - The mask to assign to the column.

setColumnMask

public void setColumnMask(int level,
                          int column,
                          Mask mask)
Assigns a mask to a column within a row level.

Parameters:
level - The row level.
column - The column index.
mask - The mask to assign to the column.

setColumnType

public void setColumnType(java.lang.String label,
                          int columnType)
Assigns a column type to a particular column. The column type determines sorting order.

Parameters:
label - The header label of the column to assign the mask.
columnType - The column type to assign to the column.

setColumnType

public void setColumnType(int level,
                          int column,
                          int columnType)
Assigns a column type to a particular column. The column type determines sorting order.

Parameters:
level - The row level.
column - The column index.
columnType - The column type to assign to the column.

setJustification

public void setJustification(java.lang.String label,
                             int justification)
Assigns a justification to a particular column..

Parameters:
label - The header label of the column to assign the mask.
justification - The justification to assign to the column.

setJustification

public void setJustification(int level,
                             int column,
                             int justification)
Assigns a justification to a particular column..

Parameters:
level - The row level.
column - The column index.
justification - The justification to assign to the column.

setMnemonic

public void setMnemonic(java.lang.String label,
                        char mnemonic)
Assigns a mnemonic to a column in the header row.

Parameters:
label - The column header label.
mnemonic - The mnemonic to assign to the column.

setColumnIcon

public void setColumnIcon(java.lang.String label,
                          java.lang.String filename)
Assigns an icon to a column in the primary row.

Parameters:
label - The header label of the column to assign the icon to.
filename - The filename of the icon.

setColumnIcon

public void setColumnIcon(int level,
                          int column,
                          java.lang.String filename)
Assigns an icon to a column within a row level. The filename must be in the classpath of the VM.

Parameters:
level - The row level.
column - The column index.
filename - The filename of the icon.

setColumnWidth

public void setColumnWidth(java.lang.String label,
                           int width)
Assigns a column width to a specific column of the primary row.

Parameters:
label - The header label of the column.
width - The width of the column (in pixels).

setColumnWidth

public void setColumnWidth(int level,
                           int column,
                           int width)
Assigns a column width to a specific column of a specific row level of the table.

Parameters:
level - The row level to assign the column width to.
column - The column index.
width - The width of the column (in pixels).

setColumnGap

public void setColumnGap(int gap)
Assigns a column gap to all the columns within the primary a row.

Parameters:
gap - The gap in pixels to place between the columns.

setColumnGap

public void setColumnGap(int level,
                         int gap)
Assigns a column gap to all the columns within the specified row level.

Parameters:
gap - The gap in pixels to place between the columns.

setForeground

public void setForeground(java.awt.Color foreground)
Assigns the foreground color to the table. If rows already exist, the row properties are modified as well.

Parameters:
foreground - The foreground color to assign to the table.

setBackground

public void setBackground(java.awt.Color background)
Assigns the background color to the table. If rows already exist, the row properties are modified as well.

Parameters:
background - The background color to assign to the table.

setSelectionForeground

public void setSelectionForeground(java.awt.Color foreground)
Assigns the selection foreground of the table.

Parameters:
foreground - The foreground selection color.

setSelectedBackground

public void setSelectedBackground(java.awt.Color background)
Assigns the selection background of the table.

Parameters:
background - The background selection color.

setRowForeground

public void setRowForeground(int level,
                             java.awt.Color foreground)
Assigns the foreground color to a specific row of the table by its level.

Parameters:
level - The row level.
foreground - The foreground color.

setRowBackground

public void setRowBackground(int level,
                             java.awt.Color background)
Assigns the background color to a specific row of the table by its level.

Parameters:
level - The row level.
background - The background color.

setColumnForeground

public void setColumnForeground(int level,
                                int column,
                                java.awt.Color foreground)
Assigns the foreground color to a specific column within a specific row level of the table.

Parameters:
level - The row level.
column - The column index.
foreground - The foreground color.

setColumnBackground

public void setColumnBackground(int level,
                                int column,
                                java.awt.Color background)
Assigns the background color to a specific column within a specific row level of the table.

Parameters:
level - The row level.
column - The column index.
background - The background color.

setColumnForeground

public void setColumnForeground(java.lang.String column,
                                java.awt.Color foreground)
Assigns the foreground color to all primary rows..

Parameters:
column - The column header label.
foreground - The foreground color.

setColumnBackground

public void setColumnBackground(java.lang.String column,
                                java.awt.Color background)
Assigns the background color to all primary rows..

Parameters:
column - The column header label.
background - The background color.

setFont

public void setFont(java.awt.Font font)
Assigns a font to the table. This font is assigned as the default faunt of all rows.

Parameters:
font - The font to assign to the table.

setRowFont

public void setRowFont(int level,
                       java.awt.Font font)
Assigns a font to a specific row level of the table.

Parameters:
level - The row level.
font - The font to assign to the row level.

setColumnFont

public void setColumnFont(int level,
                          int column,
                          java.awt.Font font)
Assigns a font to a specific row level and column of the table.

Parameters:
level - The row level.
column - The column index.
font - The font to assign.

setColumnFont

public void setColumnFont(java.lang.String column,
                          java.awt.Font font)
Assigns a font to a column of the primary row level.

Parameters:
column - The column header label.
font - The font to assign.

setFontStyle

public void setFontStyle(int style,
                         int size)
Alters the default font of the table to the new style and size.

Parameters:
style - The font style (plain, bold, italic).
size - The font size.

setRowFontStyle

public void setRowFontStyle(int level,
                            int style,
                            int size)
Alters the font of a particular row level.

Parameters:
level - The row level.
style - The font style (plain, bold, italic).
size - The font size.

setColumnFontStyle

public void setColumnFontStyle(int level,
                               int column,
                               int style,
                               int size)
Alters the font of a particular row level and column.

Parameters:
level - The row level.
column - The column index.
style - The font style (plain, bold, italic).
size - The font size.

setColumnFontStyle

public void setColumnFontStyle(java.lang.String label,
                               int style,
                               int size)
Alters the font of a column of the primary row.

Parameters:
label - The column header label.
style - The font style (plain, bold, italic).
size - The font size.

setDefaultSortColumns

public void setDefaultSortColumns(int[] defaultSortColumns)
Sets the default columns to sort on. The column index array will be sorted after the column clicked on in the order the indexes appear in the array.


setSortingEnabled

public void setSortingEnabled(boolean enabled)
Enables or disables sorting on the table.

Parameters:
enabled - True if the table should allow sorting, false if not

setSingleClickCommand

public void setSingleClickCommand(java.lang.String command)
Assigns a single click action command. This command is sent to all listeners when the row selection changes using keystrokes or mouse clicks (single click)..

Parameters:
command - The command to send to listeners.

setDoubleClickCommand

public void setDoubleClickCommand(java.lang.String command)
Assigns a double click action command. This command is sent to all listeners when the row selection changes using keystrokes (Enter Key) or mouse clicks (double click)..

Parameters:
command - The command to send to listeners.

addRow

public void addRow(java.lang.String[] values)
Adds a row of values to the table as a primary row.

Parameters:
values - An array of values representing the data of the primary row.

addRow

public void addRow(java.lang.String[] values,
                   java.lang.Object object)
Adds a row of values along with an object to store to the table as a primary row.

Parameters:
values - An array of values representing the data of the primary row.

addRow

public void addRow(int level,
                   java.lang.String[] values)
Adds a row of values to the table at the specified row level.

Parameters:
level - The row level to assign the new values to.
values - An array of values representing the data of the primary row.

addRow

public void addRow(int level,
                   java.lang.String[] values,
                   java.lang.Object object)
Adds a row of values to the table at the specified row level, along with an object to store within the row.

Parameters:
level - The row level to assign the new values to.
values - An array of values representing the data of the primary row.
object - A data storage object to place inside the row.

insertRow

public void insertRow(int rowIndex,
                      java.lang.String[] values)
Inserts a row into the table at the specified row number. The row will be a primary row.

Parameters:
rowIndex - The row index to insert the row at.
values - The display values to display at that row.

insertRow

public void insertRow(int level,
                      int rowIndex,
                      java.lang.String[] values)
Inserts a row into the table at the specified row number.

Parameters:
level - The row level of the inserted row.
rowIndex - The row index to insert the row at.
values - The display values to display at that row.

insertRow

public void insertRow(int level,
                      int rowIndex,
                      java.lang.String[] values,
                      java.lang.Object object)
Inserts a row into the table at the specified row number.

Parameters:
level - The row level of the inserted row.
rowIndex - The row number to insert the row at.
values - The display values to display at that row.
object - The object to store within the row.

updateRow

public void updateRow(int rowIndex,
                      java.lang.String[] values)
Updates a row in the table identified by the row number.

Parameters:
rowIndex - The row number of the row to update.
values - The display values to display at that row.

updateRow

public void updateRow(java.lang.Object object,
                      java.lang.String[] values)
Updates a row in the table identified by an object.

Parameters:
object - The object stored within the row.
values - The display values to display at that row.

removeRow

public void removeRow(int rowIndex)
Remove the row identified by the given row number.

Parameters:
rowIndex - The row index of the row to remove.

removeRow

public void removeRow(java.lang.Object object)
Remove the row identified by the given object.

Parameters:
object - The object to identify the row with.

findRowForObject

public int findRowForObject(java.lang.Object object)
Finds a row index for given object stored within a row.

Parameters:
object - The object to identify the row with.
Returns:
The index of the row where the object is stored or false if no row is found.

getSelectedRow

public int getSelectedRow()
Retrieves the selected row number/index.

Returns:
The selected row number.

getValues

public java.lang.String[] getValues(int row)
Retrieves the values for a row. Each index of the string array matched the column index. Returns null if row or object does not exist.

Parameters:
row - The row number.
Returns:
The values that represent the row.

hasDataObject

public boolean hasDataObject(java.lang.Object object)
Retrieves whether or not the table contains the specified data object.

Parameters:
object - The data object to check for.
Returns:
True if the table contains the object, false if not.

getDataObject

public java.lang.Object getDataObject(int row)
Retrieves the stored object within the row. Returns null if row or object does not exist.

Parameters:
row - The row number.
Returns:
The object stored within the row.

getSelectedValues

public java.lang.String[] getSelectedValues()
Retrieves the row values used to display information within the selected row. Each index of the string array is the column index of the represented data.

Returns:
The selecte4d row values as a string array.

getSelectedObject

public java.lang.Object getSelectedObject()
Retrieves the stored object within the selected row. eturns null if no row is selected or no object exists.

Returns:
The object stored within the selected row or null is selected or available.

getSelectedPrimaryValues

public java.lang.String[] getSelectedPrimaryValues()
Retrieves the row values used to display information within the primary row associated to the selected row. Each index of the string array is the column index of the represented data. If the selected row is not a primary row, it will continue to search the table until it finds the primary row for the particular selected row.

Returns:
The selected primary row values as a string array.

getSelectedPrimaryObject

public java.lang.Object getSelectedPrimaryObject()
Retrieves the stored object within the primary row of the selected row. Returns null if no row is selected or no object exists.

Returns:
The object stored within the primary row of the selected row.

getSelectedPrimaryRow

public int getSelectedPrimaryRow()
Retrieves the index of the primary row for the current selected row.

Returns:
The primary row index for the current selected row (or -1 if no row is found).

setSelectedRow

public void setSelectedRow(int row)
Selects the row. An invalid row number will produce no response.


setSelectedRow

public void setSelectedRow(java.lang.Object object)
Selects the row based on a data object. If the data object does not exist, the row will not be selected.

Parameters:
object - The data object to select the row for.

isFirstRowSelected

public boolean isFirstRowSelected()
Retrieves whether or not the first row of the table is selected.

Returns:
True if the first row is selected, false if not.

isLastRowSelected

public boolean isLastRowSelected()
Retrieves whether or not the last row of the table is selected.

Returns:
True if the last row is selected, false if not.

selectPreviousRow

public void selectPreviousRow()
Selects the next row in the table. This will not go beyond the end of the table.


selectNextRow

public void selectNextRow()
Selects the previous row in the table. This will not go beyond the end of the table.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Executes a repaint whenever a property change event is received.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

performActionEvent

public void performActionEvent(RActionEvent event)
Parses all received RActionEvents and calls the appropriate method.

Specified by:
performActionEvent in interface REventListener
Overrides:
performActionEvent in class RPanel
Parameters:
event - The RActionEvent.

isFirstRowFocused

public boolean isFirstRowFocused()

isLastRowFocused

public boolean isLastRowFocused()

toggleExpansionMode

public void toggleExpansionMode()
Reverses the expansion mode on the layer. If collapsed, the table will expand. If expanded, the table will collapse.


resort

public void resort()
Sorts the information in the table based on the last column used to sort.


getRowCount

public int getRowCount()
Retrieves the number of rows in the table.

Returns:
The number of rows in the table.

isEmpty

public boolean isEmpty()
Retrieves whether or not the table is empty.

Returns:
True if the table is empty, false if not.

clearSelection

public void clearSelection()
Clears the table selection. This will trigger an action if a row is actually deselected.


clear

public void clear()
Clears the table of all rows. In order for the scrollbar to reset itself, this requires deleting the panel and scrollpane, rebuilding a new reference to a scrollpane and adding it back to the table. The setVisible() method is the only means of getting BorderLayout to accurately redraw itself.


focusGained

public void focusGained(java.awt.event.FocusEvent event)
Implements the FocusListener method. If selected row, move focus to selected row, otherwise first row.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Implements the FocusListener method. Do nothing.

Specified by:
focusLost in interface java.awt.event.FocusListener

getFocusIndex

public int getFocusIndex()
Retrieves the index of the current row with focus.

Returns:
the index of the current row with focus.

componentResized

public void componentResized(java.awt.event.ComponentEvent event)
Implements the component listener method. It resizes the columns every time the table size is altered.

Specified by:
componentResized in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent event)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent event)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent event)
Specified by:
componentShown in interface java.awt.event.ComponentListener


Copyright © 2004 Retek Inc. All Rights Reserved. - Generated at Fri, 10/22/2004 07:28