Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.ui.table
Class GenericTable

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 oracle.javatools.ui.table.GenericTable
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, DisplayableTable

public class GenericTable
extends javax.swing.JTable
implements DisplayableTable

GenericTable is a subclass of JTable with a number of nice and enhanced features and a cleaner UI.

Features provided by this GenericTable:

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
 
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
GenericTable()
          Constructs a default GenericTable that is initialized with a default data model, a default column model, and a default selection model.
GenericTable(java.lang.Object[][] rowData, java.lang.Object[] columnNames)
          Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model.
GenericTable(javax.swing.table.TableModel model)
          Constructs a GenericTable that is initialized with dm as the data model, a default column model, and a default selection model.
GenericTable(java.util.Vector rowData, java.util.Vector columnNames)
          Constructs a GenericTable that is initialized with dm as the data model, cm as the column model, and a default selection model.
 
Method Summary
protected  void configureEnclosingScrollPane()
          Override to configure the scrollpane for this table.
 java.lang.String convertValueToText(java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Called by the renderers to convert the specified value to text.
protected  void createDefaultRenderers()
          Override to creates default GenericTableCellRenderer for objects, numbers, doubles, dates, booleans, and icons.
 RowHeader createDefaultRowHeader()
          Creates a default RowHeader for this table.
 javax.swing.Action[] getColumnSelectorActions()
          Returns the additional column selector actions if it has been set before.
 javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class<?> columnClass)
          Override to fix JDK bug if columnClass is null.
 int[] getHiddenColumns()
          Get columns that are hidden.
 java.lang.String getNoEntryInstructionText()
          Returns the instruction text of the table when there is no entry in the table.
 java.awt.Dimension getPreferredSize()
          Override to return a height of 2 rows for the table when there are no elements in the table.
 int getPreferredVisibleRowCount()
          Returns the value of the visibleRowCount property.
 RowHeader getRowHeader()
          Returns the row header of this generic table.
 javax.swing.Action getSelectColumnsAction()
          Returns the additional select columns action if it has been set before.
 java.awt.Color getSortColumnBackgroundColor()
          Get the background color of the sorted column.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Override to provide a tooltip for cells that are obscured because they are too small to display their renderer properly.
 boolean getUseTransferHandler()
          Get whether the default TransferHandler from the look and feel is associated with this component when the UI is initialized.
 boolean isColumnHeaderSelectionEnabled()
          Returns whether column header selection is supported for the table.
 boolean isColumnSelectorAvailable()
          Get whether the dropdown button is displayed at the end of the column header for hiding and showing columns is available on this instance of table.
 boolean isResizeColumnOnDoubleClick()
          Get whether the user can resize columns in this table by double clicking the resize divider between two columns.
 boolean isRolloverHighlightingEnabled()
          Returns whether rollover highlighting is enabled/disabled on the table.
 boolean isSelectAllEnabled()
          Returns whether selectAll feature is enabled for the table.
 boolean isShowToolTips()
          Get whether tooltips are being shown for truncated cells.
 void paintComponent(java.awt.Graphics g)
          Override the paint component to paint the background of the sorted column in a slightly different color from other columns.
 void selectAll()
          Stop cell editing when the user select all cells.
 void setColumnHeaderSelectionEnabled(boolean select)
          Add column header selection support for the table.
 void setColumnSelectorActions(javax.swing.Action... actions)
          This method adds the specified actions to the end of ColumnSelector dropdow menu.
 void setColumnSelectorAvailable(boolean isAvailable)
          Set whether this table will display a dropdown button at the end of the column header to hide/show columns.
