public class ExtendedEditorTable extends JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,Map<Integer,TableCellEditor>> |
editors
The Map of editors.
|
protected Map<Integer,Map<Integer,ActionListener>> |
openEditorListeners
The Map of listeners which listens to opening of editors.
|
protected Map<Integer,Map<Integer,TableCellRenderer>> |
renderers
The Map of renderers.
|
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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ExtendedEditorTable() |
ExtendedEditorTable(int numRows,
int numColumns)
Constructs a
JTable with numRows and numColumns of empty cells using DefaultTableModel . |
ExtendedEditorTable(Object[][] rowData,
Object[] columnNames)
Constructs a
JTable to display the values in the two dimensional array,
rowData , with column names, columnNames . |
ExtendedEditorTable(TableModel dm)
Constructs a
JTable that is initialized with dm as the data model, a default column model,
and a default selection model. |
ExtendedEditorTable(TableModel dm,
TableColumnModel cm)
Constructs a
JTable that is initialized with
dm as the data model, cm
as the column model, and a default selection model. |
ExtendedEditorTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
Constructs a
JTable that is initialized with
dm as the data model, cm as the
column model, and sm as the selection model. |
ExtendedEditorTable(Vector rowData,
Vector columnNames)
Constructs a
JTable to display the values in the Vector of Vectors , rowData ,
with column names, columnNames . |
Modifier and Type | Method and Description |
---|---|
void |
addEditor(int row,
int column,
TableCellEditor editor)
Set the editor to use with a particular row and column.
|
void |
addOpenEditorListener(int row,
int column,
ActionListener listener)
Add a listener which listen to opening of editors.
|
void |
addRenderer(int row,
int column,
TableCellRenderer renderer)
Set the cell renderer to use with a particular row and column.
|
protected void |
fireOpenEditor(int row,
int column,
long when,
int modifiers) |
TableCellEditor |
getCellEditor(int row,
int column)
Returns an appropriate editor for the cell specified by
row and column .Note that contrary to
the getEditor(int, int) , this method will defer to the parent class if there is no specific TableCellEditor defined for the row and column. |
TableCellRenderer |
getCellRenderer(int row,
int column)
Returns the renderer for the cell specified by this row and column.
|
TableCellEditor |
getEditor(int row,
int column)
Return the specific TableCellEditor for a row and column.
|
TableCellEditor |
removeEditor(int row,
int column)
Remove the editor used with a particular row and column.
|
void |
removeOpenEditorListener(int row,
int column)
Remove a listener which listens to opening of editors.
|
TableCellRenderer |
removeRenderer(int row,
int column)
Remove the cell renderer used with a particular row and column.
|
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, 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, getToolTipText, 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, selectAll, 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, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
protected final Map<Integer,Map<Integer,ActionListener>> openEditorListeners
protected final Map<Integer,Map<Integer,TableCellEditor>> editors
protected final Map<Integer,Map<Integer,TableCellRenderer>> renderers
public ExtendedEditorTable()
public ExtendedEditorTable(TableModel dm)
JTable
that is initialized with dm
as the data model, a default column model,
and a default selection model.dm
- the data model for the tablepublic ExtendedEditorTable(TableModel dm, TableColumnModel cm)
JTable
that is initialized with
dm
as the data model, cm
as the column model, and a default selection model.dm
- the data model for the tablecm
- the column model for the tablepublic ExtendedEditorTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
JTable
that is initialized with
dm
as the data model, cm
as the
column model, and sm
as the selection model.dm
- the data model for the tablecm
- the column model for the tablesm
- the row selection model for the tablepublic ExtendedEditorTable(int numRows, int numColumns)
JTable
with numRows
and numColumns
of empty cells using DefaultTableModel
.numRows
- the number of rowsnumColumns
- the number of columnspublic ExtendedEditorTable(Vector rowData, Vector columnNames)
JTable
to display the values in the Vector
of Vectors
, rowData
,
with column names, columnNames
.rowData
- the data for the new tablecolumnNames
- names of each columnpublic void addEditor(int row, int column, TableCellEditor editor)
row
- the row indexcolumn
- the column indexeditor
- the Editorpublic TableCellEditor removeEditor(int row, int column)
row
- the row indexcolumn
- the column indexpublic TableCellEditor getEditor(int row, int column)
getCellEditor(int, int)
, this method will return
null if there is no specific TableCellEditor defined for the row and column.row
- the row indexcolumn
- the column indexpublic TableCellEditor getCellEditor(int row, int column)
row
and column
.Note that contrary to
the getEditor(int, int)
, this method will defer to the parent class if there is no specific TableCellEditor defined for the row and column.getCellEditor
in class JTable
row
- the row of the cell to editcolumn
- the column of the cell to editpublic TableCellRenderer removeRenderer(int row, int column)
row
- the row indexcolumn
- the column indexpublic void addRenderer(int row, int column, TableCellRenderer renderer)
row
- the row indexcolumn
- the column indexrenderer
- the cell rendererpublic TableCellRenderer getCellRenderer(int row, int column)
getCellRenderer
in class JTable
row
- the row of the cell to render, where 0 is the first rowcolumn
- the column of the cell to render, where 0 is the first columnnull
returns the default renderer for this type of objectpublic void addOpenEditorListener(int row, int column, ActionListener listener)
row
- the row where to add the listenercolumn
- the column where to add the listenerlistener
- the listenerpublic void removeOpenEditorListener(int row, int column)
row
- the row where to remove the listenercolumn
- the column where to remove the listenerprotected void fireOpenEditor(int row, int column, long when, int modifiers)