Class MenuItemProviders

java.lang.Object
org.eclipse.nebula.widgets.nattable.ui.menu.MenuItemProviders

public final class MenuItemProviders extends Object
Helper class that provides several IMenuItemProvider for menu items that can be used within a popup menu in the NatTable to execute NatTable specific actions.
  • Field Details

    • 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:
  • Method Details

    • getNatEventData

      public static NatEventData getNatEventData(org.eclipse.swt.events.SelectionEvent selectionEvent)
      Walk up the MenuItems (in case they are nested) and find the parent Menu
      Parameters:
      selectionEvent - on the MenuItem
      Returns:
      data associated with the parent Menu
    • hideColumnMenuItemProvider

      public static IMenuItemProvider hideColumnMenuItemProvider()
      Will create and return the IMenuItemProvider that adds the action for executing the ColumnHideCommand to a popup menu. This command is intended to hide the current selected column immediately.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ColumnHideCommand. The MenuItem will be shown with the localized default text configured in NatTable core.
    • hideColumnMenuItemProvider

      public static IMenuItemProvider hideColumnMenuItemProvider(String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the ColumnHideCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ColumnHideCommand.
    • showAllColumnsMenuItemProvider

      public static IMenuItemProvider showAllColumnsMenuItemProvider()
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllColumnsCommand 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 the MenuItem that executes the ShowAllColumnsCommand. The MenuItem will be shown with the localized default text configured in NatTable core.
    • showAllColumnsMenuItemProvider

      public static IMenuItemProvider showAllColumnsMenuItemProvider(String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllColumnsCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ShowAllColumnsCommand.
    • showAllColumnsMenuItemProvider

      public static IMenuItemProvider showAllColumnsMenuItemProvider(String menuLabel, org.eclipse.swt.graphics.Image image)
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllColumnsCommand 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 generated MenuItem
      image - The image that will be showed with the generated MenuItem. Can be null to not showing an image.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ShowAllColumnsCommand.
      Since:
      1.6
    • showColumnMenuItemProvider

      public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll)
      Will create and return the IMenuItemProvider that adds the action for executing the ColumnShowCommand 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 the MenuItem that executes the ColumnShowCommand.
      Since:
      1.6
    • showColumnMenuItemProvider

      public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll, String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the ColumnShowCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ColumnShowCommand.
      Since:
      1.6
    • showColumnMenuItemProvider

      public static IMenuItemProvider showColumnMenuItemProvider(boolean showAll, String menuLabel, org.eclipse.swt.graphics.Image image)
      Will create and return the IMenuItemProvider that adds the action for executing the ColumnShowCommand 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 generated MenuItem
      image - The image that will be showed with the generated MenuItem. Can be null to not showing an image.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ColumnShowCommand.
      Since:
      1.6
    • hideRowMenuItemProvider

      public static IMenuItemProvider hideRowMenuItemProvider()
      Will create and return the IMenuItemProvider that adds the action for executing the RowHideCommand to a popup menu. This command is intended to hide the current selected row immediately.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the RowHideCommand. The MenuItem will be shown with the localized default text configured in NatTable core.
    • hideRowMenuItemProvider

      public static IMenuItemProvider hideRowMenuItemProvider(String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the RowHideCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the RowHideCommand.
    • hideRowPositionMenuItemProvider

      public static IMenuItemProvider hideRowPositionMenuItemProvider()
      Will create and return the IMenuItemProvider that adds the action for executing the RowPositionHideCommand 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 the MenuItem that executes the RowPositionHideCommand. The MenuItem 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 the IMenuItemProvider that adds the action for executing the RowPositionHideCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the RowPositionHideCommand.
      Since:
      1.6
    • showAllRowsMenuItemProvider

      public static IMenuItemProvider showAllRowsMenuItemProvider()
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllRowsCommand 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 the MenuItem that executes the ShowAllRowsCommand. The MenuItem will be shown with the localized default text configured in NatTable core.
    • showAllRowsMenuItemProvider

      public static IMenuItemProvider showAllRowsMenuItemProvider(String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllRowsCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ShowAllRowsCommand.
    • showAllRowsMenuItemProvider

      public static IMenuItemProvider showAllRowsMenuItemProvider(String menuLabel, org.eclipse.swt.graphics.Image image)
      Will create and return the IMenuItemProvider that adds the action for executing the ShowAllRowsCommand 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 generated MenuItem
      image - The image that will be showed with the generated MenuItem. Can be null to not showing an image.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ShowAllRowsCommand.
      Since:
      1.6
    • showRowMenuItemProvider

      public static IMenuItemProvider showRowMenuItemProvider(boolean showAll)
      Will create and return the IMenuItemProvider that adds the action for executing the RowShowCommand 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 the MenuItem that executes the RowShowCommand.
      Since:
      1.6
    • showRowMenuItemProvider

      public static IMenuItemProvider showRowMenuItemProvider(boolean showAll, String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the RowShowCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the RowShowCommand.
      Since:
      1.6
    • showRowMenuItemProvider

      public static IMenuItemProvider showRowMenuItemProvider(boolean showAll, String menuLabel, org.eclipse.swt.graphics.Image image)
      Will create and return the IMenuItemProvider that adds the action for executing the RowShowCommand 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 generated MenuItem
      image - The image that will be showed with the generated MenuItem. Can be null to not showing an image.
      Returns:
      The IMenuItemProvider for the MenuItem that executes the RowShowCommand.
      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 the IMenuItemProvider that adds the action for executing the DisplayPersistenceDialogCommand to a popup menu. This command is intended to open the DisplayPersistenceDialog for managing NatTable states (also called view management).
      Returns:
      The IMenuItemProvider for the MenuItem that executes the DisplayPersistenceDialogCommand The MenuItem will be shown with the localized default text configured in NatTable core.
    • stateManagerMenuItemProvider

      public static IMenuItemProvider stateManagerMenuItemProvider(String menuLabel)
      Will create and return the IMenuItemProvider that adds the action for executing the DisplayPersistenceDialogCommand 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 generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the DisplayPersistenceDialogCommand The MenuItem 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 the IMenuItemProvider that adds the action for executing the ExportTableCommand 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 attribute ExportConfigAttributes.TABLE_EXPORTER to really export to an image. Also the ExportTableCommandHandler needs to be registered on an ILayer in the layer stack, e.g. the GridLayer.

      Returns:
      The IMenuItemProvider for the MenuItem that executes the ExportTableCommand. The MenuItem 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 the IMenuItemProvider that adds the action for executing the ExportTableCommand 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 attribute ExportConfigAttributes.TABLE_EXPORTER to really export to an image. Also the ExportTableCommandHandler needs to be registered on an ILayer in the layer stack, e.g. the GridLayer.

      Parameters:
      menuLabel - The text that will be showed for the generated MenuItem
      Returns:
      The IMenuItemProvider for the MenuItem that executes the ExportTableCommand.
      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