java.lang.Object
org.controlsfx.control.action.Action
org.controlsfx.control.tableview2.actions.ColumnFixAction
All Implemented Interfaces:
EventListener, javafx.event.EventHandler<javafx.event.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);
 
See Also:
  • Constructor Details

    • ColumnFixAction

      public ColumnFixAction(javafx.scene.control.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 the ContextMenu of the column.
      Parameters:
      column - The TableColumn to which the action is applied to
    • ColumnFixAction

      public ColumnFixAction(javafx.scene.control.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 the ContextMenu of the column.
      Parameters:
      column - The TableColumn to which the action is applied to
      name - the string to display in the text property of controls such as MenuItem.
    • ColumnFixAction

      public ColumnFixAction(javafx.scene.control.TableColumn column, String name, javafx.scene.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 ContextMenu of the column.
      Parameters:
      column - The TableColumn to which the action is applied to
      name - the string to display in the text property of controls such as MenuItem.
      image - the node to display in the graphic property of controls such as CheckMenuItem.
  • Method Details