com.metamatrix.toolbox.ui.widget
Class TableWidget

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 com.metamatrix.toolbox.ui.widget.TableWidget
All Implemented Interfaces:
UIConstants, TableColumnSortListener, 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
Direct Known Subclasses:
EntitlementsTable, NewVDBWizardModelVisibilityTable, TreeNodeTableWidget, VDBConnectorBindingAssignmentModelTable

public class TableWidget
extends javax.swing.JTable
implements TableColumnSortListener, UIConstants

This class is intended to be used everywhere within the application that a table needs to be displayed. Changing a cell's value will not automatically cause sorted columns to be re-sorted nor cause the row to be removed from the view if it would now be filtered by the currently set filters.

Since:
2.0
Version:
2.1
Author:
John P. A. Verhaeg
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
static java.lang.String CHECKBOX_BORDER_PROPERTY
           
static java.lang.String FOCUS_BACKGROUND_PROPERTY
           
static java.lang.String FOCUS_BORDER_PROPERTY
           
static java.lang.String NO_FOCUS_BORDER_PROPERTY
           
static java.lang.String PROPERTY_PREFIX
           
 
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 com.metamatrix.toolbox.ui.UIConstants
DATE_FORMAT_PROPERTY, SPACER_HORIZONTAL_LENGTH_PROPERTY, WINDOW_BORDER_PROPERTY
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TableWidget()
           
TableWidget(boolean isSortable)
           
TableWidget(java.util.List columnNames)
           
TableWidget(java.util.List columnNames, boolean isSortable)
           
TableWidget(javax.swing.table.TableModel model)
           
TableWidget(javax.swing.table.TableModel model, boolean isSortable)
           
 
Method Summary
 void addColumn(javax.swing.table.TableColumn column)
          Overridden to set the header renderer, minimum width, header value, and ID of the specified column.
 void addFilter(TableFilter filter)
           
 boolean allowsMultipleColumnSorting()
          Returns whether multiple column sorting is allowed.
 void clearFilters()
           
 void columnMarginChanged(javax.swing.event.ChangeEvent event)
           
 void columnSorted()
           
 int convertRowIndexToModel(int row)
           
 int convertRowIndexToView(int row)
           
protected  javax.swing.table.TableColumnModel createDefaultColumnModel()
           
 void createDefaultColumnsFromModel()
           
protected  TableComparator createDefaultComparator()
           
protected  javax.swing.table.TableModel createDefaultDataModel()
           
protected  javax.swing.table.TableCellRenderer createDefaultHeaderRenderer()
           
protected  PopupMenuFactory createDefaultPopupMenuFactory()
           
protected  void createDefaultRenderers()
          Overridden for performance reasons.
protected  TableSorter createDefaultSorter()
           
protected  javax.swing.table.JTableHeader createDefaultTableHeader()
           
protected  EnhancedTableColumnModel createEnhancedColumnModel()
           
protected  EnhancedTableModel createEnhancedModel()
           
 void createModelRowMap()
           
 javax.swing.JToolTip createToolTip()
           
 TableComparator getComparator()
           
 EnhancedTableColumnModel getEnhancedColumnModel()
           
 EnhancedTableModel getEnhancedModel()
           
 java.util.List getFilters()
           
 int getHiddenColumnCount()
           
 java.util.List getHiddenColumns()
           
 PopupMenuFactory getPopupMenuFactory()
           
 java.awt.Dimension getPreferredSize()
          Overridden to return the current width as the preferred width.
 int getRowCount()
           
 boolean getScrollableTracksViewportWidth()
           
 int getSortedColumnCount()
           
 java.util.List getSortedColumns()
           
 TableSorter getSorter()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
protected  void increaseColumnSize(int index, int width)
           
protected  void initializeTableWidget()
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isColumnEditable(int columnIndex)
           
 boolean isEditable()
           
