- java.lang.Object
-
- org.controlsfx.control.action.Action
-
- org.controlsfx.control.tableview2.actions.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 aCheckMenuItem
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))));
-
-
Constructor Summary
Constructors Constructor Description RowFixAction(TableView2 tableView, Integer row)
Creates a fix action for a given column.RowFixAction(TableView2 tableView, Integer row, String name)
Creates a fix action for a given column.RowFixAction(TableView2 tableView, Integer row, 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
-
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 theContextMenu
of the column.- Parameters:
tableView
- The TableView2 to which the action is applied torow
- 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 theContextMenu
of the column.- Parameters:
tableView
- The TableView2 to which the action is applied torow
- The number of rowname
- the string to display in the text property of controls such asMenuItem
.
-
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 theContextMenu
of the column.- Parameters:
tableView
- The TableView2 to which the action is applied torow
- The number of rowname
- 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
.
-
-