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 classa base class for wrapping an actionstatic enumindicating whether the editor needs a specific margin borderstatic interfacestatic classa menu filter for converting an action to another action which supports a selected rows.static classan action for selecting cells of a target column and all rowsstatic interfacean updater holder for renderer component: the component ofObjectTableColumnValue.ObjectTableCellRenderermay implement the interface.static interfacean updating target for renderer component: the component ofObjectTableColumnValue.ObjectTableCellRenderermay implement the interface.static classa handler for finishing editor by alt+enterstatic classa cell-editor withGuiSwingView.ValuePanestatic classa cell renderer withGuiSwingView.ValuePanestatic classa popup-menu builder returned byObjectTableColumnValue.ObjectTableCellRendererfor wrapping an original menu-builder (not intended for a table) withObjectTableModel.CollectionRowsAndCellsActionBuilder.static interfaceinterface for renderer and editor, in order to set up some properties like preferences and setting-windowsstatic classan action for wrapping another action.static classa wrapper class forTableTargetColumnActionstatic classan 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.PopupMenuBuilderSourceForHeader, ObjectTableColumn.TableMenuComposite, ObjectTableColumn.TableMenuCompositeShared, ObjectTableColumn.TableTargetColumnForObjectColumn -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GuiMappingContextprotected intprotected TableCellEditorprotected booleanprotected TableCellRendererprotected GuiSwingView.SpecifierManagerFields 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 TableCellEditorfromActionValue(Object value) getCellValue(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) getCellValueFromContext(int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) intgetSpecifier(int rowIndex, int columnIndex) static BorderbooleanisTaskRunnerUsedFor(Supplier<?> task) determines the task can be submitted to the task runnervoidloadSwingPreferences(GuiPreferences prefs, GuiSwingPrefsApplyOptions options) voidFuture<?> setCellValue(Object rowObject, int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) Future<?> setCellValueFromContext(int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) voidsetColumnViewUpdater(Consumer<ObjectTableColumn> updater) static <CompType> voidsetForComponents(Class<CompType> componentType, Consumer<CompType> setter, Object... views) voidvoidsetSettingsWindow(SettingsWindow settingWindow) at initialization of the root-pane, the method will be called for existing sub-panes.static voidsetTableColor(JTable table, JComponent component, boolean isSelected) static voidsetTableColor(JTable table, JComponent component, boolean isSelected, boolean hasFocus, int row, int column) voidshutdown()toActionValue(Object value) voidviewUpdateAsDynamic(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, getHeaderMenuItems, getMenuBuilderSource, getRowHeight, getTableColumn, getValueType, setCellBorder, setComparator, setRowHeight, setTableColumn, setValueType, withCellEditor, withCellRenderer, withComparator, withHeaderRenderer, withHeaderValue, withIdentifier, withMaxWidth, withMinWidth, withPreferredWidth, withResizable, withRowHeight, withTableColumn, withValueTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.autogui.swing.table.GuiSwingTableColumn.ObjectTableColumnWithContext
asColumn, getInits, 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:
getSpecifierManagerin interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
setSettingsWindow
Description copied from interface:GuiSwingView.SettingsWindowClientat 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:
setSettingsWindowin interfaceGuiSwingView.SettingsWindowClient- Parameters:
settingWindow- a settings-window from the root-pane, which will be disposed at closing of the main window
-
getSettingsWindow
- Specified by:
getSettingsWindowin interfaceGuiSwingView.SettingsWindowClient- Returns:
- null
-
setPreferencesUpdater
- Specified by:
setPreferencesUpdaterin interfaceGuiSwingPrefsSupports.PreferencesUpdateSupport
-
loadSwingPreferences
- Specified by:
loadSwingPreferencesin interfaceGuiSwingTableColumn.ObjectTableColumnWithContext- Parameters:
prefs- the source preferencesoptions- processor
-
saveSwingPreferences
- Specified by:
saveSwingPreferencesin interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
shutdown
public void shutdown()- Overrides:
shutdownin classObjectTableColumn
-
setColumnViewUpdater
- Overrides:
setColumnViewUpdaterin classObjectTableColumn
-
viewUpdateAsDynamic
- Overrides:
viewUpdateAsDynamicin classObjectTableColumn
-
getContext
- Specified by:
getContextin interfaceGuiSwingTableColumn.ObjectTableColumnWithContext
-
getContextIndex
public int getContextIndex() -
getSpecifier
- Overrides:
getSpecifierin classObjectTableColumn
-
getHeaderMenuItemsInfo
- Overrides:
getHeaderMenuItemsInfoin classObjectTableColumn- Returns:
- the label info string: the default value is string of
TableColumn.getHeaderValue()
-
getCellValue
public Object getCellValue(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) - Overrides:
getCellValuein 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:
setCellValuein 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:
getCellValueFromContextin classObjectTableColumn
-
setCellValueFromContext
public Future<?> setCellValueFromContext(int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) - Overrides:
setCellValueFromContextin classObjectTableColumn
-
toActionValue
- Overrides:
toActionValuein classObjectTableColumn- Parameters:
value- an element value obtained fromGuiReprCollectionTable.TableTarget- Returns:
- a value which an action can accept
-
fromActionValue
- Overrides:
fromActionValuein classObjectTableColumn- Parameters:
value- an element value- Returns:
- a value supplied to a setter of
GuiReprCollectionTable.TableTarget
-
isTaskRunnerUsedFor
Description copied from class:ObjectTableColumndetermines the task can be submitted to the task runner- Overrides:
isTaskRunnerUsedForin 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:
getCompositesForRowsin classObjectTableColumn
-
getCompositesForCells
- Overrides:
getCompositesForCellsin classObjectTableColumn
-