protected  boolean isFiltered(int rowIndex, java.util.List row)
           
 boolean isFilteredBy(TableFilter filter)
           
 boolean isRowEditable(int rowIndex)
           
 boolean isSortable()
           
 boolean isSorted()
           
protected  void mapModelRows(int firstRowIndex, int rowCount)
           
 void removeFilter(TableFilter filter)
           
 void setAllowsMultipleColumnSorting(boolean allowsMultipleColumnSorting)
          Sets whether multiple column sorting is allowed.
 void setCellEditable(int rowIndex, int columnIndex, boolean isEditable)
           
 void setColumnEditable(int columnIndex, boolean isEditable)
           
 void setColumnHidden(EnhancedTableColumn column, boolean isHidden)
           
 void setColumnModel(javax.swing.table.TableColumnModel model)
           
 void setColumnNotSorted(EnhancedTableColumn column)
           
 void setColumnNotSorted(EnhancedTableColumn column, boolean isCurrentColumnSortOrderKept)
           
 void setColumnsHidden(boolean isHidden)
           
 void setColumnsNotSorted()
           
 void setColumnSortedAscending(EnhancedTableColumn column)
           
 void setColumnSortedAscending(EnhancedTableColumn column, boolean isCurrentColumnSortOrderKept)
           
 void setColumnSortedDescending(EnhancedTableColumn column)
           
 void setColumnSortedDescending(EnhancedTableColumn column, boolean isCurrentColumnSortOrderKept)
           
 void setComparator(TableComparator comparator)
           
 void setEditable(boolean isEditable)
           
 void setModel(javax.swing.table.TableModel model)
          Overridden to enforce models to be instances of EnhancedTableModel and to reapply sorting to columns with the same identifiers in both the new and old models.
 void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
           
 void setRowEditable(int rowIndex, boolean isEditable)
           
 void setSortable(boolean isSortable)
           
 void setSorter(TableSorter sorter)
           
 void setTableHeader(javax.swing.table.JTableHeader header)
           
 void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
           
 void sizeColumnsToFit(int resizedColumnIndex)
          Deprecated.  
 void sizeColumnsToFitContainer(int resizedColumnIndex)
          Expands the columns with indexes after the specified column to fit within the table's container when necessary.
 void sizeColumnsToFitData()
          Changes the sizes of all columns to match the size of their longest cell contents (or the header value if they are longer than the longest cell contents).
 void sizeColumnsToFitData(int count)
          Changes the sizes of all columns to match the size of their longest cell contents (or the header value if they are longer than the longest cell contents).
protected  void sizeColumnsToFitViewport(javax.swing.JScrollPane scroller)
          Attempts to resize the columns when both the table is a view within a JScrollPane and the vertical scroll bar first appears, in order to eliminate the horizontal scroll bar.
 void sizeColumnToFitData(EnhancedTableColumn column)
          Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents).
 void sizeColumnToFitData(EnhancedTableColumn column, int count)
          Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents).
protected  int sizeColumnToFitDataInternal(EnhancedTableColumn column, int count)
          Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents).
 void sort()
           
 void tableChanged(javax.swing.event.TableModelEvent event)
           
 void unsortAll()
          Unsort the entire table.
 
Methods inherited from class javax.swing.JTable
addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultEditors, createDefaultSelectionModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setUI, setUpdateSelectionOnSort, sizeColumnsToFit, sorterChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, 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, 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
 

Field Detail

PROPERTY_PREFIX

public static final java.lang.String PROPERTY_PREFIX
See Also:
Constant Field Values

CHECKBOX_BORDER_PROPERTY

public static final java.lang.String CHECKBOX_BORDER_PROPERTY
See Also:
Constant Field Values

FOCUS_BORDER_PROPERTY

public static final java.lang.String FOCUS_BORDER_PROPERTY
See Also:
Constant Field Values

FOCUS_BACKGROUND_PROPERTY

public static final java.lang.String FOCUS_BACKGROUND_PROPERTY
See Also:
Constant Field Values

