public class PopupMenuBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected NatTable |
natTable
The active NatTable instance the context menu should be added to.
|
protected org.eclipse.swt.widgets.Menu |
popupMenu
The
Menu that is created with this popup menu builder. |
Constructor and Description |
---|
PopupMenuBuilder(NatTable parent)
Creates a new
Menu that is only configurable with this instance of
PopupMenuBuilder . |
PopupMenuBuilder(NatTable natTable,
org.eclipse.swt.widgets.Menu menu)
Creates a popup menu builder based on the given menu.
|
protected NatTable natTable
protected org.eclipse.swt.widgets.Menu popupMenu
Menu
that is created with this popup menu builder.public PopupMenuBuilder(NatTable parent)
Menu
that is only configurable with this instance of
PopupMenuBuilder
.parent
- The active NatTable instance the context menu should be added to.public PopupMenuBuilder(NatTable natTable, org.eclipse.swt.widgets.Menu menu)
As an example you might want to create a PopupMenuBuilder by using a configured menu with the id org.eclipse.nebula.widgets.nattable.example.contextmenu
ISelectionProvider isp = new RowSelectionProvider<?>(selectionLayer, bodyDataProvider, false); MenuManager menuManager = new MenuManager(); menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); getSite().registerContextMenu("org.eclipse.nebula.widgets.nattable.example.contextmenu", menuManager, isp); PopupMenuBuilder popupMenu = new PopupMenuBuilder(menuManager.createContextMenu(natTable));
natTable
- The active NatTable instance which might be needed for creation of
menu items that need the NatTable instance to work.menu
- The registered context menu.public PopupMenuBuilder withMenuItemProvider(IMenuItemProvider menuItemProvider)
IMenuItemProvider
to the popup menu.
You can use this to add your own item to the popup menu.menuItemProvider
- The IMenuItemProvider
that provides the menu item
that should be added to the popup menu.public PopupMenuBuilder withHideColumnMenuItem()
PopupMenuBuilder
with the hide column menu item added.MenuItemProviders.hideColumnMenuItemProvider()
public PopupMenuBuilder withHideColumnMenuItem(String menuLabel)
menuLabel
- The label to use for showing the item in the popup menu.PopupMenuBuilder
with the hide column menu item added.MenuItemProviders.hideColumnMenuItemProvider(String)
public PopupMenuBuilder withShowAllColumnsMenuItem()
PopupMenuBuilder
with the show all columns menu item added.MenuItemProviders.showAllColumnsMenuItemProvider()
public PopupMenuBuilder withShowAllColumnsMenuItem(String menuLabel)
menuLabel
- The label to use for showing the item in the popup menu.PopupMenuBuilder
with the show all columns menu item added.MenuItemProviders.showAllColumnsMenuItemProvider(String)
public PopupMenuBuilder withHideRowMenuItem()
PopupMenuBuilder
with the hide row menu item added.MenuItemProviders.hideRowMenuItemProvider()
public PopupMenuBuilder withHideRowMenuItem(String menuLabel)
menuLabel
- The label to use for showing the item in the popup menu.PopupMenuBuilder
with the hide row menu item added.MenuItemProviders.hideRowMenuItemProvider(String)
public PopupMenuBuilder withShowAllRowsMenuItem()
PopupMenuBuilder
with the show all rows menu item added.MenuItemProviders.showAllRowsMenuItemProvider()
public PopupMenuBuilder withShowAllRowsMenuItem(String menuLabel)
menuLabel
- The label to use for showing the item in the popup menu.PopupMenuBuilder
with the show all rows menu item added.MenuItemProviders.showAllRowsMenuItemProvider(String)
public PopupMenuBuilder withAutoResizeSelectedColumnsMenuItem()
public PopupMenuBuilder withAutoResizeSelectedColumnsMenuItem(String menuLabel)
public PopupMenuBuilder withAutoResizeSelectedRowsMenuItem()
public PopupMenuBuilder withAutoResizeSelectedRowsMenuItem(String menuLabel)
public PopupMenuBuilder withColumnChooserMenuItem()
public PopupMenuBuilder withColumnChooserMenuItem(String menuLabel)
public PopupMenuBuilder withColumnStyleEditor()
public PopupMenuBuilder withColumnStyleEditor(String menuLabel)
public PopupMenuBuilder withColumnRenameDialog()
public PopupMenuBuilder withColumnRenameDialog(String menuLabel)
public PopupMenuBuilder withCreateColumnGroupsMenuItem()
public PopupMenuBuilder withCreateColumnGroupsMenuItem(String menuLabel)
public PopupMenuBuilder withUngroupColumnsMenuItem()
public PopupMenuBuilder withUngroupColumnsMenuItem(String menuLabel)
public PopupMenuBuilder withInspectLabelsMenuItem()
public PopupMenuBuilder withCategoriesBasedColumnChooser()
public PopupMenuBuilder withCategoriesBasedColumnChooser(String menuLabel)
public PopupMenuBuilder withClearAllFilters()
public PopupMenuBuilder withClearAllFilters(String menuLabel)
public PopupMenuBuilder withToggleFilterRow()
public PopupMenuBuilder withToggleFilterRow(String menuLabel)
public PopupMenuBuilder withStateManagerMenuItemProvider()
PopupMenuBuilder
with the menu item added for showing the view
management dialog for managing NatTable states.MenuItemProviders.stateManagerMenuItemProvider()
public PopupMenuBuilder withStateManagerMenuItemProvider(String menuLabel)
menuLabel
- The label to use for showing the item in the popup menu.PopupMenuBuilder
with the menu item added for showing the view
management dialog for managing NatTable states.MenuItemProviders.stateManagerMenuItemProvider(String)
public PopupMenuBuilder withSeparator()
PopupMenuBuilder
with an added separator.MenuItemProviders.separatorMenuItemProvider()
public org.eclipse.swt.widgets.Menu build()
Menu
.Menu
that is created by this builder.Copyright © 2013. All Rights Reserved.