java.lang.Object
org.autogui.swing.table.ObjectTableColumn
org.autogui.swing.table.ObjectTableColumnValue
- All Implemented Interfaces:
GuiSwingView.SettingsWindowClient
,GuiSwingPrefsSupports.PreferencesUpdateSupport
,GuiSwingTableColumn.ObjectTableColumnWithContext
public class ObjectTableColumnValue
extends ObjectTableColumn
implements GuiSwingTableColumn.ObjectTableColumnWithContext
a table-column with
GuiMappingContext
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
a base class for wrapping an actionstatic enum
indicating whether the editor needs a specific margin borderstatic interface
static class
a menu filter for converting an action to another action which supports a selected rows.static class
an action for selecting cells of a target column and all rowsstatic interface
an updater holder for renderer component: the component ofObjectTableColumnValue.ObjectTableCellRenderer
may implement the interface.static interface
an updating target for renderer component: the component ofObjectTableColumnValue.ObjectTableCellRenderer
may implement the interface.static class
a handler for finishing editor by alt+enterstatic class
a cell-editor withGuiSwingView.ValuePane
static class
a cell renderer withGuiSwingView.ValuePane
static class
a popup-menu builder returned byObjectTableColumnValue.ObjectTableCellRenderer
for wrapping an original menu-builder (not intended for a table) withObjectTableModel.CollectionRowsAndCellsActionBuilder
.static interface
interface for renderer and editor, in order to set up some properties like preferences and setting-windowsstatic class
an action for wrapping another action.static class
a wrapper class forTableTargetColumnAction
static class
an action for selected rows of a column with a lambdaNested classes/interfaces inherited from class org.autogui.swing.table.ObjectTableColumn
ObjectTableColumn.NumberRenderer, ObjectTableColumn.ObjectTableColumnLabel<ObjType,
PropType>, ObjectTableColumn.ObjectTableColumnRowIndex, ObjectTableColumn.PopupMenuBuilderSource, ObjectTableColumn.TableMenuComposite, ObjectTableColumn.TableMenuCompositeShared, ObjectTableColumn.TableTargetColumnForObjectColumn -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GuiMappingContext
protected int
protected TableCellEditor
protected boolean
protected TableCellRenderer
protected GuiSwingView.SpecifierManager
Fields inherited from class org.autogui.swing.table.ObjectTableColumn
comparator, rowHeight, tableColumn, valueType
-
Constructor Summary
ConstructorsConstructorDescriptionObjectTableColumnValue
(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, JComponent view) the representation of the context must be a subtype ofGuiReprValue
.ObjectTableColumnValue
(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, JComponent view, JComponent editorView) ObjectTableColumnValue
(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, TableCellRenderer renderer, TableCellEditor editor) -
Method Summary
Modifier and TypeMethodDescriptionprotected TableCellEditor
fromActionValue
(Object value) getCellValue
(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) getCellValueFromContext
(int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) int
getSpecifier
(int rowIndex, int columnIndex) static Border
boolean
isTaskRunnerUsedFor
(Supplier<?> task) determines the task can be submitted to the task runnervoid
loadSwingPreferences
(GuiPreferences prefs, GuiSwingPrefsApplyOptions options) void
Future
<?> setCellValue
(Object rowObject, int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) Future
<?> setCellValueFromContext
(int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) void
setColumnViewUpdater
(Consumer<ObjectTableColumn> updater) static <CompType> void
setForComponents
(Class<CompType> componentType, Consumer<CompType> setter, Object... views) void
void
setSettingsWindow
(SettingsWindow settingWindow) at initialization of the root-pane, the method will be called for existing sub-panes.static void
setTableColor
(JTable table, JComponent component, boolean isSelected) static void
setTableColor
(JTable table, JComponent component, boolean isSelected, boolean hasFocus, int row, int column) void
shutdown()
toActionValue
(Object value) void
viewUpdateAsDynamic
(ObjectTableColumn source) specify the margin border when the editor is aObjectTableColumnValue.ObjectTableCellEditor
.withEditorForColumnAlwaysApplying
(boolean alwaysApplying) if the parameter to be true, it updates the editor of tableColumnMethods inherited from class org.autogui.swing.table.ObjectTableColumn
columnIndexToValueIndex, createLabel, createLabel, getComparator, getMenuBuilderSource, getRowHeight, getTableColumn, getValueType, setCellBorder, setComparator, setRowHeight, setTableColumn, setValueType, withCellEditor, withCellRenderer, withComparator, withHeaderRenderer, withHeaderValue, withIdentifier, withMaxWidth, withMinWidth, withPreferredWidth, withResizable, withRowHeight, withTableColumn, withValueType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.autogui.swing.table.GuiSwingTableColumn.ObjectTableColumnWithContext
asColumn, loadSwingPreferences
-
Field Details
-
context
-
specifierIndex
-
specifierManager
-
contextIndex
protected int contextIndex -
renderer
-
editor
-
editorForColumnAlwaysApplying
protected boolean editorForColumnAlwaysApplying- Since:
- 1.6
-
-
Constructor Details
-
ObjectTableColumnValue
public ObjectTableColumnValue(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, JComponent view) the representation of the context must be a subtype ofGuiReprValue
. view must be aGuiSwingView.ValuePane
- Parameters:
context
- the associated contextspecifierIndex
- the optional index for row-index (nullable)specifierManager
- specifier factory for the column valueview
- the component for both editor and renderer
-
ObjectTableColumnValue
public ObjectTableColumnValue(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, JComponent view, JComponent editorView) -
ObjectTableColumnValue
public ObjectTableColumnValue(GuiMappingContext context, GuiSwingTableColumn.SpecifierManagerIndex specifierIndex, GuiSwingView.SpecifierManager specifierManager, TableCellRenderer renderer, TableCellEditor editor)
-
-
Method Details
-
withBorderType
specify the margin border when the editor is aObjectTableColumnValue.ObjectTableCellEditor
.- Parameters:
type
- the border type- Returns:
- this
- Since:
- 1.6
-
withEditorForColumnAlwaysApplying
if the parameter to be true, it updates the editor of tableColumn- Parameters:
alwaysApplying
- true foreditorForColumn()
always returningeditor
- Returns:
- this
- Since:
- 1.6
-
editorForColumn
-
getSpecifierManager
- Specified by:
getSpecifierManager
in interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
setSettingsWindow
Description copied from interface:GuiSwingView.SettingsWindowClient
at initialization of the root-pane, the method will be called for existing sub-panes. a dynamically created view needs to be manually set by those panes.- Specified by:
setSettingsWindow
in interfaceGuiSwingView.SettingsWindowClient
- Parameters:
settingWindow
- a settings-window from the root-pane, which will be disposed at closing of the main window
-
getSettingsWindow
- Specified by:
getSettingsWindow
in interfaceGuiSwingView.SettingsWindowClient
- Returns:
- null
-
setPreferencesUpdater
- Specified by:
setPreferencesUpdater
in interfaceGuiSwingPrefsSupports.PreferencesUpdateSupport
-
loadSwingPreferences
- Specified by:
loadSwingPreferences
in interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
- Parameters:
prefs
- the source preferencesoptions
- processor
-
saveSwingPreferences
- Specified by:
saveSwingPreferences
in interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
shutdown
public void shutdown()- Overrides:
shutdown
in classObjectTableColumn
-
setColumnViewUpdater
- Overrides:
setColumnViewUpdater
in classObjectTableColumn
-
viewUpdateAsDynamic
- Overrides:
viewUpdateAsDynamic
in classObjectTableColumn
-
getContext
- Specified by:
getContext
in interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
getContextIndex
public int getContextIndex() -
getSpecifier
- Overrides:
getSpecifier
in classObjectTableColumn
-
getCellValue
public Object getCellValue(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) - Overrides:
getCellValue
in classObjectTableColumn
- Parameters:
rowObject
- the row object at rowIndexrowIndex
- the row index in the listcolumnIndex
- the column index of the view table-model of the columnspecifier
- the specifier for the column value, can be obtained bygetSpecifier(int, int)
- Returns:
- the column value
-
setCellValue
public Future<?> setCellValue(Object rowObject, int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) - Overrides:
setCellValue
in classObjectTableColumn
- Parameters:
rowObject
- the row object at rowIndexrowIndex
- the row index in the listcolumnIndex
- the column index of the view table-model of the columnnewColumnValue
- the new value to be setspecifier
- the specifier for the column value, can be obtained bygetSpecifier(int, int)
- Returns:
- null
-
getCellValueFromContext
public Object getCellValueFromContext(int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) - Overrides:
getCellValueFromContext
in classObjectTableColumn
-
setCellValueFromContext
public Future<?> setCellValueFromContext(int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) - Overrides:
setCellValueFromContext
in classObjectTableColumn
-
toActionValue
- Overrides:
toActionValue
in classObjectTableColumn
- Parameters:
value
- an element value obtained fromGuiReprCollectionTable.TableTarget
- Returns:
- a value which an action can accept
-
fromActionValue
- Overrides:
fromActionValue
in classObjectTableColumn
- Parameters:
value
- an element value- Returns:
- a value supplied to a setter of
GuiReprCollectionTable.TableTarget
-
isTaskRunnerUsedFor
Description copied from class:ObjectTableColumn
determines the task can be submitted to the task runner- Overrides:
isTaskRunnerUsedFor
in classObjectTableColumn
- Parameters:
task
- the task to be invoked- Returns:
- true if the task can be submitted to the task runner
-
setForComponents
-
setTableColor
-
setTableColor
public static void setTableColor(JTable table, JComponent component, boolean isSelected, boolean hasFocus, int row, int column) - Parameters:
table
- the tablecomponent
- the cell componentisSelected
- the row is selected if truehasFocus
- the row is focused if truerow
- the row indexcolumn
- the column index- Since:
- 1.2
-
getTableFocusBorder
-
getCompositesForRows
- Overrides:
getCompositesForRows
in classObjectTableColumn
-
getCompositesForCells
- Overrides:
getCompositesForCells
in classObjectTableColumn
-