org.jdesktop.swing
Class JXTable

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTable
                  extended byorg.jdesktop.swing.JXTable
All Implemented Interfaces:
Accessible, CellEditorListener, EventListener, ImageObserver, ListSelectionListener, MenuContainer, PipelineListener, Scrollable, Searchable, Serializable, TableColumnModelListener, TableModelListener
Direct Known Subclasses:
JTreeTable

public class JXTable
extends JTable
implements PipelineListener, Searchable

JXTable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JTable
JTable.AccessibleJTable
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  FilterPipeline filters
           
protected  HighlighterPipeline highlighters
           
static int PRINT_MODE_FIT_WIDTH
          Printing mode that scales the output smaller, if necessary, to fit the table's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary
static int PRINT_MODE_NORMAL
          Printing mode that prints the table at its current size, spreading both columns and rows across multiple pages if necessary.
protected  Sorter sorter
           
static boolean TRACE
           
 
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
JXTable()
           
JXTable(int numRows, int numColumns)
           
JXTable(Object[][] rowData, Object[] columnNames)
           
JXTable(TableModel dm)
           
JXTable(TableModel dm, TableColumnModel cm)
           
JXTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
           
JXTable(Vector rowData, Vector columnNames)
           
 
Method Summary
 void contentsChanged(PipelineEvent e)
          Sent when the pipeline has changed in any way.
 int convertRowIndexToModel(int row)
          Convert row index from view coordinates to model coordinates accounting for the presence of sorters and filters.
 int convertRowIndexToView(int row)
          Convert row index from model coordinates to view coordinates accounting for the presence of sorters and filters.
 void createDefaultColumnsFromModel()
           
protected  TableModel createDefaultDataModel()
          Returns the default table model object, which is a DefaultTableModel.
 TableColumnExt getColumnExt(int viewColumnIndex)
           
 TableColumnExt getColumnExt(Object identifier)
           
 int getColumnMargin()
          Returns the margin between columns.
 List getColumns()
           
protected  ComponentAdapter getComponentAdapter()
           
 FilterPipeline getFilters()
           
 HighlighterPipeline getHighlighters()
           
 Dimension getPreferredScrollableViewportSize()
           
 Printable getPrintable(int printMode, MessageFormat headerFormat, MessageFormat footerFormat)
          Return a Printable for use in printing this JTable.
 int getRowCount()
           
 int getSelectionMode()
          Returns the selection mode used by this table's selection model.
 Sorter getSorter(int columnIndex)
           
 Object getValueAt(int row, int column)
          
 int getVisibleRowCount()
           
protected  void init()
           
 boolean isCellEditable(int row, int column)
           
 boolean isPrinting()
           
 Component prepareRenderer(TableCellRenderer renderer, int row, int column)
          Returns the decorated Component used as a stamp to render the specified cell.
 boolean print()
          A convenience method that displays a printing dialog, and then prints this JTable in mode PRINT_MODE_FIT_WIDTH, with no header or footer text.
 boolean print(int printMode)
          A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with no header or footer text.
 boolean print(int printMode, MessageFormat headerFormat, MessageFormat footerFormat)
          A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with the specified header and footer text.
 boolean print(int printMode, MessageFormat headerFormat, MessageFormat footerFormat, boolean showPrintDialog, PrintRequestAttributeSet attr)
          Print this JTable.
protected  void removeColumns()
          Remove all columns
protected  void resetSorter()
           
 int search(Pattern pattern)
           
 int search(Pattern pattern, int startIndex)
          Search for the pattern from the start index.
 int search(Pattern pattern, int startIndex, boolean backwards)
          Search for the pattern from the start index.
 int search(String searchString)
          Search from the beginning of a document
 int search(String searchString, int columnIndex)
           
 void setColumnMargin(int value)
          Sets the margin between columns.
 void setFilters(FilterPipeline pipeline)
           
 void setHighlighters(HighlighterPipeline pipeline)
           
 void setModel(TableModel newModel)
           
protected  void setSorter(int columnIndex)
           
 void setTableHeader(JTableHeader tableHeader)
          Adds private mouse listener to the table header (for sorting support) before handing it off to the super class for processing.
 void setValueAt(Object aValue, int row, int column)
           
 void setVisibleRowCount(int visibleRowCount)
           
 void tableChanged(TableModelEvent e)
           
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, 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, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setUI, sizeColumnsToFit, sizeColumnsToFit, unconfigureEnclosingScrollPane, updateUI, 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, setBackground, 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
 

Field Detail

TRACE

public static boolean TRACE

PRINT_MODE_NORMAL

public static final int PRINT_MODE_NORMAL
Printing mode that prints the table at its current size, spreading both columns and rows across multiple pages if necessary.

See Also:
Constant Field Values

PRINT_MODE_FIT_WIDTH

public static final int PRINT_MODE_FIT_WIDTH
Printing mode that scales the output smaller, if necessary, to fit the table's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary

See Also:
Constant Field Values

sorter

protected Sorter sorter

filters

protected FilterPipeline filters

highlighters

protected HighlighterPipeline highlighters
Constructor Detail

JXTable

public JXTable()

JXTable

public JXTable(TableModel dm)

JXTable

public JXTable(TableModel dm,
               TableColumnModel cm)

JXTable

public JXTable(TableModel dm,
               TableColumnModel cm,
               ListSelectionModel sm)

JXTable

public JXTable(int numRows,
               int numColumns)