Class MenuItemProviders
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.ui.menu.MenuItemProviders
-
public final class MenuItemProviders extends Object
Helper class that provides severalIMenuItemProvider
for menu items that can be used within a popup menu in the NatTable to execute NatTable specific actions.
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAT_EVENT_DATA_KEY
Key that is used to put the NatEventData into the data of a menu.
-
Method Summary
-
-
-
Field Detail
-
NAT_EVENT_DATA_KEY
public static final String NAT_EVENT_DATA_KEY
Key that is used to put the NatEventData into the data of a menu.- See Also:
- Constant Field Values
-
-
Method Detail
-
getNatEventData
public static NatEventData getNatEventData(org.eclipse.swt.events.SelectionEvent selectionEvent)
Walk up the MenuItems (in case they are nested) and find the parentMenu
- Parameters:
selectionEvent
- on theMenuItem
- Returns:
- data associated with the parent
Menu
-
hideColumnMenuItemProvider
public static IMenuItemProvider hideColumnMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theColumnHideCommand
to a popup menu. This command is intended to hide the current selected column immediately.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theColumnHideCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
hideColumnMenuItemProvider
public static IMenuItemProvider hideColumnMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theColumnHideCommand
to a popup menu. This command is intended to hide the current selected column immediately.The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theColumnHideCommand
.
-
showAllColumnsMenuItemProvider
public static IMenuItemProvider showAllColumnsMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllColumnsCommand
to a popup menu. This command is intended to show all columns of the NatTable and is used to unhide previous hidden columns.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllColumnsCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
showAllColumnsMenuItemProvider
public static IMenuItemProvider showAllColumnsMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllColumnsCommand
to a popup menu. This command is intended to show all columns of the NatTable and is used to unhide previous hidden columns.The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllColumnsCommand
.
-
showAllColumnsMenuItemProvider
public static IMenuItemProvider showAllColumnsMenuItemProvider(String menuLabel, org.eclipse.swt.graphics.Image image)
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllColumnsCommand
to a popup menu. This command is intended to show all columns of the NatTable and is used to unhide previous hidden columns.The
MenuItem
will be shown with the given menu label and the given image.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
image
- The image that will be showed with the generatedMenuItem
. Can benull
to not showing an image.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllColumnsCommand
. - Since:
- 1.6
-
showColumnMenuItemProvider
public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll)
Will create and return theIMenuItemProvider
that adds the action for executing theColumnShowCommand
to a popup menu. This command is intended to show the column(s) at the clicked position of the NatTable and is used to unhide previous hidden columns.- Parameters:
showAll
- Whether all hidden adjacent columns should be shown again or only the single direct adjacent column.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theColumnShowCommand
. - Since:
- 1.6
-
showColumnMenuItemProvider
public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll, String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theColumnShowCommand
to a popup menu. This command is intended to show the column(s) at the clicked position of the NatTable and is used to unhide previous hidden columns.The
MenuItem
will be shown with the given menu label.- Parameters:
showAll
- Whether all hidden adjacent columns should be shown again or only the single direct adjacent column.menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theColumnShowCommand
. - Since:
- 1.6
-
showColumnMenuItemProvider
public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll, String menuLabel, org.eclipse.swt.graphics.Image image)
Will create and return theIMenuItemProvider
that adds the action for executing theColumnShowCommand
to a popup menu. This command is intended to show the column(s) at the clicked position of the NatTable and is used to unhide previous hidden columns.The
MenuItem
will be shown with the given menu label and the given image.- Parameters:
showAll
- Whether all hidden adjacent columns should be shown again or only the single direct adjacent column.menuLabel
- The text that will be showed for the generatedMenuItem
image
- The image that will be showed with the generatedMenuItem
. Can benull
to not showing an image.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theColumnShowCommand
. - Since:
- 1.6
-
hideRowMenuItemProvider
public static IMenuItemProvider hideRowMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theRowHideCommand
to a popup menu. This command is intended to hide the current selected row immediately.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowHideCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
hideRowMenuItemProvider
public static IMenuItemProvider hideRowMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theRowHideCommand
to a popup menu. This command is intended to hide the current selected row immediately.The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowHideCommand
.
-
hideRowPositionMenuItemProvider
public static IMenuItemProvider hideRowPositionMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theRowPositionHideCommand
to a popup menu. This command is intended to hide the current selected row immediately.With the additional column position information this command is intended to be used with the HierarchicalTreeLayer to support hiding of multiple rows on a spanned level header column.
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowPositionHideCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core. - Since:
- 1.6
-
hideRowPositionMenuItemProvider
public static IMenuItemProvider hideRowPositionMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theRowPositionHideCommand
to a popup menu. This command is intended to hide the current selected row immediately.With the additional column position information this command is intended to be used with the HierarchicalTreeLayer to support hiding of multiple rows on a spanned level header column.
The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowPositionHideCommand
. - Since:
- 1.6
-
showAllRowsMenuItemProvider
public static IMenuItemProvider showAllRowsMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllRowsCommand
to a popup menu. This command is intended to show all rows of the NatTable and is used to unhide previous hidden rows.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllRowsCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
showAllRowsMenuItemProvider
public static IMenuItemProvider showAllRowsMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllRowsCommand
to a popup menu. This command is intended to show all rows of the NatTable and is used to unhide previous hidden rows.The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllRowsCommand
.
-
showAllRowsMenuItemProvider
public static IMenuItemProvider showAllRowsMenuItemProvider(String menuLabel, org.eclipse.swt.graphics.Image image)
Will create and return theIMenuItemProvider
that adds the action for executing theShowAllRowsCommand
to a popup menu. This command is intended to show all rows of the NatTable and is used to unhide previous hidden rows.The
MenuItem
will be shown with the given menu label and given image.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
image
- The image that will be showed with the generatedMenuItem
. Can benull
to not showing an image.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theShowAllRowsCommand
. - Since:
- 1.6
-
showRowMenuItemProvider
public static IMenuItemProvider showRowMenuItemProvider(boolean showAll)
Will create and return theIMenuItemProvider
that adds the action for executing theRowShowCommand
to a popup menu. This command is intended to show the row(s) at the clicked position of the NatTable and is used to unhide previous hidden rows.- Parameters:
showAll
- Whether all hidden adjacent rows should be shown again or only the single direct adjacent row.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowShowCommand
. - Since:
- 1.6
-
showRowMenuItemProvider
public static IMenuItemProvider showRowMenuItemProvider(boolean showAll, String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theRowShowCommand
to a popup menu. This command is intended to show the row(s) at the clicked position of the NatTable and is used to unhide previous hidden rows.The
MenuItem
will be shown with the given menu label.- Parameters:
showAll
- Whether all hidden adjacent rows should be shown again or only the single direct adjacent row.menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowShowCommand
. - Since:
- 1.6
-
showRowMenuItemProvider
public static IMenuItemProvider showRowMenuItemProvider(boolean showAll, String menuLabel, org.eclipse.swt.graphics.Image image)
Will create and return theIMenuItemProvider
that adds the action for executing theRowShowCommand
to a popup menu. This command is intended to show the row(s) at the clicked position of the NatTable and is used to unhide previous hidden rows.The
MenuItem
will be shown with the given menu label and given image.- Parameters:
showAll
- Whether all hidden adjacent rows should be shown again or only the single direct adjacent row.menuLabel
- The text that will be showed for the generatedMenuItem
image
- The image that will be showed with the generatedMenuItem
. Can benull
to not showing an image.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theRowShowCommand
. - Since:
- 1.6
-
autoResizeColumnMenuItemProvider
public static IMenuItemProvider autoResizeColumnMenuItemProvider()
-
autoResizeColumnMenuItemProvider
public static IMenuItemProvider autoResizeColumnMenuItemProvider(String menuLabel)
-
autoResizeRowMenuItemProvider
public static IMenuItemProvider autoResizeRowMenuItemProvider()
-
autoResizeRowMenuItemProvider
public static IMenuItemProvider autoResizeRowMenuItemProvider(String menuLabel)
-
autoResizeAllSelectedColumnMenuItemProvider
public static IMenuItemProvider autoResizeAllSelectedColumnMenuItemProvider()
-
autoResizeAllSelectedColumnMenuItemProvider
public static IMenuItemProvider autoResizeAllSelectedColumnMenuItemProvider(String menuLabel)
-
columnChooserMenuItemProvider
public static IMenuItemProvider columnChooserMenuItemProvider()
-
columnChooserMenuItemProvider
public static IMenuItemProvider columnChooserMenuItemProvider(String menuLabel)
-
columnStyleEditorMenuItemProvider
public static IMenuItemProvider columnStyleEditorMenuItemProvider()
-
columnStyleEditorMenuItemProvider
public static IMenuItemProvider columnStyleEditorMenuItemProvider(String menuLabel)
-
renameColumnMenuItemProvider
public static IMenuItemProvider renameColumnMenuItemProvider()
-
renameColumnMenuItemProvider
public static IMenuItemProvider renameColumnMenuItemProvider(String label)
-
createColumnGroupMenuItemProvider
public static IMenuItemProvider createColumnGroupMenuItemProvider()
-
createColumnGroupMenuItemProvider
public static IMenuItemProvider createColumnGroupMenuItemProvider(String menuLabel)
-
createPerformanceColumnGroupMenuItemProvider
public static IMenuItemProvider createPerformanceColumnGroupMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to create a column group with the new performance ColumnGroupHeaderLayer. - Since:
- 1.6
-
createPerformanceColumnGroupMenuItemProvider
public static IMenuItemProvider createPerformanceColumnGroupMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to create a column group with the new performance ColumnGroupHeaderLayer. - Since:
- 1.6
-
ungroupColumnsMenuItemProvider
public static IMenuItemProvider ungroupColumnsMenuItemProvider()
-
ungroupColumnsMenuItemProvider
public static IMenuItemProvider ungroupColumnsMenuItemProvider(String menuLabel)
-
inspectLabelsMenuItemProvider
public static IMenuItemProvider inspectLabelsMenuItemProvider()
-
categoriesBasedColumnChooserMenuItemProvider
public static IMenuItemProvider categoriesBasedColumnChooserMenuItemProvider()
-
categoriesBasedColumnChooserMenuItemProvider
public static IMenuItemProvider categoriesBasedColumnChooserMenuItemProvider(String menuLabel)
-
clearAllFiltersMenuItemProvider
public static IMenuItemProvider clearAllFiltersMenuItemProvider()
-
clearAllFiltersMenuItemProvider
public static IMenuItemProvider clearAllFiltersMenuItemProvider(String menuLabel)
-
clearToggleFilterRowMenuItemProvider
public static IMenuItemProvider clearToggleFilterRowMenuItemProvider()
-
clearToggleFilterRowMenuItemProvider
public static IMenuItemProvider clearToggleFilterRowMenuItemProvider(String menuLabel)
-
stateManagerMenuItemProvider
public static IMenuItemProvider stateManagerMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theDisplayPersistenceDialogCommand
to a popup menu. This command is intended to open the DisplayPersistenceDialog for managing NatTable states (also called view management).- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theDisplayPersistenceDialogCommand
TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
stateManagerMenuItemProvider
public static IMenuItemProvider stateManagerMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theDisplayPersistenceDialogCommand
to a popup menu. This command is intended to open the DisplayPersistenceDialog for managing NatTable states (also called view management).The
MenuItem
will be shown with the given menu label.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theDisplayPersistenceDialogCommand
TheMenuItem
will be shown with the localized default text configured in NatTable core.
-
separatorMenuItemProvider
public static IMenuItemProvider separatorMenuItemProvider()
- Returns:
- An
IMenuItemProvider
for adding a separator to the popup menu.
-
renameColumnGroupMenuItemProvider
public static IMenuItemProvider renameColumnGroupMenuItemProvider()
-
renameColumnGroupMenuItemProvider
public static IMenuItemProvider renameColumnGroupMenuItemProvider(String menuLabel)
-
removeColumnGroupMenuItemProvider
public static IMenuItemProvider removeColumnGroupMenuItemProvider()
-
removeColumnGroupMenuItemProvider
public static IMenuItemProvider removeColumnGroupMenuItemProvider(String menuLabel)
-
exportToImageMenuItemProvider
public static IMenuItemProvider exportToImageMenuItemProvider()
Will create and return theIMenuItemProvider
that adds the action for executing theExportTableCommand
to a popup menu. This command is intended to to export the NatTable to image.IMPORTANT: the
ImageExporter
needs to be configured for the configuration attributeExportConfigAttributes.TABLE_EXPORTER
to really export to an image. Also theExportTableCommandHandler
needs to be registered on anILayer
in the layer stack, e.g. the GridLayer.- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theExportTableCommand
. TheMenuItem
will be shown with the localized default text configured in NatTable core. - Since:
- 1.5
-
exportToImageMenuItemProvider
public static IMenuItemProvider exportToImageMenuItemProvider(String menuLabel)
Will create and return theIMenuItemProvider
that adds the action for executing theExportTableCommand
to a popup menu. This command is intended to export the NatTable to image.The
MenuItem
will be shown with the given menu label.IMPORTANT: the
ImageExporter
needs to be configured for the configuration attributeExportConfigAttributes.TABLE_EXPORTER
to really export to an image. Also theExportTableCommandHandler
needs to be registered on anILayer
in the layer stack, e.g. the GridLayer.- Parameters:
menuLabel
- The text that will be showed for the generatedMenuItem
- Returns:
- The
IMenuItemProvider
for theMenuItem
that executes theExportTableCommand
. - Since:
- 1.5
-
createRowGroupMenuItemProvider
public static IMenuItemProvider createRowGroupMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to create a row group with the new performance RowGroupHeaderLayer. - Since:
- 1.6
-
createRowGroupMenuItemProvider
public static IMenuItemProvider createRowGroupMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to create a row group with the new performance RowGroupHeaderLayer. - Since:
- 1.6
-
ungroupRowsMenuItemProvider
public static IMenuItemProvider ungroupRowsMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to ungroup selected rows from an existing row group. - Since:
- 1.6
-
ungroupRowsMenuItemProvider
public static IMenuItemProvider ungroupRowsMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to ungroup selected rows from an existing row group. - Since:
- 1.6
-
renameRowGroupMenuItemProvider
public static IMenuItemProvider renameRowGroupMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item for renaming a row group. - Since:
- 1.6
-
renameRowGroupMenuItemProvider
public static IMenuItemProvider renameRowGroupMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item for renaming a row group. - Since:
- 1.6
-
removeRowGroupMenuItemProvider
public static IMenuItemProvider removeRowGroupMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to remove a row group. - Since:
- 1.6
-
removeRowGroupMenuItemProvider
public static IMenuItemProvider removeRowGroupMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to remove a row group. - Since:
- 1.6
-
freezeColumnMenuItemProvider
public static IMenuItemProvider freezeColumnMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a column. - Since:
- 1.6
-
freezeColumnMenuItemProvider
public static IMenuItemProvider freezeColumnMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a column. - Since:
- 1.6
-
freezeRowMenuItemProvider
public static IMenuItemProvider freezeRowMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a row. - Since:
- 1.6
-
freezeRowMenuItemProvider
public static IMenuItemProvider freezeRowMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a row. - Since:
- 1.6
-
freezePositionMenuItemProvider
public static IMenuItemProvider freezePositionMenuItemProvider(boolean include)
- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a cell position. - Since:
- 1.6
-
freezePositionMenuItemProvider
public static IMenuItemProvider freezePositionMenuItemProvider(String menuLabel, boolean include)
- Parameters:
menuLabel
- The label to be used for showing the menu item.include
- whether the selected cell should be included in the freeze region or not. Include means the freeze borders will be to the right and bottom, while exclude means the freeze borders are to the left and top.- Returns:
- The
IMenuItemProvider
for adding a menu item to freeze a cell position. - Since:
- 1.6
-
unfreezeMenuItemProvider
public static IMenuItemProvider unfreezeMenuItemProvider()
- Returns:
- The
IMenuItemProvider
for adding a menu item to remove a frozen state. - Since:
- 1.6
-
unfreezeMenuItemProvider
public static IMenuItemProvider unfreezeMenuItemProvider(String menuLabel)
- Parameters:
menuLabel
- The label to be used for showing the menu item.- Returns:
- The
IMenuItemProvider
for adding a menu item to remove a frozen state. - Since:
- 1.6
-
-