java.lang.Object
org.autogui.swing.table.ObjectTableColumn
- Direct Known Subclasses:
GuiSwingTableColumnCollection.ObjectTableColumnCollectionWrapper
,ObjectTableColumn.ObjectTableColumnLabel
,ObjectTableColumn.ObjectTableColumnRowIndex
,ObjectTableColumnValue
a table-column with additional info.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
a renderer for index numbersstatic class
a column class for specifying operations with lambdas.static class
a top-column displaying a row-index numberstatic interface
a menu-builder holderstatic interface
menu items which the column can processstatic interface
a shared key for a menu compositestatic class
supporting value conversion like Path to File -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator
<?> protected int
protected TableColumn
protected Class
<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]
columnIndexToValueIndex
(int columnIndex) static <O,
P> ObjectTableColumn.ObjectTableColumnLabel <O, P> createLabel
(String headerName, Function<O, P> getter) static <O,
P> ObjectTableColumn.ObjectTableColumnLabel <O, P> createLabel
(String headerName, Function<O, P> getter, BiConsumer<O, P> setter) fromActionValue
(Object value) getCellValue
(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) getCellValueFromContext
(int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) Comparator
<?> Note: the actions added by the builder will only work with single (last) value of the renderer, set byGuiSwingView.ValuePane.setSwingViewValue(Object)
.int
getSpecifier
(int rowIndex, int columnIndex) Class
<?> boolean
isTaskRunnerUsedFor
(Supplier<?> task) determines the task can be submitted to the task runnerstatic void
setCellBorder
(JTable table, JComponent cell, int row, int column) 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) void
setComparator
(Comparator<?> comparator) void
setRowHeight
(int rowHeight) void
setTableColumn
(TableColumn tableColumn) void
setValueType
(Class<?> valueType) void
shutdown()
toActionValue
(Object value) void
viewUpdateAsDynamic
(ObjectTableColumn source) withCellEditor
(TableCellEditor cellEditor) withCellRenderer
(TableCellRenderer cellRenderer) withComparator
(Comparator<?> comparator) withHeaderRenderer
(TableCellRenderer headerRenderer) withHeaderValue
(Object headerValue) withIdentifier
(Object identifier) withMaxWidth
(int maxWidth) withMinWidth
(int minWidth) withPreferredWidth
(int preferredWidth) withResizable
(boolean isResizable) withRowHeight
(int rowHeight) withTableColumn
(TableColumn column) withValueType
(Class<?> valueType)
-
Field Details
-
tableColumn
-
rowHeight
protected int rowHeight -
comparator
-
valueType
-
-
Constructor Details
-
ObjectTableColumn
public ObjectTableColumn()
-
-
Method Details
-
getTableColumn
-
setTableColumn
-
getRowHeight
public int getRowHeight() -
setRowHeight
public void setRowHeight(int rowHeight) -
getComparator
-
setComparator
-
shutdown
public void shutdown() -
getValueType
-
setValueType
-
setColumnViewUpdater
-
viewUpdateAsDynamic
-
getSpecifier
-
getCellValue
public Object getCellValue(Object rowObject, int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) - Parameters:
rowObject
- the row object at rowIndexrowIndex
- the row indexcolumnIndex
- the column indexspecifier
- specifier fromgetSpecifier(int, int)
- Returns:
- the value at columnIndex of rowObject.
it might be
Future
, and then the value will be specially treated as getting the value of the future as the cell value.
-
setCellValue
public Future<?> setCellValue(Object rowObject, int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) - Parameters:
rowObject
- the row object at rowIndexrowIndex
- the row indexcolumnIndex
- the column indexnewColumnValue
- the new value to be setspecifier
- specifier fromgetSpecifier(int, int)
- Returns:
- a future object for checking completion of the updating or null
-
getCellValueFromContext
public Object getCellValueFromContext(int rowIndex, int columnIndex, GuiReprValue.ObjectSpecifier specifier) -
setCellValueFromContext
public Future<?> setCellValueFromContext(int rowIndex, int columnIndex, Object newColumnValue, GuiReprValue.ObjectSpecifier specifier) -
columnIndexToValueIndex
public int[] columnIndexToValueIndex(int columnIndex) -
toActionValue
- Parameters:
value
- an element value obtained fromGuiReprCollectionTable.TableTarget
- Returns:
- a value which an action can accept
- Since:
- 1.1
-
fromActionValue
- Parameters:
value
- an element value- Returns:
- a value supplied to a setter of
GuiReprCollectionTable.TableTarget
- Since:
- 1.1
-
isTaskRunnerUsedFor
determines the task can be submitted to the task runner- Parameters:
task
- the task to be invoked- Returns:
- true if the task can be submitted to the task runner
- Since:
- 1.6
-
withValueType
-
withTableColumn
-
withRowHeight
-
withComparator
-
withIdentifier
-
withHeaderValue
-
withHeaderRenderer
-
withCellRenderer
-
withCellEditor
-
withPreferredWidth
-
withMinWidth
-
withMaxWidth
-
withResizable
-
getMenuBuilderSource
Note: the actions added by the builder will only work with single (last) value of the renderer, set byGuiSwingView.ValuePane.setSwingViewValue(Object)
. So when the action is invoked, it will need to iterate over the selected rows, set the target value and invoke the action for each row. After each action invoked, it might need to check the value.- Returns:
TableColumn.getCellRenderer()
if the renderer is anObjectTableColumn.PopupMenuBuilderSource
itself.
-
getCompositesForRows
-
getCompositesForCells
-
setCellBorder
-
createLabel
public static <O,P> ObjectTableColumn.ObjectTableColumnLabel<O,P> createLabel(String headerName, Function<O, P> getter) -
createLabel
public static <O,P> ObjectTableColumn.ObjectTableColumnLabel<O,P> createLabel(String headerName, Function<O, P> getter, BiConsumer<O, P> setter)
-