Class RowFixAction

  • All Implemented Interfaces:
    EventListener, EventHandler<ActionEvent>

    public class RowFixAction
    extends Action
    A custom action that can be added to the ContextMenu of any row in the row header, allowing the user to fix or unfix the row. This action has to be bound to a CheckMenuItem node.

    Sample

    The following code snippet provides a ContextMenu that contains the fix action for each row in the row header:

     
     TableView2<Person> table = new TableView2<Person>();
     table.setRowHeaderVisible(true);
     table.setRowHeaderContextMenuFactory((i, person) -> 
         ActionUtils.createContextMenu(Arrays.asList(new RowFixAction(this, i))));
     
    See Also:
    ActionUtils.createContextMenu(java.util.Collection)
    • Constructor Detail

      • RowFixAction

        public RowFixAction​(TableView2 tableView,
                            Integer row)
        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:
        tableView - The TableView2 to which the action is applied to
        row - The number of row
      • RowFixAction

        public RowFixAction​(TableView2 tableView,
                            Integer row,
                            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:
        tableView - The TableView2 to which the action is applied to
        row - The number of row
        name - the string to display in the text property of controls such as MenuItem.
      • RowFixAction

        public RowFixAction​(TableView2 tableView,
                            Integer row,
                            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 ContextMenu of the column.
        Parameters:
        tableView - The TableView2 to which the action is applied to
        row - The number of row
        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.