|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JTable oracle.javatools.controls.nicetable.NiceTable
NiceTable is a subclass of JTable with a number of nice features and a cleaner UI.
Features provided by this table:
Nested Class Summary |
Nested classes inherited from class javax.swing.JTable |
javax.swing.JTable.AccessibleJTable |
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.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 | |
NiceTable()
|
|
NiceTable(javax.swing.table.TableModel model)
|
Method Summary | |
void |
autoSizeColumnsToFit()
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 |
configureEnclosingScrollPane()
|
int |
convertRowToModelIndex(int viewRow)
Convert a row index in the view to a row index in the model. |
javax.swing.table.TableModel |
getBaseModel()
Get the "base" model of the table. |
int[] |
getHiddenColumns()
Get columns that are hidden. |
NiceTablePersistentSettings |
getPersistentSettings()
Get a javabean storing persistent settings of this NiceTable which you can serialize in order to restore the visible appearance of the table next time it is used. |
javax.swing.JScrollPane |
getScrollPaneForTable()
Get a scroll pane for this table. |
int[] |
getSelectedRowsInModel()
Get the selected rows as model rows, regardless of whether this table is currently sorted. |
int |
getSortColumn()
Get the (model) sort column |
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 |
isColumnSelectorAvailable()
Get whether the context menu for hiding and showing columns is available on this instance of NiceTable |
boolean |
isResizeColumnOnDoubleClick()
Get whether the user can resize columns in this table by double clicking the resize divider between two columns. |
boolean |
isShowToolTips()
Get whether tooltips are being shown for truncated cells. |
boolean |
isSortAscending()
Is the sorted column being sorted in ascending order? |
boolean |
isSorted()
Is the table sorted? |
void |
setBackground(java.awt.Color c)
Overridden to make sure the highlighted column is repainted properly. |
void |
setColumnSelectorAvailable(boolean isAvailable)
Set whether this NiceTable will display a context menu on the table headers allowing the user to hide and show columns. |
void |
setHiddenColumns(int[] hiddenColumns)
Set columns that are hidden. |
void |
setPersistentSettings(NiceTablePersistentSettings settings)
Set the persistent view settings of this NiceTable. |
void |
setResizeColumnOnDoubleClick(boolean isOn)
Set whether the user can resize columns in this table by double clicking the resize divider between two columns. |
void |
setShowToolTips(boolean showToolTips)
Controls whether this NiceTable will show tooltips for cells that are truncated due to reduced column width. |
void |
setSortColumn(int modelColumn,
boolean isSortAscending)
Set the column to sort the view by. |
void |
setSortColumnBackgroundColor(java.awt.Color c)
Set the background color used to highlight the sorted column. |
void |
setSorted(boolean isSorted)
Set whether this NiceTable is sorted. |
void |
updateUI()
Overridden to make sure look and feel changes cause the highlighted column to be repainted in the right color. |
Methods inherited from class javax.swing.JTable |
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, unconfigureEnclosingScrollPane, valueChanged |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, 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, 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, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, 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 |
public NiceTable()
public NiceTable(javax.swing.table.TableModel model)
Method Detail |
public int convertRowToModelIndex(int viewRow)
viewRow
- a row index in the view
public java.awt.Color getSortColumnBackgroundColor()
public void setSortColumnBackgroundColor(java.awt.Color c)
c
- the color to paint the background of the sorted columnpublic void setBackground(java.awt.Color c)
c
- public void updateUI()
public void setSorted(boolean isSorted)
isSorted
- if true, the NiceTable is sorted.public boolean isSorted()
public javax.swing.table.TableModel getBaseModel()
public int[] getSelectedRowsInModel()
public NiceTablePersistentSettings getPersistentSettings()
public void setPersistentSettings(NiceTablePersistentSettings settings)
settings
- public void setSortColumn(int modelColumn, boolean isSortAscending)
modelColumn
- the column to sort byisSortAscending
- if true, the table is sorted in ascending orderpublic int getSortColumn()
public boolean isSortAscending()
public void setHiddenColumns(int[] hiddenColumns)
hiddenColumns
- columns which are currently hiddenpublic int[] getHiddenColumns()
public void setColumnSelectorAvailable(boolean isAvailable)
isAvailable
- if true, a context menu will be provided on the header of this
table with checkbox menu items for each column. The user can use these
to hide and show columns.public boolean isColumnSelectorAvailable()
public javax.swing.JScrollPane getScrollPaneForTable()
protected void configureEnclosingScrollPane()
public void setShowToolTips(boolean showToolTips)
public boolean isShowToolTips()
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
public void autoSizeColumnsToFit()
m_table.setAutoResizeMode( NiceTable.AUTO_RESIZE_OFF );
public void setResizeColumnOnDoubleClick(boolean isOn)
m_table.setAutoResizeMode( NiceTable.AUTO_RESIZE_OFF );
isOn
- if true, the user can resize columnspublic boolean isResizeColumnOnDoubleClick()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.