protected  void setColumnVisible(javax.swing.table.TableColumn column, int modelColumn, boolean isVisible)
          Makes the column visible it it can be hidden.
 void setHiddenColumns(int[] hiddenColumns)
          Set columns that are hidden.
 void setNoEntryInstructionText(java.lang.String text)
          Sets the instruction text on the firt row of the table when there is no entry in the table.
 void setPreferredVisibleRowCount(int visibleRowCount)
          Sets the visibleRowCount property.
 void setResizeColumnOnDoubleClick(boolean isOn)
          Set whether the user can resize columns in this table by double clicking the resize divider between two columns.
 void setRolloverHighlightingEnabled(boolean highlight)
          Set rollover highlighting enabled/disabled on the table.
 void setRowHeader(RowHeader rowHeader)
          Sets the row header for this table.
 void setSelectAllEnabled(boolean enable)
          Enables whether the user can click on upper left corner to select all cells in the table by clicking on it.
 void setSelectColumnsAction(javax.swing.Action selectColumn)
          This method adds the specified SelectColumns action to the end of ColumnSelector dropdow menu.
 void setShowToolTips(boolean showToolTips)
          Controls whether this GenericTable will show tooltips for cells that are truncated due to reduced column width.
 void setSortColumnBackgroundColor(java.awt.Color c)
          Set the background color used to highlight the sorted column.
 void setUI(javax.swing.plaf.TableUI ui)
          Override to use the transferhandler that uses convertValueToText to copying the text.
 void setUseTransferHandler(boolean useTransferHandler)
          Set whether the default TransferHandler from the look and feel is associated with this component when the UI is initialized.
 void setVisibleRows(int rows)
          Sets the number of visible rows on the table.
 void sizeTableToContents()
           
 void sizeTableToContents(java.lang.Object[] prototypeValues)
          Utility method that will set the preferred size of all columns in this table so that they are just big enough to display their contents.
protected  void unconfigureEnclosingScrollPane()
          Override to unconfigure the scrollpane for this table.
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, updateUI, valueChanged
 
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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
 

Constructor Detail

GenericTable

public GenericTable()
Constructs a default GenericTable that is initialized with a default data model, a default column model, and a default selection model.


GenericTable

public GenericTable(javax.swing.table.TableModel model)
Constructs a GenericTable that is initialized with dm as the data model, a default column model, and a default selection model.


GenericTable

public GenericTable(java.util.Vector rowData,
                    java.util.Vector columnNames)
Constructs a GenericTable that is initialized with dm as the data model, cm as the column model, and a default selection model.


GenericTable

public GenericTable(java.lang.Object[][] rowData,
                    java.lang.Object[] columnNames)
Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model.

Method Detail

setColumnSelectorAvailable

public void setColumnSelectorAvailable(boolean isAvailable)
Set whether this table will display a dropdown button at the end of the column header to hide/show columns. To get this feature, table should be put inside a JScrollPane.

Parameters:
isAvailable - if true, a dropdown button will be provided at the end of the column header of this table with checkbox menu items for each column. The user can use these to hide and show columns.

isColumnSelectorAvailable

public boolean isColumnSelectorAvailable()
Get whether the dropdown button is displayed at the end of the column header for hiding and showing columns is available on this instance of table.

Returns:
whether the column selector drop down button is available.

setSelectColumnsAction

public void setSelectColumnsAction(javax.swing.Action selectColumn)
This method adds the specified SelectColumns action to the end of ColumnSelector dropdow menu. The name from the action is used as the menu item label. Before setting this action, clients should turn on the column selector using setColumnSelectorAvailable.


getSelectColumnsAction

public javax.swing.Action getSelectColumnsAction()
Returns the additional select columns action if it has been set before.


setColumnSelectorActions

public void setColumnSelectorActions(javax.swing.Action... actions)
This method adds the specified actions to the end of ColumnSelector dropdow menu. The name from the action is used as the menu item label. Before setting these actions, clients should turn on the column selector using setColumnSelectorAvailable.


getColumnSelectorActions

public javax.swing.Action[] getColumnSelectorActions()
Returns the additional column selector actions if it has been set before.


setHiddenColumns

public void setHiddenColumns(int[] hiddenColumns)
Set columns that are hidden. You should only call this after setting the model.

Parameters:
hiddenColumns - columns which are currently hidden

getHiddenColumns

public int[] getHiddenColumns()
Get columns that are hidden. You should only call this after setting the model.

Returns:
an array of model column indices

setNoEntryInstructionText

public void setNoEntryInstructionText(java.lang.String text)
Sets the instruction text on the firt row of the table when there is no entry in the table. The instruction text must be in the form: "No object Name".


getNoEntryInstructionText

public java.lang.String getNoEntryInstructionText()
Returns the instruction text of the table when there is no entry in the table. This instruction text will be displayed on the first row of the table.