NO_FOCUS_BORDER_PROPERTY

public static final java.lang.String NO_FOCUS_BORDER_PROPERTY
See Also:
Constant Field Values
Constructor Detail

TableWidget

public TableWidget()
Since:
2.0

TableWidget

public TableWidget(java.util.List columnNames)
Since:
2.0

TableWidget

public TableWidget(javax.swing.table.TableModel model)
Since:
2.0

TableWidget

public TableWidget(boolean isSortable)
Since:
2.0

TableWidget

public TableWidget(java.util.List columnNames,
                   boolean isSortable)
Since:
2.0

TableWidget

public TableWidget(javax.swing.table.TableModel model,
                   boolean isSortable)
Since:
2.0
Method Detail

addColumn

public void addColumn(javax.swing.table.TableColumn column)
Overridden to set the header renderer, minimum width, header value, and ID of the specified column.

Overrides:
addColumn in class javax.swing.JTable
Since:
2.0

addFilter

public void addFilter(TableFilter filter)
Since:
2.0

allowsMultipleColumnSorting

public boolean allowsMultipleColumnSorting()
Returns whether multiple column sorting is allowed. This value does not reflect whether the table is sortable at all, and is therefore meaningless unless the table is actually sortable.

Returns:
True if multiple column sorting is allowed
Since:
2.0

clearFilters

public void clearFilters()
Since:
2.0

columnMarginChanged

public void columnMarginChanged(javax.swing.event.ChangeEvent event)
Specified by:
columnMarginChanged in interface javax.swing.event.TableColumnModelListener
Overrides:
columnMarginChanged in class javax.swing.JTable
Since:
2.0

columnSorted

public void columnSorted()
Specified by:
columnSorted in interface TableColumnSortListener
Since:
2.0

convertRowIndexToModel

public int convertRowIndexToModel(int row)
Overrides:
convertRowIndexToModel in class javax.swing.JTable
Since:
2.0

convertRowIndexToView

public int convertRowIndexToView(int row)
Overrides:
convertRowIndexToView in class javax.swing.JTable
Since:
2.1

createDefaultColumnModel

protected final javax.swing.table.TableColumnModel createDefaultColumnModel()
Overrides:
createDefaultColumnModel in class javax.swing.JTable
Since:
2.0

createDefaultColumnsFromModel

public void createDefaultColumnsFromModel()
Overrides:
createDefaultColumnsFromModel in class javax.swing.JTable
Since:
2.0

createDefaultComparator

protected TableComparator createDefaultComparator()
Since:
2.0

createDefaultDataModel

protected final javax.swing.table.TableModel createDefaultDataModel()
Overrides:
createDefaultDataModel in class javax.swing.JTable
Since:
2.0

createDefaultHeaderRenderer

protected javax.swing.table.TableCellRenderer createDefaultHeaderRenderer()
Since:
2.0

createDefaultPopupMenuFactory

protected PopupMenuFactory createDefaultPopupMenuFactory()
Since:
2.0

createDefaultRenderers

protected void createDefaultRenderers()
Overridden for performance reasons.

Overrides:
createDefaultRenderers in class javax.swing.JTable
Since:
2.0

createDefaultSorter

protected TableSorter createDefaultSorter()
Since:
2.0

createDefaultTableHeader

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

createEnhancedColumnModel

protected EnhancedTableColumnModel createEnhancedColumnModel()
Since:
2.0

createEnhancedModel

protected EnhancedTableModel createEnhancedModel()
Since:
2.0

createModelRowMap

public void createModelRowMap()
Since:
2.0 Changing from protected to public. Part of fix to defect 14083. BWP 10/20/04

createToolTip

public javax.swing.JToolTip createToolTip()
Overrides:
createToolTip in class javax.swing.JComponent

getComparator

public TableComparator getComparator()
Since:
2.0

getEnhancedColumnModel

public EnhancedTableColumnModel getEnhancedColumnModel()
Since:
2.0

