|
JIDE 3.5.15 | ||||||||
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 com.jidesoft.grid.JideTable
public class JideTable
JideTable
is an extended version of JTable
.
JideTable
.
First, we added CellEditorListener support. You can add a JideCellEditorListener
to the table.
JideCellEditorListener
extends CellEditorListener
and added additional methods such as
JideCellEditorListener.editingStarting(javax.swing.event.ChangeEvent)
, JideCellEditorListener.editingStopping(javax.swing.event.ChangeEvent)
and CellEditorListener.editingStopped(javax.swing.event.ChangeEvent)
. You can do things like preventing cell from
starting edit or preventing cell from stopping edit.
The second feature is to support Validator. You can add a Validator to the table. The validating() method in the
listener will be called before cell stops editing. If the validation failed, the cell editor won't be removed.
The third feature added to JideTable is the support of the listener for row height changes when rows have various
height. You can add a listener by calling getRowHeights().addRowHeightChangeListener(listener)
. A RowHeightChangeEvent
will be fired whenever setRowHeight(int, int)
is called.
The fourth feature is rowAutoResizes. By default, JTable's row height is determined explicitly. It wouldn't consider
the cell content preferred height. There is a problem here if a cell renderer can support multiple lines. So we added
a new attribute called rowAutoResizes. By default, it's false which is exactly the same behavior as JTable. If you
set to true, the table row will resize automatically when cell renderer's preferred height changes. Please note there
is a performance hit if you turned it on as it has to check all cells to find out the preferred row height. So only
use it when it's really necessary.
In the future, we will add more features to JideTable
as long as we think the feature should be part of
the base table class.
Please be noted that, JideTable could NOT support the sorter provided in JTable. The reason is that, JTable contains
many private method and fields in that area, which prevents us to inherit its behavior. For sorting feature in
JideTable, please use SortableTable
instead. There might be some odd behaviors if you
invoke JTable#setAutoCreateRowSorter(true).
Nested Class Summary | |
---|---|
protected static class |
JideTable.NonContiguousTransferHandler
The transfer handler for JDK5 and lower version just for backward compatibility concern. |
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
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 | |
---|---|
JideTable()
|
|
JideTable(int numRows,
int numColumns)
|
|
JideTable(Object[][] rowData,
Object[] columnNames)
|
|
JideTable(TableModel dm)
|
|
JideTable(TableModel dm,
TableColumnModel cm)
|
|
JideTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
|
|
JideTable(Vector<?> rowData,
Vector<?> columnNames)
|
Method Summary | |
---|---|
void |
addCellEditorListener(JideCellEditorListener l)
Adds a JideCellEditorListener to the listener list. |
void |
addColumn(TableColumn column)
Overrides this method to skip the column that is being added when the column was hidden earlier by TableColumnChooser.hideColumn(javax.swing.JTable, int) method. |
void |
addColumnSelectionInterval(int index0,
int index1)
|
void |
addNotify()
|
void |
addRowSelectionInterval(int index0,
int index1)
|
void |
addRowValidator(RowValidator l)
Adds a RowValidator to the listener list. |
void |
addUndo(UndoableEdit edit)
Adds an undoable edit to JideTable for further undo/redo. |
void |
addUndoableEditListener(UndoableEditListener listener)
Adds the undoable edit listener. |
void |
addValidator(Validator l)
Adds a Validator to the listener list. |
void |
adjustSelectionWhenColumnMoved(int column,
int targetColumn)
Usually you don't need to call this method. |
boolean |
alwaysCalculateCellRect()
A boolean flag to determine if the rect should always be calculated when painting the grid line and cells. |
protected void |
calculateAutoResizedRowHeights()
Deprecated. replaced by #calculateRowHeight. This method will not be invoked while setRowAutoResizes(true). Please override #calculateRowHeight instead to calculate row height. |
protected void |
calculateAutoResizedRowHeights(int firstRow,
int lastRow)
Deprecated. replaced by #calculateRowHeight. This method will not be invoked while setRowAutoResizes(true). Please override #calculateRowHeight instead to calculate row height. |
protected int |
calculateRowHeight(int row)
The method calculates the height for the row based on the content in the row. |
void |
changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
Updates the selection models of the table, depending on the state of the two flags: toggle and
extend . |
void |
clearSelection()
|
void |
clearSelectionPermanently()
Clear the selections permanently without being restored later on. |
void |
columnSelectionChanged(ListSelectionEvent e)
|
void |
configureEnclosingScrollPaneExplicitly()
|
protected String |
convertElementToString(Object value,
int row,
int column)
Get the displayed string of the specified value in designated row and column. |
int |
convertRowIndexToModel(int viewRowIndex)
Overrides this methods so that it is available for pre-JDK6 environment. |
int |
convertRowIndexToView(int modelRowIndex)
Overrides this methods so that it is available for pre-JDK6 environment. |
protected AutoCompletion |
createCellAutoCompletion(JTextComponent textComponent,
Object[] autoCompletionList)
Creates the AutoCompletion for the cell editor to use. |
void |
createDefaultColumnsFromModel()
|
protected ListSelectionModel |
createDefaultSelectionModel()
|
protected JTableHeader |
createDefaultTableHeader()
Creates the table header. |
void |
createDefaultTableSelectionModel()
Creates a default TableSelectionModel. |
protected TransferHandler |
createDefaultTransferHandler()
Creates default TransferHandler. |
protected RowHeightChangeListener |
createRowAutoScrollingListener()
Creates the RowHeightChangeListener which will automatically scroll the row then row height changes
so that it is outside the visible area. |
protected RowHeights |
createRowHeights()
|
protected SortTableHeaderRenderer |
createSortHeaderRenderer()
Deprecated. replaced by StyledLabel based header renderer. |
boolean |
editCellAt(int row,
int column,
EventObject e)
|
void |
editingCanceled(ChangeEvent e)
|
void |
editingStopped(ChangeEvent e)
|
protected void |
fireEditingCanceled(Object source,
int row,
int column)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireEditingStarted(Object source,
int row,
int column)
Notifies all listeners that have registered interest for notification on this event type. |
protected boolean |
fireEditingStarting(Object source,
int row,
int column)
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireEditingStopped(Object source,
int row,
int column)
Notifies all listeners that have registered interest for notification on this event type. |
protected boolean |
fireEditingStopping(Object source,
int row,
int column)
Notifies all listeners that have registered interest for notification on this event type. |
String |
getActualUIClassID()
|
CellEditorListener[] |
getCellEditorListeners()
Returns an array of all the JideCellEditorListener s added to this JideTable with
addCellEditorListener(). |
Rectangle |
getCellRect(int row,
int column,
boolean includeSpacing)
|
int |
getClickCountToStart()
Returns the number of clicks needed to start editing. |
TableCellRenderer |
getDefaultRenderer(Class<?> columnClass)
|
protected Rectangle |
getDirtyRegion(int firstRow,
int firstColumn,
int lastRow,
int lastColumn)
Gets the dirty region from the first row, first column and last row, last column. |
int |
getEditorAutoCompletionMode()
Gets the editor auto-completion mode. |
protected int |
getEditorAutoCompletionMode(int rowIndex,
int columnIndex)
Gets the editor auto-completion mode for the cell. |
Rectangle |
getEditorCellRect(int rowIndex,
int columnIndex)
In TreeTable and HierarchicalTable case, the cell rect for cell editor should consider the +/- icon size so the cell editor doesn't cover the +/- icon. |
Color |
getGridColor(int row)
Gets the grid line color for each row. |
GridColorProvider |
getGridColorProvider()
Gets the GridColorProvider to provide the grid line colors. |
TableCellEditor |
getRolloverCellEditor()
Gets the cell editor created by rolloverCellAt(int, int) . |
int |
getRolloverColumn()
Gets the column index that has the rollover cell editor. |
int |
getRolloverRow()
Gets the row index that has the rollover cell editor. |
int |
getRowHeight(int row)
|
RowHeights |
getRowHeights()
|
RowValidator[] |
getRowValidator()
Returns an array of all the RowValidator s added to this AbstractCellEditor with
addValidationListener(). |
int |
getSelectedColumn()
Returns the index of the first selected column, -1 if no column is selected. |
int |
getSelectedColumnCount()
Returns the number of selected columns. |
int[] |
getSelectedColumns()
Returns the indices of all selected columns. |
int |
getSelectedRow()
Returns the index of the first selected row, -1 if no row is selected. |
int |
getSelectedRowCount()
Returns the number of selected rows. |
int[] |
getSelectedRows()
Returns the indices of all selected rows. |
Color |
getSelectionBackground()
|
TableColumnWidthKeeper |
getTableColumnWidthKeeper()
|
String |
getTableHeaderToolTipText(int modelIndex)
Gets the TableHeader's tooltip for a particular model column index |
String |
getTableHeaderToolTipText(MouseEvent event)
Gets the TableHeader's tooltip at the location of mouse event. |
TableSelectionModel |
getTableSelectionModel()
Gets the table selection model. |
JTextComponent |
getTextComponentForEditorComponent(Component component)
Gets the text component from the editor component. |
String |
getToolTipText(MouseEvent event)
|
UndoManager |
getUndoManager()
Gets the undo manager. |
Validator[] |
getValidator()
Returns an array of all the Validator s added to this AbstractCellEditor with
addValidationListener(). |
Object |
getValueAt(int row,
int column)
Returns the cell value at row and column . |
Color |
getVerticalGridColor(int column)
Gets the grid line color for each column. |
void |
indexChanged(IndexChangeEvent event)
Called whenever the table model wrapper is going to have some change. |
protected void |
initTable()
Leaves it here for backward compatible reason. |
boolean |
isAdjustEditorLocationOnModelChanged()
Gets the flag that indicates if the cell editing should be kept when table model is changed. |
boolean |
isAlwaysRequestFocusForEditor()
Get the flag indicating if JideTable should always request focus for cell editor. |
boolean |
isAutoResizeFillMode()
Get the flag indicating if empty area of the table need be filled. |
boolean |
isAutoSelectTextWhenStartsEditing()
Checks if the text in the cell editor will be selected when cell starts editing. |
boolean |
isAutoStartCellEditing()
Checks if the navigation key stroke will start cell editing. |
protected boolean |
isAutoStartCellEditingKey(KeyStroke ks)
Checks if the key stroke will trigger the cell editing. |
protected boolean |
isBatchProcessing()
Checks if it is in batch processing. |
boolean |
isCalculateRowHeightsOnWidthChange()
Get the flag indicating if JideTable should calculate row heights if column width is changed. |
boolean |
isCellContentVisible()
Checks if the table cell content will be painted. |
protected boolean |
isCellFocused(int rowIndex,
int columnIndex)
Check if the cell is a focused cell inside the table. |
boolean |
isCellSelected(int row,
int column)
Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified position is selected. |
boolean |
isClearPropertyAtStructureChange()
Get the flag indicating if JideTable should clear properties for table column orders. |
boolean |
isClearSelectionOnTableDataChanges()
Deprecated. replaced by isLoadSelectionOnTableDataChanged() . |
boolean |
isColumnAutoResizable()
Checks if the column is auto-resizable. |
boolean |
isColumnResizable()
Checks if the column is resizable by dragging the vertical grid line. |
boolean |
isColumnSelected(int column)
Returns true if the specified index is in the valid range of columns, and the column at that index is selected. |
boolean |
isEnableIgnored()
Get the flag indicating if the cell will be painted with normal text color even the table is disabled. |
boolean |
isFillBottom()
Deprecated. replaced by isFillsBottom() |
boolean |
isFillGrids()
Deprecated. replaced by isFillsGrids() |
boolean |
isFillRight()
Deprecated. replaced by isFillsRight() |
boolean |
isFillsBottom()
Gets the flag indicating if the area below the JideTable in the viewport will be filled. |
boolean |
isFillsGrids()
Gets the flag indicating if the area below the JideTable in the viewport will be filled with grids. |
protected boolean |
isFillsGridsBottom()
Gets the flag indicating if the area bottom to the JideTable in the viewport will be filled with grids. |
protected boolean |
isFillsGridsRight()
Gets the flag indicating if the area right to the JideTable in the viewport will be filled with grids. |
boolean |
isFillsRight()
Gets the flag indicating if the area right to the JideTable in the viewport will be filled. |
boolean |
isKeepRowHeights()
Get if you want to keep row heights after table events, such as sorting and filtering. |
boolean |
isLoadSelectionOnTableDataChanged()
Gets the flag indicating if JideTable should load selection if it receives a table model event which indicates a table data changed event is fired from its original table model. |
boolean |
isNestedTableHeader()
Checks if nested table header is used. |
boolean |
isNonContiguousCellSelection()
Checks if the table selection model allows non-contiguous cell selection. |
boolean |
isRollover()
Checks if there is a rollover cell editor created by rolloverCellAt(int, int) . |
boolean |
isRowAutoResizes()
Checks if row automatically resizes with the cells preferred heights. |
protected boolean |
isRowHeightChanged(int row,
int newHeight)
The method will check if the new height is different with current height. |
boolean |
isRowResizable()
Checks if the row is resizable by dragging the horizontal grid line. |
boolean |
isRowSelected(int row)
Returns true if the specified index is in the valid range of rows, and the row at that index is selected. |
boolean |
isScrollRowWhenRowHeightChanges()
Checks the flag whether a row is scrolled to visible when its height changes. |
boolean |
isSelectInsertedRows()
Returns the selectInsertedRows flag. |
boolean |
isTablePrinting()
Checks if the table is printing. |
protected boolean |
isValidCellEditingKey(KeyEvent keyEvent)
Checks if the key event is a valid keystroke to start cell editing. |
boolean |
isVariousRowHeights()
Is the table has various row height on each row. |
protected void |
loadTableRowSettings(boolean invokeOutside)
To load row heights and selections after you do some big work, like firing table data change event. |
void |
paintCellOverlay(Graphics g,
Component component,
int row,
int column,
Rectangle cellRect)
Paints the cell overlay. |
void |
paintCellUnderlay(Graphics g,
Component component,
int row,
int column,
Rectangle cellRect)
Paints the cell underlay. |
protected void |
paintFillHeader(Graphics g)
Paint fill header in the right side of the table header if needed. |
Component |
prepareEditor(TableCellEditor editor,
int row,
int column)
|
Component |
prepareRenderer(TableCellRenderer renderer,
int row,
int column)
|
boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
|
void |
releaseRendererComponent(TableCellRenderer renderer,
int row,
int column,
Component component)
|
void |
removeCellEditorListener(JideCellEditorListener l)
Removes a JideCellEditorListener from the listener list. |
void |
removeColumn(TableColumn aColumn)
|
void |
removeColumnSelectionInterval(int index0,
int index1)
|
void |
removeEditor()
Override to regain focus on JTable when the AbstractComboBox's popup panel has focus. |
void |
removeNotify()
|
void |
removeRolloverEditor()
Removes the rollover cell editor created by rolloverCellAt(int, int) . |
void |
removeRowSelectionInterval(int index0,
int index1)
|
void |
removeRowValidator(RowValidator l)
Removes a RowValidator from the listener list. |
void |
removeUndoableEditListener(UndoableEditListener listener)
Removes the undoable edit listener. |
void |
removeValidator(Validator l)
Removes a Validator from the listener list. |
void |
resetTransferHandler()
JideTable will use its own transfer handler called JideTableTransferHandler which could
import data from clipboard. |
boolean |
rolloverCellAt(int row,
int column)
Makes the cell enters editing mode without forcing the other cell editor, if any, to stop editing. |
int |
rowAtPoint(Point point)
Returns the index of the row that point lies in, or -1 if the result is not in the range [0,
getRowCount() -1]. |
protected void |
saveTableRowSettings(boolean invokeOutside)
To save row heights and selections before you do some big work, like firing table data change event. |
void |
scrollRowToVisible(int row)
Scroll the row till the row is visible. |
void |
selectAll()
|
void |
setAdjustEditorLocationOnModelChanged(boolean keepEditing)
Sets the flag that indicates if the cell editing should be kept when table model is changed. |
void |
setAlwaysRequestFocusForEditor(boolean alwaysRequestFocusForEditor)
Set the flag indicating if JideTable should always request focus for cell editor. |
void |
setAutoResizeMode(int mode)
Sets the table's auto resize mode when the table is resized. |
void |
setAutoSelectTextWhenStartsEditing(boolean autoSelectTextWhenStartsEditing)
Sets the flag if the text in the cell editor will be selected when starts editing. |
void |
setAutoStartCellEditing(boolean autoStartCellEditing)
Sets the flag if the navigation key stroke will start cell editing. |
protected void |
setBatchProcessing(boolean batchProcessing)
Sets to batch processing. |
void |
setCalculateRowHeightsOnWidthChange(boolean calculateRowHeightsOnWidthChange)
Set the flag indicating if JideTable should calculate row heights if column width is changed. |
void |
setCellContentVisible(boolean cellContentVisible)
Sets the cell content visible or invisible. |
void |
setClearPropertyAtStructureChange(boolean clearPropertyAtStructureChange)
Set the flag indicating if JideTable should clear properties for table column orders. |
void |
setClearSelectionOnTableDataChanges(boolean clearSelectionOnTableDataChanges)
Deprecated. replaced by setLoadSelectionOnTableDataChanged(boolean) . |
void |
setClickCountToStart(int count)
Specifies the number of clicks needed to start editing. |
void |
setColumnAutoResizable(boolean resizable)
Enable or disable the column auto-resizable. |
void |
setColumnResizable(boolean resizable)
Enable or disable the column resizable. |
void |
setColumnSelectionAllowed(boolean columnSelectionAllowed)
Sets whether the columns can be selected. |
void |
setColumnSelectionInterval(int index0,
int index1)
|
void |
setEditorAutoCompletionMode(int editorAutoCompletionMode)
Sets the editor auto-completion mode. |
void |
setEnabled(boolean enabled)
|
void |
setEnableIgnored(boolean enableIgnored)
Set the flag indicating if the cell will be painted with the normal text color even the table is disabled. |
void |
setFillBottom(boolean fillBottom)
Deprecated. replaced by setFillsBottom(boolean) |
void |
setFillGrids(boolean fillGrids)
Deprecated. replaced by setFillsGrids(boolean) |
void |
setFillRight(boolean fillRight)
Deprecated. replaced by setFillsRight(boolean) |
void |
setFillsBottom(boolean fillsBottom)
Sets the flag indicating if the area below the JideTable in the viewport will be filled. |
void |
setFillsGrids(boolean fillsGrids)
Sets the flag indicating if the area below the JideTable in the viewport will be filled with grids. |
void |
setFillsRight(boolean fillsRight)
Sets the flag indicating if the area right to the JideTable in the viewport will be filled. |
void |
setGridColorProvider(GridColorProvider gridColorProvider)
Sets a GridColorProvider to provide the grid line colors. |
void |
setKeepRowHeights(boolean keepRowHeights)
Set if you want to keep row heights after table events, such as sorting and filtering. |
void |
setLoadSelectionOnTableDataChanged(boolean loadSelectionOnTableDataChanged)
Sets the flag indicating if JideTable should load selection if it receives a table model event which indicates a table data changed event is fired from its original table model. |
void |
setModel(TableModel dataModel)
|
void |
setNestedTableHeader(boolean nestedTableHeader)
Sets if nested table header is allowed. |
void |
setNonContiguousCellSelection(boolean nonContiguousCellSelection)
Sets the attribute of nonContiguousCellSelection. |
void |
setPreferredSize(Dimension preferredSize)
|
void |
setRowAutoResizes(boolean rowAutoResizes)
Sets the rowAutoResizes attribute. |
void |
setRowHeight(int rowHeight)
Sets the height, in pixels, of all cells to rowHeight , re-validates, and repaints. |
void |
setRowHeight(int row,
int rowHeight)
Sets the height for row to rowHeight , re-validates, and repaints. |
void |
setRowHeights(RowHeights rowHeights)
|
void |
setRowResizable(boolean resizable)
Enable or disable the row resizable. |
void |
setRowSelectionAllowed(boolean rowSelectionAllowed)
Sets whether the rows can be selected. |
void |
setRowSelectionInterval(int index0,
int index1)
|
void |
setScrollRowWhenRowHeightChanges(boolean scrollRowWhenRowHeightChanges)
Sets the flag if the row should be scrolled to visible when the row height changes. |
void |
setSelectInsertedRows(boolean selectInsertedRows)
Sets the selectInsertedRow flag. |
protected void |
setSortTableHeaderRenderer()
Deprecated. replaced by StyledLabel based header renderer. |
void |
setTableColumnWidthKeeper(TableColumnWidthKeeper tableColumnWidthKeeper)
|
void |
setTableHeader(JTableHeader tableHeader)
|
void |
setTablePrinting(boolean tablePrinting)
Sets the table as printing. |
void |
setTableSelectionModel(TableSelectionModel tableSelectionModel)
Sets a new TableSelectionModel. |
void |
setVariousRowHeights(boolean variousRowHeights)
Sets variousRowHeights. |
protected boolean |
shouldCellBePaintedAsFocused(int row,
int column)
Subclass can override this method to determine if the cell should be painted as focused cell when it is a focused cell. |
protected boolean |
shouldCellBePaintedAsSelected(int row,
int column)
Subclass can override this method to determine if the cell should be painted as selected when selected. |
protected boolean |
startCellEditing(CellEditor editor,
int row,
int column)
Calls fireEditingStarting and fireEditingStarted , and returns true or false based on
the return value of fireEditingStarting . |
void |
tableChanged(TableModelEvent e)
Invoked when this table's TableModel generates a TableModelEvent . |
void |
updateUI()
|
ValidationResult |
validate(int rowIndex,
int columnIndex,
Object oldValue,
Object newValue)
|
ValidationResult |
validateRow(int rowIndex)
Validates a row. |
void |
valueChanged(ListSelectionEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jidesoft.grid.TableAdapter |
---|
getCellSelectionEnabled, getColumnClass, getColumnCount, getColumnName, getColumnSelectionAllowed, getRowCount, getRowSelectionAllowed, isCellEditable, setCellSelectionEnabled, setValueAt |
Field Detail |
---|
protected transient CellChangeEvent _cellChangeEvent
@Deprecated public static final String ROW_AUTO_RESIZES_PROPERTY
public static final String PROPERTY_ROW_AUTO_RESIZES
public static final String PROPERTY_NON_CONTIGUOUS_CELL_SELECTION
public static final String PROPERTY_TABLE_SELECTION_MODEL
public static final String PROPERTY_SCROLL_ROW_WHEN_ROW_HEIGHT_CHANGES
@Deprecated public static final String PROPERTY_CLEAR_SELECTION_ON_TABLE_DATA_CHANGES
PROPERTY_LOAD_SELECTION_ON_TABLE_DATA_CHANGES
public static final String PROPERTY_LOAD_SELECTION_ON_TABLE_DATA_CHANGES
public static final String PROPERTY_EDITOR_AUTO_COMPLETION_MODE
public static final String PROPERTY_FILLS_RIGHT
public static final String PROPERTY_FILLS_BOTTOM
public static final String PROPERTY_FILLS_GRIDS
public static final String CLIENT_PROPERTY_LAZY_CALCULATE_ROW_HEIGHT
isRowAutoResizes()
returns true.
By default, it's lazy load which won't hit the performance. However, if you want to refresh the table's prefererd
height without performance concern, please set this client property to Boolean.FALSE
public static final String ACTION_NAME_CANCEL_EDITING
public static final int AUTO_RESIZE_FILL
@Deprecated public static final int AUTO_RESIZE_NEXT_COLUMN_FILL
@Deprecated public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS_FILL
@Deprecated public static final int AUTO_RESIZE_LAST_COLUMN_FILL
@Deprecated public static final int AUTO_RESIZE_ALL_COLUMNS_FILL
protected int _clickCountToStart
clickCountToStart
is
defined as zero, it will not initiate until a click occurs.
protected MouseMotionListener _headerDraggingMouseMotionListener
public static final int EDITOR_AUTO_COMPLETION_MODE_NONE
public static final int EDITOR_AUTO_COMPLETION_MODE_COLUMN
public static final int EDITOR_AUTO_COMPLETION_MODE_ROW
public static final int EDITOR_AUTO_COMPLETION_MODE_TABLE
protected RowHeights _rowHeights
protected boolean _batchProcessing
protected PropertyChangeListener _rolloverEditorRemover
protected CellEditorListener _rolloverCellEditorListener
protected transient TableCellEditor _rolloverCellEditor
protected transient Component _rolloverEditorComp
protected transient int _rolloverRow
protected transient int _rolloverColumn
protected TableColumnAutoResizer _columnAutoResizer
protected TableRowResizer _rowResizer
protected TableColumnResizer _columnResizer
Constructor Detail |
---|
public JideTable()
public JideTable(int numRows, int numColumns)
public JideTable(TableModel dm)
public JideTable(Object[][] rowData, Object[] columnNames)
public JideTable(Vector<?> rowData, Vector<?> columnNames)
public JideTable(TableModel dm, TableColumnModel cm)
public JideTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
Method Detail |
---|
protected void initTable()
public void resetTransferHandler()
JideTable
will use its own transfer handler called JideTableTransferHandler
which could
import data from clipboard. If you dont' like this behavior, you could call this method to reset the transfer
handler to the default one created by JTable which doesn't allow import.
public void setModel(TableModel dataModel)
setModel
in class JTable
public void setAutoResizeMode(int mode)
RowStripeTableStyleProvider
. Most likely you will combine
it with AUTO_RESIZE_OFF flag and call setAutoResizeMode(AUTO_RESIZE_FILL | AUTO_RESIZE_OFF). However you could
use AUTO_RESIZE_FILL | AUTO_RESIZE_NEXT_COLUMN or with any other auto resize modes.
Prior to 2.10.1, we changed the return value of getAutoResizeMode to return the exact value you set using
setAutoResizeMode. However it has some side effects that we can't overcome. So starting from 2.10.1,
getAutoResizeMode will return the mode without AUTO_RESIZE_FILL. If you want to check if AUTO_RESIZE_FILL is set,
you can call isAutoResizeFillMode()
.
setAutoResizeMode
in class JTable
mode
- the auto resize modeJTable.getAutoResizeMode()
,
JTable.doLayout()
public boolean isAutoResizeFillMode()
setAutoResizeMode(int)
to change its value. If you want
this flag to return true, just call setAutoResizeMode( mode | AUTO_RESIZE_FILL) where the mode is one of the four
existing auto resize modes defined in JTable.
public String getActualUIClassID()
public void updateUI()
updateUI
in class JTable
public boolean isNestedTableHeader()
setNestedTableHeader(boolean)
and pass in true.
public void setNestedTableHeader(boolean nestedTableHeader)
nestedTableHeader
- true or false.protected JTableHeader createDefaultTableHeader()
createDefaultTableHeader
in class JTable
protected void paintFillHeader(Graphics g)
g
- the Graphics instancepublic String getTableHeaderToolTipText(MouseEvent event)
event
- the mouse event.
public String getTableHeaderToolTipText(int modelIndex)
modelIndex
- the model column index.
public boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
processKeyBinding
in class JTable
public void setTableHeader(JTableHeader tableHeader)
setTableHeader
in class JTable
public Component prepareEditor(TableCellEditor editor, int row, int column)
prepareEditor
in class JTable
protected AutoCompletion createCellAutoCompletion(JTextComponent textComponent, Object[] autoCompletionList)
textComponent
- the text componentautoCompletionList
- the auto completion list
protected String convertElementToString(Object value, int row, int column)
value
- the cell valuerow
- the row of the cellcolumn
- the column of the cell
public JTextComponent getTextComponentForEditorComponent(Component component)
isAutoSelectTextWhenStartsEditing()
is true.
Please note, this method will only return JTextComponent if the component is JTextComponent, JComboBox,
AbstractComboBox or JSpinner. For all other types of components, it will return null. If you have a custom
component which also has JTextComponent in it, you would need to override this method to return the right
JTextComponent.
component
- the component.
protected boolean startCellEditing(CellEditor editor, int row, int column)
fireEditingStarting
and fireEditingStarted
, and returns true or false based on
the return value of fireEditingStarting
.
editor
- the editorrow
- the editing rowcolumn
- the editing column
protected boolean fireEditingStarting(Object source, int row, int column)
source
- the source of the eventrow
- the row indexcolumn
- the column index
editingStarting()
, it will return true. If
one of the listener returns false, it will return false.protected void fireEditingStarted(Object source, int row, int column)
source
- the source of the eventrow
- the row indexcolumn
- the column indexEventListenerList
public void addCellEditorListener(JideCellEditorListener l)
JideCellEditorListener
to the listener list.
l
- the new listener to be addedpublic void removeCellEditorListener(JideCellEditorListener l)
JideCellEditorListener
from the listener list.
l
- the listener to be removedpublic CellEditorListener[] getCellEditorListeners()
JideCellEditorListener
s added to this JideTable
with
addCellEditorListener().
CellEditorListener
s added or an empty array if no listeners have been addedpublic void addValidator(Validator l)
Validator
to the listener list.
l
- the new listener to be addedpublic void removeValidator(Validator l)
Validator
from the listener list.
l
- the listener to be removedpublic Validator[] getValidator()
Validator
s added to this AbstractCellEditor with
addValidationListener().
Validator
s added or an empty array if no listeners have been addedpublic ValidationResult validate(int rowIndex, int columnIndex, Object oldValue, Object newValue)
public void addRowValidator(RowValidator l)
RowValidator
to the listener list.
l
- the new listener to be addedpublic void removeRowValidator(RowValidator l)
RowValidator
from the listener list.
l
- the listener to be removedpublic RowValidator[] getRowValidator()
RowValidator
s added to this AbstractCellEditor with
addValidationListener().
RowValidator
s added or an empty array if no listeners have been addedpublic ValidationResult validateRow(int rowIndex)
addRowValidator(com.jidesoft.validation.RowValidator)
to do the validation.
rowIndex
- the row index.
public void editingStopped(ChangeEvent e)
editingStopped
in interface CellEditorListener
editingStopped
in class JTable
public void editingCanceled(ChangeEvent e)
editingCanceled
in interface CellEditorListener
editingCanceled
in class JTable
protected boolean fireEditingStopping(Object source, int row, int column)
source
- the source of the eventrow
- the row indexcolumn
- the column index
editingStarting()
, it will return true. If
one of the listener returns false, it will return false.protected void fireEditingStopped(Object source, int row, int column)
source
- the source of the eventrow
- the row indexcolumn
- the column indexEventListenerList
protected void fireEditingCanceled(Object source, int row, int column)
source
- the source of the eventrow
- the row indexcolumn
- the column indexEventListenerList
public RowHeights getRowHeights()
protected RowHeights createRowHeights()
public void setRowHeights(RowHeights rowHeights)
public boolean isScrollRowWhenRowHeightChanges()
public void setScrollRowWhenRowHeightChanges(boolean scrollRowWhenRowHeightChanges)
scrollRowWhenRowHeightChanges
- true or false.protected RowHeightChangeListener createRowAutoScrollingListener()
RowHeightChangeListener
which will automatically scroll the row then row height changes
so that it is outside the visible area.
RowHeightChangeListener
.public void scrollRowToVisible(int row)
TableUtils.ensureRowVisible(javax.swing.JTable,
int)
method. It will only scroll vertically to the exact location so that the row is fully visible.
This method is called automatically when row height changes. If isScrollRowWhenRowHeightChanges()
is
true, the row will automatically be scrolled to show the whole row when the height for that row changes. You can
subclass it to scroll the table in a different way.
row
- the row whose height changes.public void setRowHeight(int rowHeight)
rowHeight
, re-validates, and repaints. The height of the
cells will be equal to the row height minus the row margin.
setRowHeight
in class JTable
rowHeight
- new row height
IllegalArgumentException
- if rowHeight
is less than 1 description: The height of the
specified row.getRowHeight(int)
protected boolean isBatchProcessing()
protected void setBatchProcessing(boolean batchProcessing)
batchProcessing
- true or false.public void setRowHeight(int row, int rowHeight)
row
to rowHeight
, re-validates, and repaints. The height of the
cells in this row will be equal to the row height minus the row margin.
setRowHeight
in class JTable
row
- the row whose height is being changedrowHeight
- new row height, in pixels
IllegalArgumentException
- if rowHeight
is less than 1 description: The height in pixels of
the cells in row
@Deprecated protected void calculateAutoResizedRowHeights(int firstRow, int lastRow)
firstRow
- the first row to be calculatedlastRow
- the last row to be calculated@Deprecated protected void calculateAutoResizedRowHeights()
protected int calculateRowHeight(int row)
row
- the row to be calculated
protected boolean isRowHeightChanged(int row, int newHeight)
TableUtils.autoResizeRow(javax.swing.JTable, int, int)
.
row
- the row to be checkednewHeight
- new height of the row, most likely from calculateRowHeight(int)
public int getRowHeight(int row)
getRowHeight
in class JTable
public int rowAtPoint(Point point)
point
lies in, or -1 if the result is not in the range [0,
getRowCount()
-1].
rowAtPoint
in class JTable
point
- the location of interest
point
lies in, or -1 if the result is not in the range [0,
getRowCount()
-1]JTable.columnAtPoint(java.awt.Point)
public Rectangle getCellRect(int row, int column, boolean includeSpacing)
getCellRect
in class JTable
public Rectangle getEditorCellRect(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index
public void createDefaultColumnsFromModel()
createDefaultColumnsFromModel
in class JTable
public void setKeepRowHeights(boolean keepRowHeights)
isKeepRowHeights()
keepRowHeights
- the flag that if the table will keep the row heightspublic boolean isKeepRowHeights()
public boolean isLoadSelectionOnTableDataChanged()
setLoadSelectionOnTableDataChanged(boolean)
public void setLoadSelectionOnTableDataChanged(boolean loadSelectionOnTableDataChanged)
loadSelectionOnTableDataChanged
- the flagpublic boolean isFillsRight()
setFillsRight(boolean)
public void setFillsRight(boolean fillsRight)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
fillsRight
- the flagpublic boolean isFillsBottom()
setFillsBottom(boolean)
public void setFillsBottom(boolean fillsBottom)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
fillsBottom
- the flagpublic boolean isFillsGrids()
setFillsGrids(boolean)
protected boolean isFillsGridsBottom()
isFillsBottom()
&& isFillsGrids()
.
setFillsGrids(boolean)
protected boolean isFillsGridsRight()
isFillsRight()
.
setFillsGrids(boolean)
public void setFillsGrids(boolean fillsGrids)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
and setFillsBottom(boolean)
returns true
fillsGrids
- the flag@Deprecated public boolean isFillRight()
isFillsRight()
setFillsRight(boolean)
@Deprecated public void setFillRight(boolean fillRight)
setFillsRight(boolean)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
fillRight
- the flag@Deprecated public boolean isFillBottom()
isFillsBottom()
setFillsBottom(boolean)
@Deprecated public void setFillBottom(boolean fillBottom)
setFillsBottom(boolean)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
fillBottom
- the flag@Deprecated public boolean isFillGrids()
isFillsGrids()
setFillsGrids(boolean)
@Deprecated public void setFillGrids(boolean fillGrids)
setFillsGrids(boolean)
JTable.getAutoResizeMode()
includes AUTO_RESIZE_FILL
and setFillsBottom(boolean)
returns true
fillGrids
- the flagpublic boolean isAdjustEditorLocationOnModelChanged()
setAdjustEditorLocationOnModelChanged(boolean)
public void setAdjustEditorLocationOnModelChanged(boolean keepEditing)
keepEditing
- the flagprotected void saveTableRowSettings(boolean invokeOutside)
loadTableRowSettings(boolean)
.
invokeOutside
- always TRUE if you want to call this method explicitly. We will call this method with FALSE
internally.protected void loadTableRowSettings(boolean invokeOutside)
saveTableRowSettings(boolean)
.
invokeOutside
- always TRUE if you want to call this method explicitly. We will call this method with FALSE
internally.public void indexChanged(IndexChangeEvent event)
indexChanged
in interface IndexChangeListener
event
- the table model wrapper eventpublic void tableChanged(TableModelEvent e)
TableModel
generates a TableModelEvent
. The
TableModelEvent
should be constructed in the coordinate system of the model; the appropriate mapping
to the view coordinate system is performed by this JTable
when it receives the event.
Application code will not use these methods explicitly, they are used internally by JTable
.
tableChanged
in interface TableModelListener
tableChanged
in class JTable
protected ListSelectionModel createDefaultSelectionModel()
createDefaultSelectionModel
in class JTable
public boolean isRowAutoResizes()
public void setRowAutoResizes(boolean rowAutoResizes)
rowAutoResizes
- true to enable rowAutoResizes. Otherwise false.@Deprecated protected void setSortTableHeaderRenderer()
JideTable table = new JideTable(model){
protected void initTable() {
super.initTable();
setSortTableHeaderRenderer();
}
protected JTableHeader createDefaultTableHeader() {
return new JTableHeader(columnModel);
}
};
Now if you have a column name that has "\n" in it, it will split the text into multiple lines.
@Deprecated protected SortTableHeaderRenderer createSortHeaderRenderer()
public boolean isNonContiguousCellSelection()
getTableSelectionModel()
to get the selection model and add listener to it. If false, getTableSelectionModel()
will return null.public void setNonContiguousCellSelection(boolean nonContiguousCellSelection)
nonContiguousCellSelection
- true to enable non-contiguous cell selection.public void setRowSelectionAllowed(boolean rowSelectionAllowed)
TableAdapter
setRowSelectionAllowed
in interface TableAdapter
setRowSelectionAllowed
in class JTable
rowSelectionAllowed
- true if it will allow row selectionpublic void setColumnSelectionAllowed(boolean columnSelectionAllowed)
TableAdapter
setColumnSelectionAllowed
in interface TableAdapter
setColumnSelectionAllowed
in class JTable
columnSelectionAllowed
- true if it will allow column selectionpublic void createDefaultTableSelectionModel()
public void setTableSelectionModel(TableSelectionModel tableSelectionModel)
tableSelectionModel
- the new TableSelectionModel.public TableSelectionModel getTableSelectionModel()
isNonContiguousCellSelection()
return true.
public int[] getSelectedRows()
TableAdapter
getSelectedRows
in interface TableAdapter
getSelectedRows
in class JTable
TableAdapter.getSelectedRow()
public int[] getSelectedColumns()
TableAdapter
getSelectedColumns
in interface TableAdapter
getSelectedColumns
in class JTable
TableAdapter.getSelectedColumn()
public int getSelectedRow()
TableAdapter
getSelectedRow
in interface TableAdapter
getSelectedRow
in class JTable
public int getSelectedColumn()
TableAdapter
getSelectedColumn
in interface TableAdapter
getSelectedColumn
in class JTable
public int getSelectedRowCount()
TableAdapter
getSelectedRowCount
in interface TableAdapter
getSelectedRowCount
in class JTable
public int getSelectedColumnCount()
TableAdapter
getSelectedColumnCount
in interface TableAdapter
getSelectedColumnCount
in class JTable
public boolean isRowSelected(int row)
TableAdapter
isRowSelected
in interface TableAdapter
isRowSelected
in class JTable
row
- the row index
row
is a valid index and the row at that index is selected (where 0 is the first
row)public boolean isColumnSelected(int column)
TableAdapter
isColumnSelected
in interface TableAdapter
isColumnSelected
in class JTable
column
- the column in the column model
column
is a valid index and the column at that index is selected (where 0 is the
first column)protected boolean shouldCellBePaintedAsSelected(int row, int column)
row
- the row index.column
- the column index
protected boolean shouldCellBePaintedAsFocused(int row, int column)
row
- the row index.column
- the column index
public boolean isCellSelected(int row, int column)
TableAdapter
isCellSelected
in interface TableAdapter
isCellSelected
in class JTable
row
- the row being queriedcolumn
- the column being queried
row
and column
are valid indices and the cell at index (row,
column)
is selected, where the first row and first column are at index 0public boolean isCalculateRowHeightsOnWidthChange()
isRowAutoResizes()
returns true.
The default value of this flag is true.
public void setCalculateRowHeightsOnWidthChange(boolean calculateRowHeightsOnWidthChange)
calculateRowHeightsOnWidthChange
- the flagpublic boolean isAlwaysRequestFocusForEditor()
public void setAlwaysRequestFocusForEditor(boolean alwaysRequestFocusForEditor)
alwaysRequestFocusForEditor
- the flagpublic boolean isClearPropertyAtStructureChange()
public void setClearPropertyAtStructureChange(boolean clearPropertyAtStructureChange)
clearPropertyAtStructureChange
- the flagpublic void paintCellUnderlay(Graphics g, Component component, int row, int column, Rectangle cellRect)
g
- the Graphicscomponent
- the componentrow
- the row indexcolumn
- the column indexcellRect
- the cell rectangle of the cell at the specified row index and column index.public void paintCellOverlay(Graphics g, Component component, int row, int column, Rectangle cellRect)
g
- the Graphicscomponent
- the componentrow
- the row indexcolumn
- the column indexcellRect
- the cell rectangle of the cell at the specified row index and column index.public boolean isEnableIgnored()
setEnableIgnored(boolean)
and set it to true.
The default value is false.
public void setEnableIgnored(boolean enableIgnored)
enableIgnored
- the flagpublic boolean isRollover()
rolloverCellAt(int, int)
.
public TableCellEditor getRolloverCellEditor()
rolloverCellAt(int, int)
.
public int getRolloverRow()
public int getRolloverColumn()
public boolean rolloverCellAt(int row, int column)
row
- the row index.column
- the column index.
public void removeRolloverEditor()
rolloverCellAt(int, int)
.
public boolean editCellAt(int row, int column, EventObject e)
editCellAt
in class JTable
protected boolean isValidCellEditingKey(KeyEvent keyEvent)
if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE || keyEvent.getKeyCode() == KeyEvent.VK_DELETE ||
keyEvent.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
return false;
}
else if(keyEvent.getKeyCode() == KeyEvent.VK_F2) {
return true;
}
else if(keyEvent.getKeyCode() >= KeyEvent.VK_F1 && keyEvent.getKeyCode() <= KeyEvent.VK_F24) {
return false;
}
return true;
keyEvent
- the key event
public void clearSelectionPermanently()
public void clearSelection()
clearSelection
in class JTable
public void setRowSelectionInterval(int index0, int index1)
setRowSelectionInterval
in class JTable
public void setColumnSelectionInterval(int index0, int index1)
setColumnSelectionInterval
in class JTable
public void addRowSelectionInterval(int index0, int index1)
addRowSelectionInterval
in class JTable
public void addColumnSelectionInterval(int index0, int index1)
addColumnSelectionInterval
in class JTable
public void removeRowSelectionInterval(int index0, int index1)
removeRowSelectionInterval
in class JTable
public void removeColumnSelectionInterval(int index0, int index1)
removeColumnSelectionInterval
in class JTable
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
TableAdapter
toggle
and
extend
. Most changes to the selection that are the result of keyboard or mouse events received by
the UI are channeled through this method so that the behavior may be overridden by a subclass. Some UIs may need
more functionality than this method provides, such as when manipulating the lead for discontiguous selection, and
may not call into this method for some selection changes.
This implementation uses the following conventions: toggle
: false,
extend
: false. Clear the previous selection and ensure the new cell is selected. toggle
: false, extend
: true. Extend the previous selection from the
anchor to the specified cell, clearing all other selections. toggle
: true,
extend
: false. If the specified cell is selected, deselect it. If it is not selected,
select it. toggle
: true, extend
: true. Apply the selection state
of the anchor to all cells between it and the specified cell.
changeSelection
in interface TableAdapter
changeSelection
in class JTable
rowIndex
- affects the selection at row
columnIndex
- affects the selection at column
toggle
- see description aboveextend
- if true, extend the current selectionpublic void columnSelectionChanged(ListSelectionEvent e)
columnSelectionChanged
in interface TableColumnModelListener
columnSelectionChanged
in class JTable
protected Rectangle getDirtyRegion(int firstRow, int firstColumn, int lastRow, int lastColumn)
firstRow
- the first rowfirstColumn
- the first columnlastRow
- the last rowlastColumn
- the last column
public void addColumn(TableColumn column)
TableColumnChooser.hideColumn(javax.swing.JTable, int)
method.
addColumn
in class JTable
column
- the TableColumn to be added.public void removeColumn(TableColumn aColumn)
removeColumn
in class JTable
public void adjustSelectionWhenColumnMoved(int column, int targetColumn)
column
- the column indextargetColumn
- the target column index.public void releaseRendererComponent(TableCellRenderer renderer, int row, int column, Component component)
public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
prepareRenderer
in class JTable
public TableCellRenderer getDefaultRenderer(Class<?> columnClass)
getDefaultRenderer
in class JTable
public Color getSelectionBackground()
getSelectionBackground
in class JTable
public boolean isColumnAutoResizable()
public void setColumnAutoResizable(boolean resizable)
resizable
- true to make column auto-resizable.public boolean isColumnResizable()
public void setColumnResizable(boolean resizable)
resizable
- true to make column resizable.public boolean isRowResizable()
public void setRowResizable(boolean resizable)
resizable
- true to make row resizable.public void selectAll()
selectAll
in class JTable
public String getToolTipText(MouseEvent event)
getToolTipText
in class JTable
public boolean isTablePrinting()
public void setTablePrinting(boolean tablePrinting)
tablePrinting
- true to indicate the table is being printed.public boolean isVariousRowHeights()
isRowAutoResizes()
is true.public void setVariousRowHeights(boolean variousRowHeights)
variousRowHeights
- true or falseprotected TransferHandler createDefaultTransferHandler()
public boolean isSelectInsertedRows()
public void setSelectInsertedRows(boolean selectInsertedRows)
selectInsertedRows
- true or false.@Deprecated public boolean isClearSelectionOnTableDataChanges()
isLoadSelectionOnTableDataChanged()
.
@Deprecated public void setClearSelectionOnTableDataChanges(boolean clearSelectionOnTableDataChanges)
setLoadSelectionOnTableDataChanged(boolean)
.
clearSelectionOnTableDataChanges
- true to clear selection when table data changed event is received.public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
valueChanged
in class JTable
public void setClickCountToStart(int count)
count
- an int specifying the number of clicks needed to start editinggetClickCountToStart()
public int getClickCountToStart()
public GridColorProvider getGridColorProvider()
public void setGridColorProvider(GridColorProvider gridColorProvider)
gridColorProvider
- the GridColorProvider.public Color getGridColor(int row)
row
- the row index.
public Color getVerticalGridColor(int column)
column
- the column index.
public TableColumnWidthKeeper getTableColumnWidthKeeper()
public void setTableColumnWidthKeeper(TableColumnWidthKeeper tableColumnWidthKeeper)
public void setPreferredSize(Dimension preferredSize)
setPreferredSize
in class JComponent
public boolean isAutoStartCellEditing()
public void setAutoStartCellEditing(boolean autoStartCellEditing)
autoStartCellEditing
- true or false.protected boolean isAutoStartCellEditingKey(KeyStroke ks)
isAutoStartCellEditing()
is true.
ks
- the key stroke
public void addNotify()
addNotify
in class JTable
public void removeNotify()
removeNotify
in class JTable
public void removeEditor()
removeEditor
in class JTable
public boolean isAutoSelectTextWhenStartsEditing()
getTextComponentForEditorComponent(java.awt.Component)
to return the
JTextComponent that you would like the text to be selected.
Default is true.
public void setAutoSelectTextWhenStartsEditing(boolean autoSelectTextWhenStartsEditing)
getTextComponentForEditorComponent(java.awt.Component)
to return the
JTextComponent that you would like the text to be selected.
Default is true.
autoSelectTextWhenStartsEditing
- true or false.public int convertRowIndexToView(int modelRowIndex)
convertRowIndexToView
in class JTable
modelRowIndex
- the model row index.
public int convertRowIndexToModel(int viewRowIndex)
convertRowIndexToModel
in class JTable
viewRowIndex
- the view row index.
public boolean alwaysCalculateCellRect()
public boolean isCellContentVisible()
public void setCellContentVisible(boolean cellContentVisible)
cellContentVisible
- true or false.public void configureEnclosingScrollPaneExplicitly()
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
protected int getEditorAutoCompletionMode(int rowIndex, int columnIndex)
getEditorAutoCompletionMode()
. However, if you don't want to have auto
completion for some columns/rows/cells, you could override this method to customize the behavior.
rowIndex
- the row indexcolumnIndex
- the column index
public int getEditorAutoCompletionMode()
public void setEditorAutoCompletionMode(int editorAutoCompletionMode)
editorAutoCompletionMode
- the editor auto-completion mode.protected boolean isCellFocused(int rowIndex, int columnIndex)
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cell
public Object getValueAt(int row, int column)
TableAdapter
row
and column
.
Note: The column is specified in the table view's display order, and not in the TableModel
's
column order. This is an important distinction because as the user rearranges the columns in the table, the
column at a given index in the view will change. Meanwhile the user's actions never affect the model's column
ordering.
getValueAt
in interface TableAdapter
getValueAt
in class JTable
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried
public UndoManager getUndoManager()
public void addUndoableEditListener(UndoableEditListener listener)
listener
- the listenerpublic void removeUndoableEditListener(UndoableEditListener listener)
listener
- the listenerpublic void addUndo(UndoableEdit edit)
edit
- the UndoableEdit
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |