Module org.controlsfx.controls
Class ColumnFixAction
- java.lang.Object
-
- org.controlsfx.control.action.Action
-
- org.controlsfx.control.tableview2.actions.ColumnFixAction
-
- All Implemented Interfaces:
EventListener
,EventHandler<ActionEvent>
public class ColumnFixAction extends Action
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);
-
-
Constructor Summary
Constructors Constructor Description ColumnFixAction(TableColumn column)
Creates a fix action for a given column.ColumnFixAction(TableColumn column, String name)
Creates a fix action for a given column.ColumnFixAction(TableColumn column, String name, Node image)
Creates a fix action for a given column.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toString()
-
Methods inherited from class org.controlsfx.control.action.Action
acceleratorProperty, disabledProperty, getAccelerator, getEventHandler, getGraphic, getLongText, getProperties, getStyle, getStyleClass, getText, graphicProperty, handle, isDisabled, isSelected, lock, longTextProperty, selectedProperty, setAccelerator, setDisabled, setEventHandler, setGraphic, setLongText, setSelected, setStyle, setText, styleProperty, textProperty
-
-
-
-
Constructor Detail
-
ColumnFixAction
public ColumnFixAction(TableColumn 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 theContextMenu
of the column.- Parameters:
column
- The TableColumn to which the action is applied to
-
ColumnFixAction
public ColumnFixAction(TableColumn 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 theContextMenu
of the column.- Parameters:
column
- The TableColumn to which the action is applied toname
- the string to display in the text property of controls such asMenuItem
.
-
ColumnFixAction
public ColumnFixAction(TableColumn 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 theContextMenu
of the column.- Parameters:
column
- The TableColumn to which the action is applied toname
- the string to display in the text property of controls such asMenuItem
.image
- the node to display in the graphic property of controls such asCheckMenuItem
.
-
-