getEnhancedModel

public EnhancedTableModel getEnhancedModel()
Since:
2.0

getFilters

public java.util.List getFilters()
Since:
2.0

getHiddenColumnCount

public int getHiddenColumnCount()
Since:
2.0

getHiddenColumns

public java.util.List getHiddenColumns()
Since:
2.0

getPopupMenuFactory

public PopupMenuFactory getPopupMenuFactory()
Since:
2.0

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overridden to return the current width as the preferred width.

Overrides:
getPreferredSize in class javax.swing.JComponent
Since:
2.0

getRowCount

public int getRowCount()
Overrides:
getRowCount in class javax.swing.JTable
Since:
2.0

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable
Overrides:
getScrollableTracksViewportWidth in class javax.swing.JTable
Since:
2.0

getSortedColumnCount

public int getSortedColumnCount()
Since:
2.0

getSortedColumns

public java.util.List getSortedColumns()
Since:
2.0

getSorter

public TableSorter getSorter()
Since:
2.0

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Overrides:
getValueAt in class javax.swing.JTable
Since:
2.0

increaseColumnSize

protected void increaseColumnSize(int index,
                                  int width)
Since:
2.0

initializeTableWidget

protected void initializeTableWidget()
Since:
2.0

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Overrides:
isCellEditable in class javax.swing.JTable
Since:
2.0

isColumnEditable

public boolean isColumnEditable(int columnIndex)
Since:
2.0

isEditable

public boolean isEditable()
Since:
2.0

isFiltered

protected boolean isFiltered(int rowIndex,
                             java.util.List row)
Since:
2.0

isFilteredBy

public boolean isFilteredBy(TableFilter filter)
Since:
2.0

isRowEditable

public boolean isRowEditable(int rowIndex)
Since:
2.0

isSorted

public boolean isSorted()
Since:
2.0

isSortable

public boolean isSortable()
Since:
2.0

mapModelRows

protected void mapModelRows(int firstRowIndex,
                            int rowCount)
Since:
2.0

removeFilter

public void removeFilter(TableFilter filter)
Since:
2.0

setAllowsMultipleColumnSorting

public void setAllowsMultipleColumnSorting(boolean allowsMultipleColumnSorting)
Sets whether multiple column sorting is allowed. This value does not reflect whether the table is sortable at all, and is therefore meaningless unless the table is actually sortable.

Parameters:
allowsMultipleColumnSorting - Indicates if multiple column sorting is allowed
Since:
2.0

setCellEditable

public void setCellEditable(int rowIndex,
                            int columnIndex,
                            boolean isEditable)
Since:
2.0

setColumnEditable

public void setColumnEditable(int columnIndex,
                              boolean isEditable)
Since:
2.0

setColumnHidden

public void setColumnHidden(EnhancedTableColumn column,
                            boolean isHidden)
Since:
2.0

setColumnModel

public void setColumnModel(javax.swing.table.TableColumnModel model)
Overrides:
setColumnModel in class javax.swing.JTable
Since:
2.0

setColumnNotSorted

public void setColumnNotSorted(EnhancedTableColumn column)
Since:
2.0

setColumnNotSorted

public void setColumnNotSorted(EnhancedTableColumn column,
                               boolean isCurrentColumnSortOrderKept)
Since:
2.0

setColumnSortedAscending

public void setColumnSortedAscending(EnhancedTableColumn column)
Since:
2.0

setColumnSortedAscending

public void setColumnSortedAscending(EnhancedTableColumn column,
                                     boolean isCurrentColumnSortOrderKept)
Since:
2.0

setColumnSortedDescending

public void setColumnSortedDescending(EnhancedTableColumn column)
Since:
2.0

setColumnSortedDescending

public void setColumnSortedDescending(EnhancedTableColumn column,
                                      boolean isCurrentColumnSortOrderKept)
Since:
2.0

setColumnsHidden

