Package com.dua3.utility.fx.controls
Class TableViewOptions
java.lang.Object
com.dua3.utility.fx.controls.TableViewOptions
Represents configuration options for a table view. This class allows the
specification and retrieval of various behaviors associated with the
table view by using predefined options.
- READ_ONLY: Makes the table view read-only, preventing any editing of its content.
- DRAGGABLE_ROWS: Enables row reordering within the table view through drag-and-drop.
of method by specifying the desired options.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefines the set of configurable options for a table view. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TableViewOptions.OptionAllow deleting rows.static final TableViewOptions.OptionMake the TableView editable.static final TableViewOptions.OptionAllow selecting multiple rows at once.static final TableViewOptions.OptionAllow dragging columns for reordering.static final TableViewOptions.OptionAllow dragging rows for reordering.static final TableViewOptions.OptionMake the TableView sortable by clicking on a column header. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> TableViewOptions.OptionALLOW_INSERTING_ROWS(Supplier<S> itemFactory) Allow inserting rows.booleaninthashCode()booleanisEnabled(TableViewOptions.Option option) Checks if the specified option is enabled for this table view configuration.booleanChecks if the specified option is enabled for this table view configuration.static TableViewOptionsof(TableViewOptions.Option... options) Creates an instance of TableViewOptions by combining the specified options.with(TableViewOptions.Option... options) Creates a newTableViewOptionsinstance by combining the current options with the specified additional options.without(TableViewOptions.Option... options) Creates a newTableViewOptionsinstance by disabling the specified options in the current configuration.
-
Field Details
-
EDITABLE
Make the TableView editable. -
SORTABLE
Make the TableView sortable by clicking on a column header. -
REORDERABLE_COLUMNS
Allow dragging columns for reordering. -
REORDERABLE_ROWS
Allow dragging rows for reordering. -
MULTIPLE_ROWS_SELECTABLE
Allow selecting multiple rows at once. -
ALLOW_DELETING_ROWS
Allow deleting rows.
-
-
Method Details
-
ALLOW_INSERTING_ROWS
Allow inserting rows.Note: The unconventional method name is intentional to match the other options that are simple constants.
- Type Parameters:
S- the generic item type- Parameters:
itemFactory- the item factory used to create new rows- Returns:
- the option to pass
-
of
Creates an instance of TableViewOptions by combining the specified options. Each option is represented by a bitmask, and the resulting object encapsulates the bitwise combination of the options provided.- Parameters:
options- an array ofOptionenums specifying the desired table view behaviors. If no options are provided, the resulting TableViewOptions will have no behaviors enabled.- Returns:
- a new
TableViewOptionsinstance configured with the specified options.
-
isEnabled
Checks if the specified option is enabled for this table view configuration. Each option is evaluated based on the internal bitmask representation.- Parameters:
option- theOptionto check; must not be null- Returns:
trueif the specified option is enabled,falseotherwise
-
isEnabled
Checks if the specified option is enabled for this table view configuration.- Parameters:
option- the name of the option to check- Returns:
trueif the specified option is enabled, otherwisefalse
-
with
Creates a newTableViewOptionsinstance by combining the current options with the specified additional options.- Parameters:
options- an array ofOptionenums specifying additional table view configurations to be combined with the current state.- Returns:
- a new
TableViewOptionsinstance that combines the current options with the specified additional options.
-
without
Creates a newTableViewOptionsinstance by disabling the specified options in the current configuration.- Parameters:
options- an array ofOptionenums to be disabled.- Returns:
- a new
TableViewOptionsinstance with the specified options disabled.
-
equals
-
hashCode
public int hashCode()
-