T
- type tablepublic class TableSupport<T extends JTable & MasterDetailComponent<T>> extends FormularComponentSupport<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoLock |
protected long |
autoRenewLockTime |
protected List<JComponent> |
countdownMonitorComponentList |
protected MasterDetailComponent.DetailHandler |
detailHandler |
protected boolean |
lazyLoadingEnabled |
protected LazyLoadingTableModel<T> |
lazyLoadingTableModel |
protected long |
lockingTime |
protected XdevWindow |
lockInUseDialog |
protected String |
modelColumns |
protected JComponent |
monitorCountdown |
protected boolean |
pagingEnabled |
protected long |
renewDialogTime |
protected int[] |
savedValue |
protected boolean |
showDialog |
component, dataField, filterOperator, readOnly, validators
Modifier | Constructor and Description |
---|---|
protected |
TableSupport(T table) |
Modifier and Type | Method and Description |
---|---|
void |
addValueChangeListener(FormularComponent.ValueChangeListener l) |
void |
adjustColumnWidths()
Sets the column width of each column to its preferred size.
|
void |
clearModel() |
RowSorter |
createRowSorter(TableModel model) |
static SELECT |
createSelect(VirtualTable vt,
boolean selectiveQuery,
String... columns) |
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) . |
Object |
getFormularValue() |
protected KeyValues |
getKeyValues(VirtualTable formularVT,
VirtualTable tableVT,
Map<String,Object> values) |
protected LazyLoadingTableModel<T> |
getLazyLoadingTableModel() |
TablePageControl<T> |
getPageControl() |
int |
getRowAtPoint(int x,
int y)
Returns the index of the row that x- and y-coordinate lies in.
|
int |
getRowAtPoint(Point location) |
RowSelectionHandler |
getRowSelectionHandler() |
int |
getSelectedModelRow() |
int[] |
getSelectedModelRows() |
VirtualTable.VirtualTableRow |
getSelectedVirtualTableRow() |
VirtualTable.VirtualTableRow[] |
getSelectedVirtualTableRows() |
static TableColumnConverter |
getTableColumnConverter()
Returns the set
TableColumnConverter to differ model data from
view data. |
static TableModelWrapperLookup |
getTableModelWrapperLookup() |
static TableRowConverter |
getTableRowConverter()
Returns the set
TableRowConverter to differ model data from view
data. |
VirtualTable |
getVirtualTable() |
VirtualTableWrapper |
getVirtualTableWrapper()
Returns the underlying model which is a
VirtualTableWrapper , or
null . |
protected List<String> |
getVisibleColumnNames() |
boolean |
hasStateChanged() |
boolean |
isLazyLoadingEnabled() |
boolean |
isMultiSelect() |
boolean |
isPagingEnabled() |
boolean |
isSomethingSelected()
Return
true if something is selected, otherwise
false . |
void |
refresh() |
void |
restoreState() |
void |
saveState() |
protected void |
selectFormularValue(VirtualTable formularVT,
VirtualTable tableVT,
Map<String,Object> values) |
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 |
setDetailHandler(MasterDetailComponent.DetailHandler detailHandler) |
void |
setFormularValue(VirtualTable vt,
Map<String,Object> record) |
void |
setLazyLoadingEnabled(boolean lazyLoadingEnabled) |
void |
setModel(VirtualTable vt)
Sets the model for the supported table based on a
VirtualTable . |
void |
setModel(VirtualTable vt,
String columns,
boolean queryData)
Sets the model for the supported table based on a
VirtualTable
and additional configuration. |
void |
setModel(VirtualTable vt,
String columns,
boolean queryData,
boolean selectiveQuery)
Sets the model for the supported table based on a
VirtualTable
and additional configuration. |
void |
setModel(VirtualTable vt,
String columns,
SELECT select,
Object... params)
Sets the model for the supported table based on a
VirtualTable
and additional configuration. |
void |
setPagingEnabled(boolean pagingEnabled) |
void |
setRowSelectionHandler(RowSelectionHandler rowSelectionHandler) |
void |
setSelectedModelRow(int row) |
void |
setSelectedModelRows(int[] rows) |
void |
setSelectedModelRows(int start,
int end) |
void |
setSelectedRows(int[] indices) |
void |
setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row) |
void |
setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows) |
static void |
setTableColumnConverter(TableColumnConverter tableColumnConverter)
Sets a
TableRowConverter to differ model data from view data. |
static void |
setTableModelWrapperLookup(TableModelWrapperLookup tableModelWrapperLookup) |
static void |
setTableRowConverter(TableRowConverter tableRowConverter)
Sets a
TableRowConverter to differ model data from view data. |
void |
setValue(VirtualTable vt,
Map<String,Object> value) |
void |
updateModel(Condition condition,
Object... params) |
addValidator, getColumnName, getDataField, getDataFields, getFilterOperator, getFirstDataField, getFormattedFormularValue, getFormularName, getSingleValue, getValidators, getValuesForDataFields, hasDataField, isReadOnly, removeValidator, setDataField, setFilterOperator, setFormularValue, setReadOnly, validateState, validateState, verify
protected int[] savedValue
protected MasterDetailComponent.DetailHandler detailHandler
protected String modelColumns
protected boolean pagingEnabled
protected boolean lazyLoadingEnabled
protected LazyLoadingTableModel<T extends JTable & MasterDetailComponent<T>> lazyLoadingTableModel
protected boolean autoLock
protected XdevWindow lockInUseDialog
protected long autoRenewLockTime
protected long renewDialogTime
protected long lockingTime
protected boolean showDialog
protected JComponent monitorCountdown
protected List<JComponent> countdownMonitorComponentList
protected TableSupport(T table)
public void setRowSelectionHandler(RowSelectionHandler rowSelectionHandler)
public RowSelectionHandler getRowSelectionHandler()
public static void setTableRowConverter(TableRowConverter tableRowConverter)
TableRowConverter
to differ model data from view data.public static TableRowConverter getTableRowConverter()
TableRowConverter
to differ model data from view
data. Or if no TableRowConverter
was set it returns
TableRowConverter
default implementation.
* @return the set TableRowConverter
or its default
implementation.public static void setTableColumnConverter(TableColumnConverter tableColumnConverter)
TableRowConverter
to differ model data from view data.public static TableColumnConverter getTableColumnConverter()
TableColumnConverter
to differ model data from
view data. Or if no TableColumnConverter
was set it returns
TableColumnConverter
default implementation.TableColumnConverter
or its default
implementation.public static void setTableModelWrapperLookup(TableModelWrapperLookup tableModelWrapperLookup)
public static TableModelWrapperLookup getTableModelWrapperLookup()
public void setModel(VirtualTable vt)
VirtualTable
.vt
- a VirtualTable
.public void setModel(VirtualTable vt, String columns, boolean queryData)
VirtualTable
and additional configuration.vt
- a VirtualTable
.columns
- a comma separated list of column names.queryData
- if set to true
the vt
will be queried with the
default select for the vt
.public void setModel(VirtualTable vt, String columns, boolean queryData, boolean selectiveQuery)
VirtualTable
and additional configuration.vt
- a VirtualTable
.columns
- a comma separated list of column names.queryData
- if set to true
the vt
will be queried with the
default select for the vt
.selectiveQuery
- if true
, only the display columns
are
queriedpublic static SELECT createSelect(VirtualTable vt, boolean selectiveQuery, String... columns)
public void setModel(VirtualTable vt, String columns, SELECT select, Object... params)
VirtualTable
and additional configuration.vt
- a VirtualTable
.columns
- a comma separated list of column names.select
- a custom SELECT
used to query the VirtualTable
.params
- a number of parameters for the custom selectpublic void setPagingEnabled(boolean pagingEnabled)
public boolean isPagingEnabled()
public TablePageControl<T> getPageControl()
public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)
public boolean isLazyLoadingEnabled()
protected LazyLoadingTableModel<T> getLazyLoadingTableModel()
public RowSorter createRowSorter(TableModel model)
public void adjustColumnWidths()
public VirtualTable getVirtualTable()
VirtualTableOwner.getVirtualTable()
public final VirtualTableWrapper getVirtualTableWrapper()
VirtualTableWrapper
, or
null
.VirtualTableWrapper
modelpublic int getRowAtPoint(Point location) throws IndexOutOfBoundsException
IndexOutOfBoundsException
ExtendedTable.getRowAtPoint(Point)
public final int getSelectedModelRow() throws IndexOutOfBoundsException
IndexOutOfBoundsException
ExtendedTable.getSelectedModelRow()
public final int[] getSelectedModelRows() throws IndexOutOfBoundsException
IndexOutOfBoundsException
ExtendedTable.getSelectedModelRows()
public void setSelectedRows(int[] indices)
ExtendedTable.setSelectedRows(int[])
public final void setSelectedModelRow(int row) throws IndexOutOfBoundsException, IllegalArgumentException
public final void setSelectedModelRows(int[] rows) throws IndexOutOfBoundsException, IllegalArgumentException
public final void setSelectedModelRows(int start, int end)
public boolean isMultiSelect()
FormularComponent.isMultiSelect()
public void setFormularValue(VirtualTable vt, Map<String,Object> record)
public void setValue(VirtualTable vt, Map<String,Object> value)
protected void selectFormularValue(VirtualTable formularVT, VirtualTable tableVT, Map<String,Object> values)
protected KeyValues getKeyValues(VirtualTable formularVT, VirtualTable tableVT, Map<String,Object> values) throws MasterDetailException, VirtualTableException
public Object getFormularValue()
FormularComponent.getFormularValue()
public void saveState()
FormularComponent.saveState()
public void restoreState()
FormularComponent.restoreState()
public boolean hasStateChanged()
FormularComponent.hasStateChanged()
public VirtualTable.VirtualTableRow getSelectedVirtualTableRow()
public void setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row)
ExtendedTable#setSelectedVirtualTableRow(VirtualTableRow)
public VirtualTable.VirtualTableRow[] getSelectedVirtualTableRows()
public void setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows)
ExtendedTable#setSelectedVirtualTableRows(VirtualTableRow[])
public void refresh()
MasterDetailComponent.refresh()
public void clearModel()
MasterDetailComponent.clearModel()
public void addValueChangeListener(FormularComponent.ValueChangeListener l)
public void setDetailHandler(MasterDetailComponent.DetailHandler detailHandler)
public void exportCSV(Writer writer) throws IOException
XdevTable
as CSV information to a specified
Writer
.
This is an alias for exportCSV(Writer, char)
.
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 exportCSV(Writer, char, boolean)
.
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
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 boolean isSomethingSelected()
true
if something is selected, otherwise
false
.true
if something is selected, otherwise
false
public void setColumnWidth(int index, int width)
preferredWidth
and the columns
width
.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
.index
- the index of the desired columntitle
- the value for the column titleTableColumn.setHeaderValue(Object)
public int getRowAtPoint(int x, int y) throws IndexOutOfBoundsException
TableModel
.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()
getRowAtPoint(Point)
,
JTable.convertRowIndexToModel(int)
public int getColumnAtPoint(int x, int y)
JTable.getColumnCount()
-1].x
- the x coordinate of the columny
- the y coordinate of the columnJTable.getColumnCount()
-1]getColumnAtPoint(Point)
public int getColumnAtPoint(Point location)
JTable.columnAtPoint(Point)
.location
- of interestlocation
lies in or -1
if the result is not in the range [0,
JTable.getColumnCount()
-1]getColumnAtPoint(int, int)
public void ensureCellIsVisible(int rowIndex, int columnIndex)
Note: Works only if the table is contained in a
JScrollPane
.
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
.
rowIndex
- index of row to scroll topublic void ensureColumnIsVisible(int columnIndex)
Note: Works only if the table is contained in a
JScrollPane
.
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.Copyright © 2003–2021 XDEV Software. All rights reserved.