public void setColumnsHidden(boolean isHidden)
Since:
2.0

setColumnsNotSorted

public void setColumnsNotSorted()
Since:
2.0

setComparator

public void setComparator(TableComparator comparator)
Since:
2.0

setEditable

public void setEditable(boolean isEditable)
Since:
2.0

setModel

public void setModel(javax.swing.table.TableModel model)
Overridden to enforce models to be instances of EnhancedTableModel and to reapply sorting to columns with the same identifiers in both the new and old models.

Overrides:
setModel in class javax.swing.JTable
Since:
2.0

setPopupMenuFactory

public void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
Since:
2.0

setRowEditable

public void setRowEditable(int rowIndex,
                           boolean isEditable)
Since:
2.0

setSortable

public void setSortable(boolean isSortable)
Since:
2.0

setSorter

public void setSorter(TableSorter sorter)
Since:
2.0

unsortAll

public void unsortAll()
Unsort the entire table. This method explicitly ignores the current sort state of the table to clear all sort columns, run the sort algorithm, and resizeAndRepaint the table.

Since:
3.1

setTableHeader

public void setTableHeader(javax.swing.table.JTableHeader header)
Overrides:
setTableHeader in class javax.swing.JTable
Since:
2.0

setValueAt

public void setValueAt(java.lang.Object value,
                       int rowIndex,
                       int columnIndex)
Overrides:
setValueAt in class javax.swing.JTable
Since:
2.0

sizeColumnToFitDataInternal

protected int sizeColumnToFitDataInternal(EnhancedTableColumn column,
                                          int count)
Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents). Only the first number of data cells equal to the specified count are used to determine the longest cell.

Parameters:
column - The column to be sized
count - The number of data cells to use when determining the longest cell
Returns:
The column's view index
Since:
2.0

sizeColumnToFitData

public void sizeColumnToFitData(EnhancedTableColumn column)
Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents).

Parameters:
column - The column to be sized
Since:
2.0

sizeColumnToFitData

public void sizeColumnToFitData(EnhancedTableColumn column,
                                int count)
Changes the size of the specified column to match the size of its longest cell contents (or the header value if its longer than the longest cell contents). Only the first number of data cells equal to the specified count are used to determine the longest cell.

Parameters:
column - The column to be sized
count - The number of data cells to use when determining the longest cell
Since:
2.0

sizeColumnsToFit

public void sizeColumnsToFit(int resizedColumnIndex)
Deprecated. 

Overrides:
sizeColumnsToFit in class javax.swing.JTable
Since:
2.0

sizeColumnsToFitContainer

public void sizeColumnsToFitContainer(int resizedColumnIndex)
Expands the columns with indexes after the specified column to fit within the table's container when necessary. This method is called internally whenever a column or the table's container is resized.

Parameters:
resizedColumnIndex - The index of the column just resized or -1 if the table's container was resized
Since:
2.0

sizeColumnsToFitData

public void sizeColumnsToFitData()
Changes the sizes of all columns to match the size of their longest cell contents (or the header value if they are longer than the longest cell contents).

Since:
2.0

sizeColumnsToFitData

public void sizeColumnsToFitData(int count)
Changes the sizes of all columns to match the size of their longest cell contents (or the header value if they are longer than the longest cell contents). Only the first number of data cells equal to the specified count are used to determine the longest cell.

Parameters:
count - The number of data cells to use when determining the longest cell
Since:
2.0

sizeColumnsToFitViewport

protected void sizeColumnsToFitViewport(javax.swing.JScrollPane scroller)
Attempts to resize the columns when both the table is a view within a JScrollPane and the vertical scroll bar first appears, in order to eliminate the horizontal scroll bar.

Since:
2.0

sort

public void sort()
Since:
2.0

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent event)
Specified by:
tableChanged in interface javax.swing.event.TableModelListener
Overrides:
tableChanged in class javax.swing.JTable
Since:
2.0


Copyright © 2009. All Rights Reserved.