Top Description Fields Constructors Methods
org.controlsfx.control.tableview2.actions

public Class ColumnFixAction

extends Action
Class Inheritance
Annotations
@ActionCheck
Imports
javafx.beans.InvalidationListener, .Observable, javafx.scene.Node, javafx.scene.control.TableColumn, .TableView, org.controlsfx.control.action.Action, .ActionCheck, .ActionUtils, org.controlsfx.control.tableview2.TableView2

A custom action that can be added to the ContextMenu of a column header, allowing the user to fix or unfix the column. This action has to be bound to a CheckMenuItem node.

Sample

The following code snippet creates a column with a ContextMenu that contains the fix action for the column:

TableColumn2<Person,String> firstNameCol = new TableColumn2<>("First Name");
firstNameCol.setCellValueFactory(p -> p.getValue().firstNameProperty());
ContextMenu cm = ActionUtils.createContextMenu(Arrays.asList(new ColumnFixAction(firstNameColumn)));
firstNameColumn.setContextMenu(cm);
See Also
ActionUtils#createContextMenu(java.util.Collection)

Field Summary

Modifier and TypeField and Description
private InvalidationListener

Constructor Summary

AccessConstructor and Description
public
ColumnFixAction(TableColumn<S, T>
The TableColumn to which the action is applied to
column
)

Creates a fix action for a given column.

public
ColumnFixAction(TableColumn<S, T>
The TableColumn to which the action is applied to
column
,
String
the string to display in the text property of controls such as MenuItem.
name
)

Creates a fix action for a given column.

public
ColumnFixAction(TableColumn<S, T>
The TableColumn to which the action is applied to
column
,
String
the string to display in the text property of controls such as MenuItem.
name
,
Node
the node to display in the graphic property of controls such as CheckMenuItem.
image
)

Creates a fix action for a given column.

Method Summary

Modifier and TypeMethod and Description
private void
initialize(TableColumn<S, T> column, TableView2<S> tableView)

private boolean
isFixedColumn(TableColumn<S, T> column)

private void
reset(TableView2<S> tableView)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.controlsfx.control.action.Action:
acceleratorPropertydisabledPropertygetAcceleratorgetEventHandlergetGraphicgetLongTextgetPropertiesgetStylegetStyleClassgetTextgraphicPropertyhandleisDisabledisSelectedlocklongTextPropertyselectedPropertysetAcceleratorsetDisabledsetEventHandlersetGraphicsetLongTextsetSelectedsetStylesetTextstylePropertytextProperty

Field Detail

fixedColumnsListenerback to summary
private InvalidationListener fixedColumnsListener

Constructor Detail

ColumnFixActionback to summary
public ColumnFixAction(TableColumn<S, T> column)

Creates a fix action for a given column. When fired, the action will fix the column if is allowed and the column wasn't fixed yet, or unfix a fixed column. The action can be attached for instance to the javafx.scene.control.ContextMenu of the column.

Parameters
column:TableColumn<S, T>

The TableColumn to which the action is applied to

ColumnFixActionback to summary
public ColumnFixAction(TableColumn<S, T> column, String name)

Creates a fix action for a given column. When fired, the action will fix the column if is allowed and the column wasn't fixed yet, or unfix a fixed column. The action can be attached for instance to the javafx.scene.control.ContextMenu of the column.

Parameters
column:TableColumn<S, T>

The TableColumn to which the action is applied to

name:String

the string to display in the text property of controls such as MenuItem.

ColumnFixActionback to summary
public ColumnFixAction(TableColumn<S, T> column, String name, Node image)

Creates a fix action for a given column. When fired, the action will fix the column if is allowed and the column wasn't fixed yet, or unfix a fixed column. The action can be attached for instance to the javafx.scene.control.ContextMenu of the column.

Parameters
column:TableColumn<S, T>

The TableColumn to which the action is applied to

name:String

the string to display in the text property of controls such as MenuItem.

image:Node

the node to display in the graphic property of controls such as CheckMenuItem.

Method Detail

initializeback to summary
private void initialize(TableColumn<S, T> column, TableView2<S> tableView)
isFixedColumnback to summary
private boolean isFixedColumn(TableColumn<S, T> column)
resetback to summary
private void reset(TableView2<S> tableView)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override