setShowToolTips

public void setShowToolTips(boolean showToolTips)
Controls whether this GenericTable will show tooltips for cells that are truncated due to reduced column width. By default this is true.

Parameters:
showToolTips - if true, a tooltip will be displayed for any cell which is truncated because the column is not wide enough to display its full value.

isShowToolTips

public boolean isShowToolTips()
Get whether tooltips are being shown for truncated cells.

Returns:
true if tooltips are being shown for truncated cells.

setResizeColumnOnDoubleClick

public void setResizeColumnOnDoubleClick(boolean isOn)
Set whether the user can resize columns in this table by double clicking the resize divider between two columns. This behavior is ON by default. This property works best if the column auto-resizing behavior is turned off in the table. You can turn it off using:
   table.setAutoResizeMode( GenericTable.AUTO_RESIZE_OFF );
 

Parameters:
isOn - if true, the user can resize columns

isResizeColumnOnDoubleClick

public boolean isResizeColumnOnDoubleClick()
Get whether the user can resize columns in this table by double clicking the resize divider between two columns. This behavior is ON by default.


sizeTableToContents

public void sizeTableToContents()
See Also:
sizeTableToContents( Object[])

sizeTableToContents

public void sizeTableToContents(java.lang.Object[] prototypeValues)
Utility method that will set the preferred size of all columns in this table so that they are just big enough to display their contents. This method works best when the column auto-resizing behavior is turned off. You can turn it off using:
   JTable.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
 


setVisibleRows

public void setVisibleRows(int rows)
Sets the number of visible rows on the table. This basically sets the preferred size of the table's scroll pane. If the table is current visible this also revalidates the scrollpane.


setPreferredVisibleRowCount

public void setPreferredVisibleRowCount(int visibleRowCount)
Sets the visibleRowCount property. This sets the preferred number of rows to display without requiring scrolling. Setting this property affects the return value of the JTable.getPreferredScrollableViewportSize() method, which is used to calculate the preferred size of an enclosing viewport. See that method's documentation for more details.

The default value of this property is -1, indicating null PreferredScrollableViewportSize.

Calling this method with a negative value will set the PreferredScrollableViewportSize to null.

Parameters:
visibleRowCount - an integer specifying the preferred number of rows to display without requiring scrolling
See Also:
getPreferredVisibleRowCount(), JTable.getPreferredScrollableViewportSize(), JViewport

getPreferredVisibleRowCount

public int getPreferredVisibleRowCount()
Returns the value of the visibleRowCount property. See the documentation for setPreferredVisibleRowCount(int) for details on how to interpret this value.

Returns:
the value of the visibleRowCount property.
See Also:
setPreferredVisibleRowCount(int)

setRowHeader

public void setRowHeader(RowHeader rowHeader)
Sets the row header for this table. Table takes care of automatically setting this as the row header view of the scroll pane to which it is added.


getRowHeader

public RowHeader getRowHeader()
Returns the row header of this generic table.


createDefaultRowHeader

public RowHeader createDefaultRowHeader()
Creates a default RowHeader for this table.


setColumnHeaderSelectionEnabled

public void setColumnHeaderSelectionEnabled(boolean select)
Add column header selection support for the table. Enabling this property will select the table column when clicked on corresponding table header.


isColumnHeaderSelectionEnabled

public boolean isColumnHeaderSelectionEnabled()
Returns whether column header selection is supported for the table.


setSelectAllEnabled

public void setSelectAllEnabled(boolean enable)
Enables whether the user can click on upper left corner to select all cells in the table by clicking on it. This will work only if the table is added to the view component of a scroll pane and has a RowHeader.


isSelectAllEnabled

public boolean isSelectAllEnabled()
Returns whether selectAll feature is enabled for the table.


setRolloverHighlightingEnabled

public void setRolloverHighlightingEnabled(boolean highlight)
Set rollover highlighting enabled/disabled on the table. This method should be called after setting any all the renders on the table. This will not work if the renders are changed after this call. By default, rolloverhighlighting is enabled for the table.


isRolloverHighlightingEnabled

