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 classa renderer for index numbersstatic classa column class for specifying operations with lambdas.static classa top-column displaying a row-index numberstatic interfacea menu-builder holderstatic interfacea static menu-factory for the column header view; as the default, the cell-renderer and the cell-editor that implements it is usedstatic interfacemenu items which the column can processstatic interfacea shared key for a menu compositestatic classsupporting value conversion like Path to File -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator<?> protected intprotected TableColumnprotected 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<?> getHeaderMenuItems(JTable table) Note: the actions added by the builder will only work with single (last) value of the renderer, set byGuiSwingView.ValuePane.setSwingViewValue(Object).intgetSpecifier(int rowIndex, int columnIndex) Class<?> booleanisTaskRunnerUsedFor(Supplier<?> task) determines the task can be submitted to the task runnerstatic voidsetCellBorder(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) voidsetColumnViewUpdater(Consumer<ObjectTableColumn> updater) voidsetComparator(Comparator<?> comparator) voidsetRowHeight(int rowHeight) voidsetTableColumn(TableColumn tableColumn) voidsetValueType(Class<?> valueType) voidshutdown()toActionValue(Object value) voidviewUpdateAsDynamic(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.PopupMenuBuilderSourceitself.
-
getHeaderMenuItems
- Returns:
- list of static menu-items for the column header: compound list of both the renderer and the editor
- Since:
- 1.8
-
getHeaderMenuItemsInfo
- Returns:
- the label info string: the default value is string of
TableColumn.getHeaderValue() - Since:
- 1.8
-
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)
-