@BeanSettings(useXdevCustomizer=true) public class XdevTable extends JTable implements ExtendedTable<XdevTable>, XdevFocusCycleComponent, VirtualTableEditor, Persistable, PopupRowSelectionHandler, Pageable, LazyLoadable
JTable
.JTable
,
Serialized FormJTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
MasterDetailComponent.DetailHandler
FormularComponent.ValueChangeListener
Modifier and Type | Field and Description |
---|---|
static String |
EVEN_BACKGROUND_PROPERTY |
static String |
ODD_BACKGROUND_PROPERTY |
static String |
PERSISTENT_COLUMN_SEPARATOR |
protected TableSupport<XdevTable> |
support |
static String |
VISIBLE_ROWS_PROPERTY |
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
EDITABLE_PROPERTY
DATA_FIELD_SEPARATOR
TAB_INDEX_PROPERTY
VALUE_SEPARATOR
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XdevTable()
Constructs a default
XdevTable that is initialized with a default
data model, a default column model, and a default selection model. |
XdevTable(Object[][] data,
Object[] columnNames)
Constructs a
XdevTable that is initialized with
DefaultTableModel as the data model, a default column model, and
a default selection model. |
XdevTable(TableModel model)
Constructs a
XdevTable that is initialized with
model as the data model, a default column model, and a
default selection model. |
XdevTable(Vector data,
Vector columnNames)
Constructs a
XdevTable that is initialized with
DefaultTableModel as the data model, a default column model, and
a default selection model. |
Modifier and Type | Method and Description |
---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index) |
void |
addListSelectionListener(ListSelectionListener listener)
Add a
ListSelectionListener to the list that's notified each time
a change to the selection occurs. |
void |
addValidator(Validator validator)
Adds a validator to this component
|
void |
addValueChangeListener(FormularComponent.ValueChangeListener l)
Registers a
FormularComponent.ValueChangeListener . |
void |
clear()
Clears any existing data before creating the new
DefaultTableModel . |
void |
clearModel()
Clears the underlying data model, mostly a
VirtualTable , and the
view. |
VirtualTable |
createSubsettedVirtualTable()
Creates a Virtual Table from the currently displayed values of this
supported table.
|
void |
ensureCellIsVisible(int rowIndex,
int columnIndex)
Scrolls to the desired cell.
|
void |
ensureColumnIsVisible(int columnIndex)
Scrolls to the desired column.
|
void |
ensureRowIsVisible(int rowIndex)
Scrolls to the desired row.
|
protected String |
exportCSV_getColumnName(TableColumn column) |
protected String |
exportCSV_getValue(Object value,
int row,
int col) |
void |
exportCSV(Writer writer)
|
void |
exportCSV(Writer writer,
char delimiter)
|
void |
exportCSV(Writer writer,
char delimiter,
boolean withColumnNames)
|
int |
getColumnAtPoint(int x,
int y)
Returns the index of the column that x- and y-coordinate lies in or -1 if
the result is not in the range [0,
JTable.getColumnCount() -1]. |
int |
getColumnAtPoint(Point location)
This method is a alias for
JTable.columnAtPoint(Point) . |
String |
getDataField()
Returns the name of the bound data field of this formular component.
|
Color |
getEvenBackground()
Returns the background
Color of even rows. |
Operator |
getFilterOperator()
Returns the operator used in
Formular.createCondition(String) |
String |
getFormularName()
Returns the name of the component in the formular context.
|
Object |
getFormularValue()
Returns the value of the component.
|
Color |
getOddBackground()
Returns the background
Color of odd rows. |
PageControl |
getPageControl() |
String |
getPersistentId()
Return a persistent id for this
Component . |
Dimension |
getPreferredScrollableViewportSize() |
int |
getRowAtPoint(int x,
int y)
Returns the view-index of the row that x- and y-coordinate lies in.
|
int |
getRowAtPoint(Point location)
Returns the view-index of the row that
Point lies in, or -1 if
the result is not in the range [0, JTable.getRowCount() -1]. |
boolean |
getScrollableTracksViewportHeight() |
int |
getSelectedModelRow()
Returns the index of the
TableModel for the first selected row or
-1 if no row is selected. |
int[] |
getSelectedModelRows()
Returns the indices of all selected rows in the
TableModel . |
VirtualTable.VirtualTableRow |
getSelectedVirtualTableRow()
Returns the selected
VirtualTable.VirtualTableRow of this component, or
null if nothing is selected. |
VirtualTable.VirtualTableRow[] |
getSelectedVirtualTableRows()
Returns the selected
VirtualTable.VirtualTableRow s of this component, or an
empty array if nothing is selected. |
int |
getSelectionMode()
Returns the current selection mode.
|
int |
getTabIndex()
Returns the tabindex assigned to this component.
|
Validator[] |
getValidators()
Returns all validators of this component.
|
VirtualTable |
getVirtualTable()
Returns the
VirtualTable that provides the data displayed by this
XdevTable . |
VirtualTableWrapper |
getVirtualTableWrapper()
Returns the virtual table wrapper of this component if present,
null otherwise. |
int |
getVisibleRowCount()
Returns the value of the
visibleRows property. |
void |
handlePopupRowSelection(int x,
int y)
Handles the row selection of and
PopupRowSelectionHandler . |
boolean |
hasStateChanged()
Checks if the component's state since the last call of
FormularComponent.saveState() has changed. |
boolean |
isCellEditable(int row,
int column) |
boolean |
isEditable()
Determines if the
ExtendedTable is editable. |
boolean |
isLazyLoadingEnabled() |
boolean |
isMultiSelect()
Returns whether the component supports multi selection or not.
|
boolean |
isPagingEnabled() |
boolean |
isPersistenceEnabled()
Flag, indicates, if the gui state for this component should be persisted.
|
boolean |
isReadOnly()
Determines whether this component is only used to display values.
|
boolean |
isSomethingSelected()
Return
true if something is selected, otherwise
false . |
void |
loadPersistentState(String persistentState)
Restores this
Components persistent state. |
void |
refresh()
Reloads the data from the underlying data source with the last executed
resp.
|
void |
removeListSelectionListener(ListSelectionListener listener)
Remove a listener from the
ListSelectionModel that's notified
each time a change to the selection occurs. |
void |
removeValidator(Validator validator)
Removes a validator from this component
|
void |
restoreState()
Restores the internally saved state of the component.
|
String |
savePersistentState()
Generates a
String representation of this Components
persistent state and returns it for being stored. |
void |
saveState()
Saves the state of the component internally.
|
void |
setColumnTitle(int index,
String title)
Sets the title of the desired column with the
index . |
void |
setColumnWidth(int index,
int width)
Sets the columns
preferredWidth and the columns
width . |
void |
setData(Object[][] data,
Object[] columnNames)
|
void |
setData(Vector data,
Vector columnNames)
|
void |
setDataField(String dataField)
Sets the name of the bound data field of this formular component.
|
void |
setDefaultEditor(TableCellEditor editor)
Clears all previous set editors and registers
editor as
default editor for Object.class , which makes it the default
editor as long as no other editor is set for a specific column class. |
void |
setDefaultRenderer(TableCellRenderer renderer)
Clears all previous set renderers and registers
renderer as
default renderer for Object.class , which makes it the
default renderer as long as no other renderer is set for a specific
column class. |
void |
setDetailHandler(MasterDetailComponent.DetailHandler detailHandler)
Sets the handler which controls the corporation of two
MasterDetailComponent s. |
void |
setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this
ExtendedTable should be editable. |
void |
setEvenBackground(Color evenBackground)
Sets the background
Color of even rows. |
void |
setFilterOperator(Operator filterOperator)
Sets the filter operator used in
Formular.createCondition(String) |
void |
setFormularValue(VirtualTable vt,
int col,
Object value)
Deprecated.
|
void |
setFormularValue(VirtualTable vt,
Map<String,Object> record)
Sets the value of the component, taking the value(s) of the record
according to
FormularComponent.getDataField() . |
void |
setLazyLoadingEnabled(boolean lazyLoadingEnabled)
Enabled or disables the lazy loading feature.
|
void |
setMasterValue(VirtualTable vt,
Map<String,Object> record)
Sets the value of this component (master), taking the value(s) of the
record.
|
void |
setModel(TableModel model) |
void |
setModel(VirtualTable vt)
Creates a new
TableModel based on a VirtualTable and
other specified parameters and sets it for this Table . |
void |
setModel(VirtualTable vt,
String columns,
boolean queryData)
Creates a new
TableModel based on a VirtualTable and
other specified parameters and sets it for this Table . |
void |
setModel(VirtualTable vt,
String columns,
boolean queryData,
boolean selectiveQuery)
Creates a new
TableModel based on a VirtualTable and
other specified parameters and sets it for this Table . |
void |
setModel(VirtualTable vt,
String columns,
SELECT select,
Object... params)
Creates a new
TableModel based on a VirtualTable and
other specified parameters and sets it for this Table . |
void |
setOddBackground(Color oddBackground)
Sets the background
Color of odd rows. |
void |
setPagingEnabled(boolean b)
Turns the paging behavior on or off.
|
void |
setPersistenceEnabled(boolean persistenceEnabled)
Sets the persistenceEnabled flag.
|
void |
setReadOnly(boolean readOnly)
Sets if this form component is only used to display values.
|
void |
setSelectedModelRow(int row)
Selects the row
row in the view. |
void |
setSelectedModelRows(int[] rows)
Selects all rows with the indices specified in the list.
|
void |
setSelectedModelRows(int start,
int end)
Changes the selection to be between
start and
end inclusive. |
void |
setSelectedRows(int[] indices)
Changes the selection to be the set of indices specified by the given
array.
|
void |
setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row)
Selects the row in the table if present.
|
void |
setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows)
Selects the rows in the table if present.
|
void |
setTabIndex(int tabIndex)
Sets the tabindex of this component.
|
void |
setVirtualTable(VirtualTable vt)
Sets the
VirtualTable containing the valid values for this
component. |
void |
setVisibleRowCount(int visibleRows)
Sets the
visibleRows property, which has different meanings
depending on the layout orientation: For a VERTICAL layout
orientation, this sets the preferred number of rows to display without
requiring scrolling; for other orientations, it affects the wrapping of
cells. |
String |
toString() |
void |
updateModel(Condition condition,
Object... params)
Reloads the data form the underlying data source.
|
void |
validateState()
Calls
Validator.validate(Object) of all registered
Validator s. |
void |
validateState(Validation validation)
Calls
Validator.validate(Object) of all registered
Validator s. |
boolean |
verify()
Returns whether the component's value adheres all set constraints.
|
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, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClientProperty, isEnabled, isVisible, putClientProperty
public static final String VISIBLE_ROWS_PROPERTY
public static final String EVEN_BACKGROUND_PROPERTY
public static final String ODD_BACKGROUND_PROPERTY
public static final String PERSISTENT_COLUMN_SEPARATOR
protected final TableSupport<XdevTable> support
public XdevTable()
XdevTable
that is initialized with a default
data model, a default column model, and a default selection model.JTable
public XdevTable(Object[][] data, Object[] columnNames)
XdevTable
that is initialized with
DefaultTableModel
as the data model, a default column model, and
a default selection model. Object[][]
array is the row index and
the second is the column index.data
- the data of the tablecolumnNames
- the names of the columnsJTable
public XdevTable(Vector data, Vector columnNames)
XdevTable
that is initialized with
DefaultTableModel
as the data model, a default column model, and
a default selection model. data
- the data of the table, a Vector
of
Vector
s of Object
valuescolumnNames
- vector
containing the names of the new columnspublic XdevTable(TableModel model)
XdevTable
that is initialized with
model
as the data model, a default column model, and a
default selection model.model
- the data model for the tableJTable
public void setData(Object[][] data, Object[] columnNames)
data
- the data of the table. NOTE: The first index in the
Object[][] array is the row index and the second is the column
index.columnNames
- the names of the columnspublic void setData(Vector data, Vector columnNames)
data
- the data of the table, a Vector
of
Vector
s of Object
valuescolumnNames
- vector
containing the names of the new columnspublic void addListSelectionListener(ListSelectionListener listener)
ListSelectionListener
to the list that's notified each time
a change to the selection occurs.listener
- the ListSelectionListenerremoveListSelectionListener(ListSelectionListener)
public void removeListSelectionListener(ListSelectionListener listener)
ListSelectionModel
that's notified
each time a change to the selection occurs.listener
- the ListSelectionListener
addListSelectionListener(ListSelectionListener)
public void setModel(VirtualTable vt)
TableModel
based on a VirtualTable
and
other specified parameters and sets it for this Table
.
The TableModel
contains all columns and all rows of the specified
vt
setModel
in interface ExtendedTable<XdevTable>
vt
- the VirtualTable
containing the data for the
TableModel
public void setModel(VirtualTable vt, String columns, boolean queryData)
TableModel
based on a VirtualTable
and
other specified parameters and sets it for this Table
.setModel
in interface ExtendedTable<XdevTable>
vt
- the VirtualTable
containing the data for the
TableModel
columns
- a comma separated list of valid column names for the param
vt
, may be "*" for all columnsqueryData
- if true
, the best fitting select for this vt
is usedpublic void setModel(VirtualTable vt, String columns, boolean queryData, boolean selectiveQuery)
TableModel
based on a VirtualTable
and
other specified parameters and sets it for this Table
.setModel
in interface ExtendedTable<XdevTable>
vt
- the VirtualTable
containing the data for the
TableModel
columns
- a comma separated list of valid column names for the param
vt
, may be "*" for all columnsqueryData
- if true
, the best fitting select for this vt
is usedselectiveQuery
- if true
, only the display columns
are
queriedpublic void setModel(VirtualTable vt, String columns, SELECT select, Object... params)
TableModel
based on a VirtualTable
and
other specified parameters and sets it for this Table
.setModel
in interface ExtendedTable<XdevTable>
vt
- the VirtualTable
containing the data for the
TableModel
columns
- a comma separated list of valid column names for the param
vt
, may be "*" for all columnsselect
- a custom SELECT
for filtering or ordering the results
of the vt
, may be null for the default selectparams
- a set of parameters related to the param select
, may
be nullpublic void setPagingEnabled(boolean b)
setPagingEnabled
in interface Pageable
b
- true
if the paging should be controlled via the
Pageable.getPageControl()
Pageable.isPagingEnabled()
public boolean isPagingEnabled()
isPagingEnabled
in interface Pageable
true
if the paging behavior is on,
false
otherwisePageable.setPagingEnabled(boolean)
public PageControl getPageControl()
getPageControl
in interface Pageable
public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)
If lazy loading is enabled only the displayed rows are loaded.
setLazyLoadingEnabled
in interface LazyLoadable
public boolean isLazyLoadingEnabled()
isLazyLoadingEnabled
in interface LazyLoadable
public void refresh()
refresh
in interface MasterDetailComponent<XdevTable>
public void updateModel(Condition condition, Object... params)
The last executed query is extended with condition
.
updateModel
in interface VirtualTableOwner
condition
- The additional filter for the queryparams
- param objects used in condition
public void clearModel()
VirtualTable
, and the
view.clearModel
in interface MasterDetailComponent<XdevTable>
public void setVisibleRowCount(int visibleRows)
visibleRows
property, which has different meanings
depending on the layout orientation: For a VERTICAL
layout
orientation, this sets the preferred number of rows to display without
requiring scrolling; for other orientations, it affects the wrapping of
cells.setVisibleRowCount
in interface ExtendedTable<XdevTable>
visibleRows
- an integer specifying the preferred number of rows to display
without requiring scrollingExtendedTable.getVisibleRowCount()
,
JComponent.getVisibleRect()
,
JViewport
public int getVisibleRowCount()
visibleRows
property. See the
documentation for ExtendedTable.setVisibleRowCount(int)
for details on how to
interpret this value.getVisibleRowCount
in interface ExtendedTable<XdevTable>
visibleRows
property.ExtendedTable.setVisibleRowCount(int)
public void setEvenBackground(Color evenBackground)
Color
of even rows.setEvenBackground
in interface ExtendedTable<XdevTable>
evenBackground
- The background of even rows as type Color
.public Color getEvenBackground()
Color
of even rows.getEvenBackground
in interface ExtendedTable<XdevTable>
Color
.public void setOddBackground(Color oddBackground)
Color
of odd rows.setOddBackground
in interface ExtendedTable<XdevTable>
oddBackground
- The background of odd rows as type Color
.public Color getOddBackground()
Color
of odd rows.getOddBackground
in interface ExtendedTable<XdevTable>
Color
.public int getTabIndex()
getTabIndex
in interface XdevFocusCycleComponent
public void setTabIndex(int tabIndex)
To exclude this component from the focus cycle set tabindex to -1.
setTabIndex
in interface XdevFocusCycleComponent
tabIndex
- to be setpublic void exportCSV(Writer writer) throws IOException
XdevTable
as CSV information to a specified
Writer
.
This is an alias for ExtendedTable.exportCSV(Writer, char)
.
exportCSV
in interface ExtendedTable<XdevTable>
writer
- the Writer
to write CSV information toIOException
- if CSV file couldn't be writtenpublic void exportCSV(Writer writer, char delimiter) throws IOException
XdevTable
as CSV information to a specified
Writer
.
This is an alias for ExtendedTable.exportCSV(Writer, char, boolean)
.
exportCSV
in interface ExtendedTable<XdevTable>
writer
- the Writer
to write CSV information todelimiter
- the delimiter to use for separating entries.IOException
- if CSV file couldn't be writtenpublic void exportCSV(Writer writer, char delimiter, boolean withColumnNames) throws IOException
exportCSV
in interface ExtendedTable<XdevTable>
writer
- the Writer
to write CSV information todelimiter
- the delimiter to use for separating entries.withColumnNames
- a flag to control whether the columns are writtenIOException
- if CSV file couldn't be writtenprotected String exportCSV_getColumnName(TableColumn column)
public String getFormularName()
getFormularName
in interface FormularComponent<XdevTable>
public void setDataField(String dataField)
setDataField
in interface FormularComponent<XdevTable>
dataField
- the new bound data fieldpublic String getDataField()
getDataField
in interface FormularComponent<XdevTable>
@Deprecated public final void setFormularValue(VirtualTable vt, int col, Object value)
value
. The value is formatted using the column format of the
provided VirtualTable
and columnIndex
.setFormularValue
in interface FormularComponent<XdevTable>
vt
- VirtualTable
to use the format fromcol
- of the column to use the format fromvalue
- value to setpublic void setFormularValue(VirtualTable vt, Map<String,Object> record)
FormularComponent.getDataField()
.setFormularValue
in interface FormularComponent<XdevTable>
vt
- the underlying virtual tablerecord
- the data <column,value>public void setMasterValue(VirtualTable vt, Map<String,Object> record)
Called by the MasterDetailHandler
if the client's value has
changed.
setMasterValue
in interface MasterDetailComponent<XdevTable>
vt
- the underlying virtual tablerecord
- the data <column,value>public Object getFormularValue()
getFormularValue
in interface FormularComponent<XdevTable>
public void saveState()
A saved state can be restored using FormularComponent.restoreState()
.
saveState
in interface FormularComponent<XdevTable>
public void restoreState()
The state of the component can be saved using FormularComponent.saveState()
.
restoreState
in interface FormularComponent<XdevTable>
public boolean hasStateChanged()
FormularComponent.saveState()
has changed.hasStateChanged
in interface FormularComponent<XdevTable>
true
if the component's state has changed,
false
otherwisepublic boolean isMultiSelect()
A component that supports multi selection can have more than one selected item / value.
isMultiSelect
in interface FormularComponent<XdevTable>
true
if the component supports multi
selection, false
otherwise.public boolean verify()
This is a alternative method for FormularComponent.validateState()
, but this
method returns a boolean depending on the validation's result and doesn't
throw an ValidationException
.
verify
in interface FormularComponent<XdevTable>
true
if the value of the component adheres all set
constraints; otherwise false
.public void addValidator(Validator validator)
addValidator
in interface FormularComponent<XdevTable>
validator
- the validator to addFormularComponent.validateState()
public void removeValidator(Validator validator)
removeValidator
in interface FormularComponent<XdevTable>
validator
- the validator to removeFormularComponent.validateState()
public Validator[] getValidators()
If no validator is present an empty array is returned.
getValidators
in interface FormularComponent<XdevTable>
public void validateState() throws ValidationException
Validator.validate(Object)
of all registered
Validator
s.validateState
in interface FormularComponent<XdevTable>
ValidationException
FormularComponent.verify()
public void validateState(Validation validation) throws ValidationException
Validator.validate(Object)
of all registered
Validator
s.
Every ValidationException
is recorded in the
validation
object, and if
Validation.continueValidation(ValidationException)
returns
false
this exception is re-thrown by this method.
validateState
in interface FormularComponent<XdevTable>
validation
- the validation process objectValidationException
FormularComponent.verify()
public void setFilterOperator(Operator filterOperator)
Formular.createCondition(String)
setFilterOperator
in interface FormularComponent<XdevTable>
filterOperator
- the new filter operatorpublic Operator getFilterOperator()
Formular.createCondition(String)
getFilterOperator
in interface FormularComponent<XdevTable>
public void setReadOnly(boolean readOnly)
setReadOnly
in interface FormularComponent<XdevTable>
readOnly
- true
to only display valuespublic boolean isReadOnly()
isReadOnly
in interface FormularComponent<XdevTable>
true
if this component is only used to display
values.public void setVirtualTable(VirtualTable vt)
VirtualTable
containing the valid values for this
component.setVirtualTable
in interface VirtualTableOwner
public VirtualTable getVirtualTable()
VirtualTable
that provides the data displayed by this
XdevTable
.getVirtualTable
in interface VirtualTableOwner
VirtualTable
that provides the data of this
XdevTable
.TableModel
is not a VirtualTableWrapper
null
is returned.public VirtualTableWrapper getVirtualTableWrapper()
null
otherwise.getVirtualTableWrapper
in interface VirtualTableEditor
null
public void addValueChangeListener(FormularComponent.ValueChangeListener l)
FormularComponent.ValueChangeListener
.addValueChangeListener
in interface FormularComponent<XdevTable>
l
- the listener to registerpublic void setDetailHandler(MasterDetailComponent.DetailHandler detailHandler)
MasterDetailComponent
s.setDetailHandler
in interface MasterDetailComponent<XdevTable>
detailHandler
- the new MasterDetailComponent.DetailHandler
public void clear()
DefaultTableModel
.clear
in interface ExtendedTable<XdevTable>
public boolean isEditable()
ExtendedTable
is editable. Returns
true
if the ExtendedTable
is editable or
false
if not.isEditable
in interface ExtendedTable<XdevTable>
true
if the ExtendedTable
is editable or
false
if not.public void setEditable(boolean editable)
ExtendedTable
should be editable. A PropertyChange event
("EDITABLE_PROPERTY") is fired when the state is changed.setEditable
in interface ExtendedTable<XdevTable>
editable
- the boolean to be setpublic boolean isCellEditable(int row, int column)
isCellEditable
in class JTable
public void setModel(TableModel model)
public void setDefaultRenderer(TableCellRenderer renderer)
renderer
as
default renderer for Object.class
, which makes it the
default renderer as long as no other renderer is set for a specific
column class.setDefaultRenderer
in interface ExtendedTable<XdevTable>
renderer
- the new default rendererJTable.setDefaultRenderer(Class, TableCellRenderer)
,
TableColumn.setCellRenderer(TableCellRenderer)
public void setDefaultEditor(TableCellEditor editor)
editor
as
default editor for Object.class
, which makes it the default
editor as long as no other editor is set for a specific column class.setDefaultEditor
in interface ExtendedTable<XdevTable>
editor
- the new default editorJTable.setDefaultEditor(Class, TableCellEditor)
,
TableColumn.setCellEditor(TableCellEditor)
public boolean isSomethingSelected()
true
if something is selected, otherwise
false
.isSomethingSelected
in interface ExtendedTable<XdevTable>
true
if something is selected, otherwise
false
public int getSelectedModelRow() throws IndexOutOfBoundsException
TableModel
for the first selected row or
-1 if no row is selected.getSelectedModelRow
in interface ExtendedTable<XdevTable>
TableModel
IndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
JTable.convertRowIndexToModel(int)
,
JTable.getSelectedRow()
public int[] getSelectedModelRows() throws IndexOutOfBoundsException
TableModel
.getSelectedModelRows
in interface ExtendedTable<XdevTable>
IndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
JTable.convertRowIndexToModel(int)
,
JTable.getSelectedRows()
public VirtualTable.VirtualTableRow getSelectedVirtualTableRow()
VirtualTable.VirtualTableRow
of this component, or
null
if nothing is selected.getSelectedVirtualTableRow
in interface MasterDetailComponent<XdevTable>
getSelectedVirtualTableRow
in interface ExtendedTable<XdevTable>
VirtualTable.VirtualTableRow
of this componentpublic void setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row)
setSelectedVirtualTableRow
in interface ExtendedTable<XdevTable>
row
- the row to selectpublic VirtualTable.VirtualTableRow[] getSelectedVirtualTableRows()
VirtualTable.VirtualTableRow
s of this component, or an
empty array if nothing is selected.getSelectedVirtualTableRows
in interface ExtendedTable<XdevTable>
VirtualTable.VirtualTableRow
s of this componentpublic void setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows)
setSelectedVirtualTableRows
in interface ExtendedTable<XdevTable>
rows
- the rows to selectpublic void setSelectedModelRow(int row) throws IndexOutOfBoundsException, IllegalArgumentException
row
in the view. If the row
<
0, all columns and rows are deselected.setSelectedModelRow
in interface ExtendedTable<XdevTable>
row
- the index of the row in terms of the modelIndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
IllegalArgumentException
- if row
lie outside [0,
JTable.getRowCount()
-1]JTable.convertRowIndexToView(int)
,
JTable.addRowSelectionInterval(int, int)
,
JTable.clearSelection()
public void setSelectedModelRows(int[] rows) throws IndexOutOfBoundsException, IllegalArgumentException
rows
are null
all columns and rows are
deselected.setSelectedModelRows
in interface ExtendedTable<XdevTable>
rows
- an list of integers containing the row indicesIndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
IllegalArgumentException
- if row
lie outside [0,
JTable.getRowCount()
-1]JTable.convertRowIndexToView(int)
,
JTable.addRowSelectionInterval(int, int)
,
JTable.clearSelection()
,
ExtendedTable.setSelectedModelRows(int[])
public void setSelectedModelRows(int start, int end)
start
and
end
inclusive. start
doesn't have to be less
than or equal to end
.
In SINGLE_SELECTION
selection mode, only the second index is
used.
If this represents a change to the current selection, then each
ListSelectionListener
is notified of the change.
setSelectedModelRows
in interface ExtendedTable<XdevTable>
start
- one end of the interval.end
- other end of the intervalpublic void setSelectedRows(int[] indices)
addSelectionInterval
on the selection model to add the indices.
Refer to the documentation of the selection model class being used for
details on how values less than 0
are handled.setSelectedRows
in interface ExtendedTable<XdevTable>
indices
- an array of the indices of the rows to select,
non-null
public int getRowAtPoint(int x, int y) throws IndexOutOfBoundsException
getRowAtPoint
in interface ExtendedTable<XdevTable>
x
- the x coordinate of the rowy
- the y coordinate of the rowIndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
ExtendedTable.getRowAtPoint(Point)
public int getRowAtPoint(Point location) throws IndexOutOfBoundsException
Point
lies in, or -1 if
the result is not in the range [0, JTable.getRowCount()
-1].getRowAtPoint
in interface ExtendedTable<XdevTable>
location
- the Point
of the rowIndexOutOfBoundsException
- if sorting is enabled and passed an index outside the range
of the JTable
as determined by the method
JTable.getRowCount()
ExtendedTable.getRowAtPoint(int, int)
public int getColumnAtPoint(int x, int y)
JTable.getColumnCount()
-1].getColumnAtPoint
in interface ExtendedTable<XdevTable>
x
- the x coordinate of the columny
- the y coordinate of the columnJTable.getColumnCount()
-1]ExtendedTable.getColumnAtPoint(Point)
public int getColumnAtPoint(Point location)
JTable.columnAtPoint(Point)
.getColumnAtPoint
in interface ExtendedTable<XdevTable>
location
- of interestlocation
lies in or -1
if the result is not in the range [0,
JTable.getColumnCount()
-1]ExtendedTable.getColumnAtPoint(int, int)
public void setColumnWidth(int index, int width)
preferredWidth
and the columns
width
.setColumnWidth
in interface ExtendedTable<XdevTable>
index
- the index of the desired columnwidth
- the value for the column widthTableColumn.setPreferredWidth(int)
,
TableColumn.setWidth(int)
public void setColumnTitle(int index, String title)
index
.setColumnTitle
in interface ExtendedTable<XdevTable>
index
- the index of the desired columntitle
- the value for the column titleTableColumn.setHeaderValue(Object)
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
getScrollableTracksViewportHeight
in class JTable
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
getPreferredScrollableViewportSize
in class JTable
public void loadPersistentState(String persistentState)
Components
persistent state.
By calling this method, the passed state information get interpreted and applied on the affected attributes.
loadPersistentState
in interface Persistable
persistentState
- String
representation for the persistent state of the
Component
.savePersistentState()
public String savePersistentState()
String
representation of this Components
persistent state and returns it for being stored.
Persisted properties:
savePersistentState
in interface Persistable
String
containing persistent statepublic String getPersistentId()
Component
.
The following requirements have to be met for the persistent id:
getPersistentId
in interface Persistable
public boolean isPersistenceEnabled()
isPersistenceEnabled
in interface Persistable
true
if a instance of type Persistable
is to be
persisted.public void setPersistenceEnabled(boolean persistenceEnabled)
persistenceEnabled
- the state for this instancepublic void ensureCellIsVisible(int rowIndex, int columnIndex)
Note: Works only if the table is contained in a
JScrollPane
.
ensureCellIsVisible
in interface ExtendedTable<XdevTable>
rowIndex
- index of row to scroll tocolumnIndex
- index of the column to scroll topublic void ensureRowIsVisible(int rowIndex)
Note: Works only if the table is contained in a
JScrollPane
.
ensureRowIsVisible
in interface ExtendedTable<XdevTable>
rowIndex
- index of row to scroll topublic void ensureColumnIsVisible(int columnIndex)
Note: Works only if the table is contained in a
JScrollPane
.
ensureColumnIsVisible
in interface ExtendedTable<XdevTable>
columnIndex
- index of the column to scroll topublic VirtualTable createSubsettedVirtualTable()
The generated Virtual Table has the same order of columns and rows as currently displayed in the view.
The supported table must have a referenced VirtualTable
VirtualTableModel
for this method to work)
VirtualTable
representing the currently displayed
results of the tableIllegalStateException
- if the supported table is not based on a VirtualTableModel or
if a new VirtualTable could not be created.public int getSelectionMode()
JTable.setSelectionMode(int)
public void handlePopupRowSelection(int x, int y)
PopupRowSelectionHandler
.handlePopupRowSelection
in interface PopupRowSelectionHandler
x
- the x-coordinate where the popup action is invoked.y
- the y-coordinate where the popup action is invoked.Copyright © 2003–2020 XDEV Software. All rights reserved.