public class ETable extends JTable
Note: This API is still under development and may change even in incompatible way during its stabilization phase. The API will be finalized in NetBeans version 6.5.
| Modifier and Type | Class and Description |
|---|---|
static class |
ETable.ColumnSelection
The visible column selection methods.
|
static class |
ETable.RowMapping
Item to the collection when doing the sorting of table rows.
|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintModeJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected int[] |
inverseSortingPermutation
Inverse of the above
|
static String |
PROP_QUICK_FILTER
Property that is fired when calling
setQuickFilter(int, java.lang.Object) or
unsetQuickFilter(). |
protected int[] |
sortingPermutation
Array with size exactly same as the number of rows in the data model
or null.
|
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, tableHeaderaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ETable()
Constructs a default
JTable that is initialized with a default
data model, a default column model, and a default selection
model. |
ETable(int numRows,
int numColumns)
Constructs a
JTable with numRows
and numColumns of empty cells using
DefaultTableModel. |
ETable(Object[][] rowData,
Object[] columnNames)
Constructs a
JTable to display the values in the two dimensional array,
rowData, with column names, columnNames. |
ETable(TableModel dm)
Constructs a
JTable that is initialized with
dm as the data model, a default column model,
and a default selection model. |
ETable(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. |
ETable(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. |
ETable(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 |
|---|---|
protected boolean |
acceptByQuickFilter(TableModel model,
int row)
Determines whether the given row should be displayed or not.
|
protected void |
configureEnclosingScrollPane()
Overridden to install special button into the upper right hand corner.
|
int |
convertRowIndexToModel(int row)
Helper method converting the row index according to the active sorting
columns.
|
int |
convertRowIndexToView(int row)
Helper method converting the row index according to the active sorting
columns.
|
String |
convertValueToString(Object value)
Used when copying into clipboard.
|
protected TableColumn |
createColumn(int modelIndex)
Allow to plug own TableColumn implementation.
|
protected TableColumnModel |
createDefaultColumnModel()
Overriden to use ETableColumnModel as TableColumnModel.
|
void |
createDefaultColumnsFromModel()
Overridden to use ETableColumns instead of the original TableColumns.
|
protected ListSelectionModel |
createDefaultSelectionModel() |
protected JTableHeader |
createDefaultTableHeader() |
void |
displaySearchField()
Shows the search field.
|
void |
doLayout()
Overridden to place the search text field.
|
boolean |
editCellAt(int row,
int column,
EventObject e)
Overridden to force requesting the focus after the user starts editing.
|
String |
getColumnDisplayName(String columnName)
Allows subclasses to localize the column headers.
|
ETable.ColumnSelection |
getColumnSelectionOn(int mouseButton)
Get the column selection method, that is displayed as a response to the
mouse event.
|
TableColumnSelector |
getColumnSelector()
Allows to supply alternative implementation of the column
selection functionality in ETable.
|
static TableColumnSelector |
getDefaultColumnSelector()
Default column selector is used when columnSelector is null.
|
int |
getQuickFilterColumn()
Get the column which is currently filtered by "quick-filter" object.
|
JMenuItem |
getQuickFilterCompareItem(int column,
Object value,
String columnName,
String text,
boolean greater,
boolean equalsCounts)
Creates the menu item for setting the quick filter that filters
the objects using Comparable interface.
|
JMenuItem |
getQuickFilterEqualsItem(int column,
Object value,
String columnName,
String text,
boolean equals)
Creates the menu item for setting the quick filter that filters
the objects using equality (or non-equality).
|
String[] |
getQuickFilterFormatStrings()
Returns the quickFilterFormatStrings array.
|
JMenuItem |
getQuickFilterNoFilterItem(String label)
Creates the menu item for resetting the quick filter (to no filter).
|
Object |
getQuickFilterObject()
Get the "quick-filter" object that is currently active.
|
JMenuItem |
getQuickFilterPopup(int column,
Object value,
String label)
Creates a menu item usable in a popup that will trigger
QuickFilter functionality for given column and value of the
cell it was invoked on (returned from
transformValue(getValueAt(column, row))).
|
int |
getRowCount()
If the quick-filter is applied the number of rows do not
match the number of rows in the model.
|
RowSorter<? extends TableModel> |
getRowSorter()
Get the RowSorter in case that the ETable does not have ETableColumnModel set.
|
String |
getToolTipText(MouseEvent event)
Overriden to make a speed optimization.
|
String |
getTransferDelimiter(boolean line)
Returns string used to delimit entries when
copying into clipboard.
|
Object |
getValueAt(int row,
int column)
Overriden to call convertRowIndexToModel(...).
|
protected void |
initializeLocalVars()
Overridden to do additional initialization.
|
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at
row and column
is editable. |
boolean |
isColumnHidingAllowed()
Test if the column hiding is allowed.
|
boolean |
isFullyEditable()
Returns true if
ETable is fully editable. |
boolean |
isFullyNonEditable()
Returns true if
ETable is fully non-editable. |
boolean |
isPopupUsedFromTheCorner()
The column selection corner can use either dialog or popup menu.
|
protected boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
Overriden to implement CTRL-+ for resizing of all columns,
CTRL-- for clearing the quick filter and CTRL-* for invoking the
column selection dialog.
|
void |
readSettings(Properties p,
String propertyPrefix)
Method allowing to read stored values.
|
void |
removeEditor()
Overridden to track whether the remove request is in progress.
|
void |
setAutoCreateRowSorter(boolean autoCreateRowSorter) |
void |
setCellBackground(Component renderer,
boolean isSelected,
int row,
int column)
Sets the table cell background colors accodring to NET UI guidelines.
|
void |
setColumnHidingAllowed(boolean allowColumnHiding)
Turn column hiding on/off
|
void |
setColumnSelectionOn(int mouseButton,
ETable.ColumnSelection selection)
Set if popup with column selection menu or column selection dialog
should be displayed as a response to the mouse event.
|
void |
setColumnSelector(TableColumnSelector columnSelector)
Allows to supply alternative implementation of the column
selection functionality in ETable.
|
void |
setColumnSorted(int columnIndex,
boolean ascending,
int rank)
Make the column sorted.
|
static void |
setDefaultColumnSelector(TableColumnSelector aDefaultColumnSelector)
Allows to supply the default column selector for all instances
of ETable.
|
void |
setFullyEditable(boolean fullyEditable)
Sets all the cells in the
ETable to be editable if
fullyEditable is true. |
void |
setFullyNonEditable(boolean fullyNonEditable)
Sets all the cells in the
ETable to be non-editable if
fullyNonEditable is true. |
void |
setModel(TableModel dataModel)
Overriden to update the header listeners and also to adjust the
preferred width of the collumns.
|
void |
setPopupUsedFromTheCorner(boolean popupUsedFromTheCorner)
The column selection corner can use either dialog or popup menu.
This method is equivalent to setColumnSelectionOn(int, org.netbeans.swing.etable.ETable.ColumnSelection)
with arguments 1 and appropriate column selection constant. |
void |
setQuickFilter(int column,
Object filterObject)
Makes the table disply only the rows that match the given "quick-filter".
|
void |
setQuickFilterFormatStrings(String[] newFormats)
Replaces the quickFilterFormatStrings by the given array.
|
void |
setRowSorter(RowSorter<? extends TableModel> sorter)
When ETable has ETableColumnModel set, only
null sorter
is accepted, which turns off sorting. |
void |
setSelectVisibleColumnsLabel(String localizedLabel)
Allows customization of the text appearing in the column
customization dialog.
|
void |
setValueAt(Object aValue,
int row,
int column)
Overriden to call convertRowIndexToModel(...).
|
void |
showColumnSelectionDialog()
Shows dialog that allows to show/hide columns.
|
protected void |
sortAndFilter()
Sorts the rows of the table.
|
void |
tableChanged(TableModelEvent e)
If the table data model is changed we reset (and then recompute)
the sorting permutation and the row count.
|
Object |
transformValue(Object value)
Allows subclasses to transform the value (usually obtained by calling
getValueAt(...)) to another object that is used for
sorting, comparison via quick filters etc.
|
void |
unsetQuickFilter()
Makes the table show all the rows, resetting the filter state
(to no filter).
|
void |
writeSettings(Properties p,
String propertyPrefix)
Method allowing to store customization values.
|
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createScrollPaneForTable, 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, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, unconfigureEnclosingScrollPane, updateUI, valueChangedaddAncestorListener, 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, 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, updateadd, 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, validateTreeaction, 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, transferFocusBackward, transferFocusUpCyclepublic static final String PROP_QUICK_FILTER
setQuickFilter(int, java.lang.Object) or
unsetQuickFilter().protected transient int[] sortingPermutation
protected transient int[] inverseSortingPermutation
public ETable()
JTable that is initialized with a default
data model, a default column model, and a default selection
model.public ETable(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 tablecreateDefaultColumnModel(),
createDefaultSelectionModel()public ETable(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 tablecreateDefaultSelectionModel()public ETable(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.
If any of the parameters are null this method
will initialize the table with the corresponding default model.
The autoCreateColumnsFromModel flag is set to false
if cm is non-null, otherwise it is set to true
and the column model is populated with suitable
TableColumns for the columns in dm.dm - the data model for the tablecm - the column model for the tablesm - the row selection model for the tableJTable.createDefaultDataModel(),
createDefaultColumnModel(),
createDefaultSelectionModel()public ETable(int numRows,
int numColumns)
JTable with numRows
and numColumns of empty cells using
DefaultTableModel. The columns will have
names of the form "A", "B", "C", etc.numRows - the number of rows the table holdsnumColumns - the number of columns the table holdsDefaultTableModelpublic ETable(Vector rowData, Vector columnNames)
JTable to display the values in the
Vector of Vectors, rowData,
with column names, columnNames. The
Vectors contained in rowData
should contain the values for that row. In other words,
the value of the cell at row 1, column 5 can be obtained
with the following code:
((Vector)rowData.elementAt(1)).elementAt(5);
rowData - the data for the new tablecolumnNames - names of each columnpublic ETable(Object[][] rowData, Object[] columnNames)
JTable to display the values in the two dimensional array,
rowData, with column names, columnNames.
rowData is an array of rows, so the value of the cell at row 1,
column 5 can be obtained with the following code:
rowData[1][5];
All rows must be of the same length as columnNames.
rowData - the data for the new tablecolumnNames - names of each columnprotected ListSelectionModel createDefaultSelectionModel()
createDefaultSelectionModel in class JTablepublic boolean isCellEditable(int row,
int column)
row and column
is editable. Otherwise, invoking setValueAt on the cell
will have no effect.
Returns true always if the ETable is fully editable.
Returns false always if the ETable is fully non-editable.
isCellEditable in class JTablerow - the row whose value is to be queriedcolumn - the column whose value is to be queriedsetValueAt(java.lang.Object, int, int),
setFullyEditable(boolean),
setFullyNonEditable(boolean)public void setFullyEditable(boolean fullyEditable)
ETable to be editable if
fullyEditable is true.
if fullyEditable is false, sets the table cells into
their default state as in JTable.fullyEditable - true if the table is meant to be fully editable.
false if the table is meant to take the defalut
state for editing.isFullyEditable()public void setFullyNonEditable(boolean fullyNonEditable)
ETable to be non-editable if
fullyNonEditable is true.
If fullyNonEditable is false, sets the table cells into
their default state as in JTable.fullyNonEditable - true if the table is meant to be fully non-editable.
false if the table is meant to take the defalut
state for editing.isFullyNonEditable()public boolean isFullyEditable()
ETable is fully editable.setFullyEditable(boolean)public boolean isFullyNonEditable()
ETable is fully non-editable.setFullyNonEditable(boolean)public void setCellBackground(Component renderer, boolean isSelected, int row, int column)
This is needed in case where the user does not use the NET Look and Feel, but still wants to paint the cell background colors accoring to NET L&F.
This needs to be called also in case where the user has custom table cell
renderer (that is not a DefaultTableCellRenderer or a
sub-class of it) for a cell even though NET L&F package is used, if the
cell background colors need to be consistent for the custom renderer.
renderer - the custom cell renderer to be paintedisSelected - true if the custom cell is selectedrow - the row, the custom cell corresponds tocolumn - the column, the custom cell corresponds topublic void createDefaultColumnsFromModel()
createDefaultColumnsFromModel in class JTableJTable.createDefaultColumnModel()public String getTransferDelimiter(boolean line)
public String convertValueToString(Object value)
null
and value.toString() otherwise. The method
transformValue(value) is called prior
to the string conversion.protected TableColumn createColumn(int modelIndex)
protected TableColumnModel createDefaultColumnModel()
createDefaultColumnModel in class JTableJTable.createDefaultColumnModel()public Object getValueAt(int row, int column)
getValueAt in class JTableJTable.getValueAt(int, int)public void setValueAt(Object aValue, int row, int column)
setValueAt in class JTableJTable.setValueAt(Object, int, int)public int getRowCount()
getRowCount in class JTablepublic void setQuickFilter(int column,
Object filterObject)
accept(Object)
of the QuickFilter is called to determine whether the
row will be shownpublic Object getQuickFilterObject()
nullsetQuickFilter(int, java.lang.Object)public int getQuickFilterColumn()
-1setQuickFilter(int, java.lang.Object)public void unsetQuickFilter()
public void setModel(TableModel dataModel)
setModel in class JTableJTable.setModel(TableModel)public String getToolTipText(MouseEvent event)
getToolTipText in class JTablepublic boolean isColumnHidingAllowed()
public void setColumnHidingAllowed(boolean allowColumnHiding)
allowColumnHiding - false to turn column hiding offprotected void initializeLocalVars()
initializeLocalVars in class JTableJTable.initializeLocalVars()protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
processKeyBinding in class JTableJTable.processKeyBinding(KeyStroke, KeyEvent, int, boolean)public void setColumnSorted(int columnIndex,
boolean ascending,
int rank)
columnIndex - column in ETable column modelascending - true means ascendingrank - value 1 means that this is the most important sorted
column, number 2 means second etc. Value 0 means that this column
is not sorted.protected void configureEnclosingScrollPane()
configureEnclosingScrollPane in class JTableJTable.configureEnclosingScrollPane()public void tableChanged(TableModelEvent e)
tableChanged in interface TableModelListenertableChanged in class JTableprotected JTableHeader createDefaultTableHeader()
createDefaultTableHeader in class JTablepublic int convertRowIndexToModel(int row)
convertRowIndexToModel in class JTablepublic int convertRowIndexToView(int row)
convertRowIndexToView in class JTablepublic void setSelectVisibleColumnsLabel(String localizedLabel)
public void setQuickFilterFormatStrings(String[] newFormats)
public String[] getQuickFilterFormatStrings()
public String getColumnDisplayName(String columnName)
public Object transformValue(Object value)
public JMenuItem getQuickFilterPopup(int column, Object value, String label)
Note: do not forget to call transformValue before passing the value to this method otherwise the quickfilters will not work.
The label should be localized version of the string the user will see in the popup menu, e.g. "Filter Column".
public JMenuItem getQuickFilterEqualsItem(int column, Object value, String columnName, String text, boolean equals)
public JMenuItem getQuickFilterNoFilterItem(String label)
public JMenuItem getQuickFilterCompareItem(int column, Object value, String columnName, String text, boolean greater, boolean equalsCounts)
protected void sortAndFilter()
protected boolean acceptByQuickFilter(TableModel model, int row)
public void readSettings(Properties p, String propertyPrefix)
public void writeSettings(Properties p, String propertyPrefix)
public void displaySearchField()
public void doLayout()
doLayout in class JTableJTable.doLayout()public boolean editCellAt(int row,
int column,
EventObject e)
editCellAt in class JTableJTable.editCellAt(int, int, EventObject)public void removeEditor()
removeEditor in class JTableJTable.removeEditor()public TableColumnSelector getColumnSelector()
public void setColumnSelector(TableColumnSelector columnSelector)
public boolean isPopupUsedFromTheCorner()
true, when left mouse click invokes a popup menu,
or false, when left mouse click opens a dialog for column selection.public void setPopupUsedFromTheCorner(boolean popupUsedFromTheCorner)
setColumnSelectionOn(int, org.netbeans.swing.etable.ETable.ColumnSelection)
with arguments 1 and appropriate column selection constant.popupUsedFromTheCorner - When true, left mouse click invokes a popup menu,
when false, left mouse click opens a dialog for column selection.public ETable.ColumnSelection getColumnSelectionOn(int mouseButton)
isPopupUsedFromTheCorner()mouseButton - The button of the mouse eventpublic void setColumnSelectionOn(int mouseButton,
ETable.ColumnSelection selection)
mouseButton - The button of the mouse eventselection - The column selection method.public final void showColumnSelectionDialog()
public static TableColumnSelector getDefaultColumnSelector()
public static void setDefaultColumnSelector(TableColumnSelector aDefaultColumnSelector)
public void setAutoCreateRowSorter(boolean autoCreateRowSorter)
setAutoCreateRowSorter in class JTablepublic void setRowSorter(RowSorter<? extends TableModel> sorter)
null sorter
is accepted, which turns off sorting. Otherwise UnsupportedOperationException is thrown.
RowSorter can be used when a different TableColumnModel is set.setRowSorter in class JTablesorter - public RowSorter<? extends TableModel> getRowSorter()
getRowSorter in class JTableBuilt on June 18 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.