public boolean isRolloverHighlightingEnabled()
Returns whether rollover highlighting is enabled/disabled on the table.


setUseTransferHandler

public void setUseTransferHandler(boolean useTransferHandler)
Set whether the default TransferHandler from the look and feel is associated with this component when the UI is initialized.

The default for this property is false.

Parameters:
useTransferHandler - true if the transfer handler from the L&F will be used.

getUseTransferHandler

public boolean getUseTransferHandler()
Get whether the default TransferHandler from the look and feel is associated with this component when the UI is initialized.

The default for this property is false.

Returns:
true if the transfer handler from the L&F will be used.

setSortColumnBackgroundColor

public void setSortColumnBackgroundColor(java.awt.Color c)
Set the background color used to highlight the sorted column.

Parameters:
c - the color to paint the background of the sorted column

getSortColumnBackgroundColor

public java.awt.Color getSortColumnBackgroundColor()
Get the background color of the sorted column. By default, this is a slightly darker shade than the background color of the table. You can change this by calling setSortColumnBackgroundColor().

Returns:
the background color of the sort column

convertValueToText

public java.lang.String convertValueToText(java.lang.Object value,
                                           boolean isSelected,
                                           boolean hasFocus,
                                           int row,
                                           int column)
Called by the renderers to convert the specified value to text. This implementation returns null, ignoring all other arguments to indicate to the renderer to use the original value. To control the conversion, subclass this method and use any of the arguments you need.

Specified by:
convertValueToText in interface DisplayableTable
Parameters:
value - the Object to convert to text
isSelected - true if cell is selected
hasFocus - true if cell has focus
row - the row of the cell to render
column - the column of the cell to render
Returns:
the String representation of the node's value

configureEnclosingScrollPane

protected void configureEnclosingScrollPane()
Override to configure the scrollpane for this table.

Overrides:
configureEnclosingScrollPane in class javax.swing.JTable

unconfigureEnclosingScrollPane

protected void unconfigureEnclosingScrollPane()
Override to unconfigure the scrollpane for this table.

Overrides:
unconfigureEnclosingScrollPane in class javax.swing.JTable

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Override to provide a tooltip for cells that are obscured because they are too small to display their renderer properly. This functionality only really works well for tables where the objects in the cell have a sensible toString() method. If this isn't the case, you may want to switch this behavior off by calling setShowToolTips( false ).

Overrides:
getToolTipText in class javax.swing.JTable
Parameters:
event - mouse event to get tooltip for
Returns:
tooltip

getPreferredSize

public java.awt.Dimension getPreferredSize()
Override to return a height of 2 rows for the table when there are no elements in the table.

Overrides:
getPreferredSize in class javax.swing.JComponent

paintComponent

public void paintComponent(java.awt.Graphics g)
Override the paint component to paint the background of the sorted column in a slightly different color from other columns. This method makes sure that the painting of this column extends into end of the table when there are only a small number of rows giving the illusion that the sort column continues to the bottom of the table. This works only when getFillsViewportHeight is true, which is turned on by default for this GenericTable.

Overrides:
paintComponent in class javax.swing.JComponent

setUI

public void setUI(javax.swing.plaf.TableUI ui)
Override to use the transferhandler that uses convertValueToText to copying the text.

Overrides:
setUI in class javax.swing.JTable

getDefaultRenderer

public javax.swing.table.TableCellRenderer getDefaultRenderer(java.lang.Class<?> columnClass)
Override to fix JDK bug if columnClass is null.

Overrides:
getDefaultRenderer in class javax.swing.JTable

selectAll

public void selectAll()
Stop cell editing when the user select all cells.

Overrides:
selectAll in class javax.swing.JTable

setColumnVisible

protected void setColumnVisible(javax.swing.table.TableColumn column,
                                int modelColumn,
                                boolean isVisible)
Makes the column visible it it can be hidden. Clients can controls which columns can be made visible by implementing GenericTableModel as their table model.


createDefaultRenderers

protected void createDefaultRenderers()
Override to creates default GenericTableCellRenderer for objects, numbers, doubles, dates, booleans, and icons. Also install the GenericTableHeaderRenderer for the table header

Overrides:
createDefaultRenderers in class javax.swing.JTable

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.