Java Code Examples for org.eclipse.jface.action.IMenuManager

The following are top voted examples for showing how to use org.eclipse.jface.action.IMenuManager. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: n4js   File: SelectAllProjectExplorer_PluginUITest.java   View source code 6 votes vote down vote up
/**
 * Tests that the Top Level Elements
 */
@Test
public void testTopLevelElementsEntryNoDuplicates() {
	IActionBars actionBars = projectExplorer.getViewSite().getActionBars();
	IMenuManager menuManager = actionBars.getMenuManager();

	int topLevelElementsEntriesFound = 0;

	for (IContributionItem item : menuManager.getItems()) {
		if (item instanceof MenuManager) {
			String escapedMenuText = LegacyActionTools.removeMnemonics(((MenuManager) item).getMenuText());
			if (escapedMenuText.equals("Top Level Elements")) {
				topLevelElementsEntriesFound++;
			}
		}
	}

	assertEquals("There was more than one 'Top Level Elements' entry in the navigator action bar.",
			topLevelElementsEntriesFound, 1);
}
 
Example 2
Project: n4js   File: N4JSNavigatorActionProvider.java   View source code 6 votes vote down vote up
@Override
public void fillContextMenu(final IMenuManager menu) {
	// {@link N4JSProjectActionGroup} does enablement-logic
	// on its own, thus always invoke it here
	projectGroup.fillContextMenu(menu);

	// Only delegate to {@link N4JSWorkingSetActionProvider},
	// if the current selection contains working sets.
	if (selectionContainsWorkingSet) {
		workingSetActionProvider.fillContextMenu(menu);
	}

	if (assignWorkingSetsAction.isEnabled()) {
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, assignWorkingSetsAction);
	}
}
 
Example 3
Project: n4js   File: N4JSProjectActionGroup.java   View source code 6 votes vote down vote up
@Override
public void fillContextMenu(final IMenuManager menu) {
	super.fillContextMenu(menu);

	// If disabled, do not contribute
	if (!enableContribution) {
		return;
	}

	if (openAction.isEnabled() && enableOpenInContextMenu)
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, openAction);
	if (closeAction.isEnabled())
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, closeAction);
	if (closeUnrelatedAction.isEnabled()
			&& areOnlyProjectsSelected(closeUnrelatedAction.getStructuredSelection()))
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, closeUnrelatedAction);
}
 
Example 4
Project: avro-schema-editor   File: StudioPopupMenuConfigurationImpl.java   View source code 6 votes vote down vote up
@Override
public void fillPopupMenu(IMenuManager manager, SchemaViewer viewer) {
	// add element
	ContextualAction action = new AddElementAction("Add", IAction.AS_PUSH_BUTTON, Notifications.notifyRefreshReveal(getContext()));
	action.init(getContext(), true);
	manager.add(action);
	// remove element
	action = new RemoveElementAction("Remove", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF);
	action.init(getContext(), true);
	manager.add(action);		
	// copy
	action = new CopyElementAction("Copy", IAction.AS_PUSH_BUTTON, Notifications.NONE);
	action.init(getContext(), true);
	manager.add(action);
	// paste
	action = new PasteElementAction("Paste", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF);
	action.init(getContext(), true);
	manager.add(action);
}
 
Example 5
Project: eZooKeeper   File: ZnodeModelChildrenFormPage.java   View source code 6 votes vote down vote up
private void fillContextMenu(IMenuManager manager) {

        if (_TableViewer.getSelection().isEmpty()) {
            return;
        }

        manager.add(_NewZnodeAction);
        manager.add(new Separator());
        manager.add(_OpenAction);
        manager.add(new Separator());
        manager.add(_TableEditAction);
        manager.add(_TableEditChildrenAction);
        manager.add(new Separator());

        if (_DeleteAction.isEnabled()) {
            manager.add(_DeleteAction);
        }

        manager.add(new Separator());
        manager.add(_RefreshAction);
    }
 
Example 6
Project: bdf2   File: DbToolGefEditorContextMenuProvider.java   View source code 6 votes vote down vote up
public void buildContextMenu(IMenuManager menu) {
	GEFActionConstants.addStandardActionGroups(menu);

	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.UNDO.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionIdConstants.MODIFY_ACTION_ID));

	IAction saveAction = getAction(ActionFactory.SAVE.getId());
	saveAction.setImageDescriptor(Activator.getImageDescriptor(Activator.IMAGE_SAVE));

	menu.appendToGroup(GEFActionConstants.GROUP_SAVE, saveAction);
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, createExportMenuManager());
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.IMPORT_DATABASE_ACTION_ID));
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.CHANGE_DATABASE_ACTION_ID));

}
 
Example 7
Project: n4js   File: N4JSEditor.java   View source code 5 votes vote down vote up
@Override
protected void editorContextMenuAboutToShow(final IMenuManager menu) {
	super.editorContextMenuAboutToShow(menu);

	final IContributionItem[] items = menu.getItems();
	for (int i = 0; i < items.length; i++) {
		if (items[i] instanceof IMenuManager) {
			final IMenuManager subMenu = (IMenuManager) items[i];
			final IContributionItem testShowIn = subMenu.find(ContributionItemFactory.VIEWS_SHOW_IN.getId());
			if (null != testShowIn) {
				menu.remove(subMenu);
			}
		}
	}
}
 
Example 8
Project: OCCI-Studio   File: MonitoringActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 9
Project: n4js   File: N4JSOpenActions.java   View source code 5 votes vote down vote up
@Override
public void fillContextMenu(final IMenuManager menu) {
	if (inViewPart && canEnableOpenAction()) {
		if (openGroup.getOpenAction().isEnabled()) {
			openGroup.fillContextMenu(menu);
		}
	}
}
 
Example 10
Project: n4js   File: SelectTopLevelElementActionGroup.java   View source code 5 votes vote down vote up
@Override
public void fillActionBars(final IActionBars actionBars) {
	if (hasContributedToViewMenu) {
		return;
	}
	final IMenuManager topLevelSubMenu = new MenuManager("Top Level Elements");
	addActions(topLevelSubMenu);
	final IMenuManager menuManager = actionBars.getMenuManager();
	menuManager.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, topLevelSubMenu);
	hasContributedToViewMenu = true;
}
 
Example 11
Project: n4js   File: TestResultsView.java   View source code 5 votes vote down vote up
private void fillContextMenu(IMenuManager manager) {
	manager.add(actionRelaunch);
	manager.add(actionRelaunchFailed);
	manager.add(actionStop);
	manager.add(new Separator());
	manager.add(actionLock);
	manager.add(new Separator());
	// Other plug-ins can contribute their actions here
	manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
Example 12
Project: n4js   File: TestResultsView.java   View source code 5 votes vote down vote up
private void fillLocalPullDown(IMenuManager manager) {
	manager.add(actionRelaunch);
	manager.add(actionRelaunchFailed);
	manager.add(actionStop);
	manager.add(new Separator());
	manager.add(actionLock);
}
 
Example 13
Project: n4js   File: PerformanceView.java   View source code 5 votes vote down vote up
private void createMenu() {
	IMenuManager mgr = getViewSite().getActionBars().getMenuManager();
	mgr.setRemoveAllWhenShown(true);
	addDynamicVisualisationSelection(mgr);
	mgr.addMenuListener(new IMenuListener() {
		@Override
		public void menuAboutToShow(IMenuManager m) {
			addDynamicVisualisationSelection(m);
		}
	});
}
 
Example 14
Project: n4js   File: N4JSApplicationActionBarAdvisor.java   View source code 5 votes vote down vote up
@Override
public void fillActionBars(final int flags) {
	delegate.fillActionBars(flags);

	// To remove 'Build Working Set' contribution item from the main menu.
	final IMenuManager menuManager = configurer.getMenuManager();
	final MenuManager projectManager = getMenuManager(PROJECT_MENU_PREDICATE, menuManager);
	if (null != projectManager) {
		final MenuManager workingSetManager = getMenuManager(WORKING_SET_MENU_PREDICATE, projectManager);
		projectManager.remove(workingSetManager);
		projectManager.update(true);
	}
}
 
Example 15
Project: OCCI-Studio   File: OCCIActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 16
Project: OCCI-Studio   File: InfrastructureActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 17
Project: xmontiarc   File: RuntimeActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 18
Project: gemoc-studio-modeldebugging   File: TracingannotationsActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 19
Project: OCCI-Studio   File: SlaActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 20
Project: time4sys   File: ConstraintsActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 21
Project: eZooKeeper   File: ViewerFactory.java   View source code 5 votes vote down vote up
/**
 * Create a new {@link TableViewer} with {@link DataModel} elements.
 * 
 * @param site The {@link IWorkbenchPartSite} used to register the table's context menu.
 * @param table The {@link Table}.
 * @param dataModelClass The {@link DataModel} element {@link Class}.
 * @param dataModelElementType The {@link DataModel} {@link IElementType}.
 * @param input The {@link TableViewer} input.
 * @param inputElementType The input {@link IElementType}.
 * @return A new {@link TableViewer}.
 */
public static TableViewer createDataModelTableViewer(IWorkbenchPartSite site, Table table, Class<?> dataModelClass,
        final IElementType dataModelElementType, Object input, IElementType inputElementType) {

    TableViewer tableViewer = createTableViewer(table, dataModelClass, dataModelElementType, input,
            inputElementType, new DataModelElementBinding());

    List<BaseAction> tableActions = dataModelElementType.getActions();
    if (tableActions != null) {
        for (BaseAction action : tableActions) {
            action.setSelectionProvider(tableViewer);
        }

        MenuManager menuManager = new MenuManager("#PopupMenu");
        menuManager.setRemoveAllWhenShown(true);
        menuManager.addMenuListener(new IMenuListener() {

            public void menuAboutToShow(IMenuManager manager) {
                dataModelElementType.fillContextMenu(manager);
            }

        });

        Menu menu = menuManager.createContextMenu(table);
        table.setMenu(menu);
        site.registerContextMenu(menuManager, tableViewer);
    }

    return tableViewer;
}
 
Example 22
Project: neoscada   File: MemoryActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions ( IMenuManager menuManager )
{
    menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) );
    menuManager.insertAfter ( "ui-actions", showPropertiesViewAction );

    refreshViewerAction.setEnabled ( refreshViewerAction.isEnabled () );
    menuManager.insertAfter ( "ui-actions", refreshViewerAction );

    super.addGlobalActions ( menuManager );
}
 
Example 23
Project: gemoc-studio   File: GexpressionsActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 24
Project: eZooKeeper   File: ZnodeModelChildrenFormPage.java   View source code 5 votes vote down vote up
private void hookTableContextMenu() {
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    Menu menu = menuMgr.createContextMenu(_TableViewer.getControl());
    _TableViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, _TableViewer);
}
 
Example 25
Project: time4sys   File: LibraryActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 26
Project: eZooKeeper   File: JmxExplorerView.java   View source code 5 votes vote down vote up
private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    Menu menu = menuMgr.createContextMenu(_TreeViewer.getControl());
    _TreeViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, _TreeViewer);
}
 
Example 27
Project: eZooKeeper   File: AbstractJmxDataModelElementType.java   View source code 5 votes vote down vote up
@Override
public void fillContextMenu(IMenuManager manager) {

    BaseOpenAction openAction = getOpenAction();
    if (openAction != null && !openAction.getSelectionProvider().getSelection().isEmpty()) {
        manager.add(openAction);
    }

    RefreshAction refreshAction = getRefreshAction();
    if (refreshAction != null && !refreshAction.getSelectionProvider().getSelection().isEmpty()) {
        manager.add(new Separator());
        manager.add(refreshAction);
    }
}
 
Example 28
Project: neoscada   File: ProtocolActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions ( IMenuManager menuManager )
{
    menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    menuManager.insertAfter ( "ui-actions", showPropertiesViewAction ); //$NON-NLS-1$

    refreshViewerAction.setEnabled ( refreshViewerAction.isEnabled () );
    menuManager.insertAfter ( "ui-actions", refreshViewerAction ); //$NON-NLS-1$

    super.addGlobalActions ( menuManager );
}
 
Example 29
Project: time4sys   File: AnalysisActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 30
Project: neoscada   File: CommonActionProvider.java   View source code 5 votes vote down vote up
@Override
public void fillContextMenu ( final IMenuManager menu )
{
    if ( this.openAction.isEnabled () )
    {
        // menu.appendToGroup ( ICommonMenuConstants.GROUP_OPEN, this.openAction );
    }
}
 
Example 31
Project: neoscada   File: ApplicationActionBarAdvisor.java   View source code 5 votes vote down vote up
@Override
protected void fillMenuBar ( final IMenuManager menuBar )
{
    final MenuManager fileMenu = new MenuManager ( "&File", IWorkbenchActionConstants.M_FILE );
    final MenuManager windowMenu = new MenuManager ( "&Window", IWorkbenchActionConstants.M_WINDOW );
    final MenuManager helpMenu = new MenuManager ( "&Help", IWorkbenchActionConstants.M_HELP );
    final MenuManager fileNewMenu = new MenuManager ( "&New", IWorkbenchActionConstants.NEW_EXT );
    final MenuManager windowNewMenu = new MenuManager ( "Show &View", IWorkbenchActionConstants.SHOW_EXT );

    menuBar.add ( fileMenu );
    // Add a group marker indicating where action set menus will appear.
    menuBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
    menuBar.add ( windowMenu );
    menuBar.add ( helpMenu );

    // File
    fileMenu.add ( this.newWindowAction );
    fileMenu.add ( new Separator () );
    fileMenu.add ( fileNewMenu );
    fileMenu.add ( getAction ( ActionFactory.SAVE.getId () ) );
    fileMenu.add ( getAction ( ActionFactory.NEW_EDITOR.getId () ) );
    fileMenu.add ( new GroupMarker ( IWorkbenchActionConstants.OPEN_EXT ) );

    fileMenu.add ( new Separator () );
    fileMenu.add ( this.exitAction );

    fileNewMenu.add ( this.newWizards );

    // Window
    windowNewMenu.add ( this.showViews );
    windowMenu.add ( windowNewMenu );
    windowMenu.add ( getAction ( ActionFactory.PREFERENCES.getId () ) );

    // Help
    helpMenu.add ( this.aboutAction );
    helpMenu.add ( getAction ( ActionFactory.INTRO.getId () ) );
}
 
Example 32
Project: scanning   File: DetectorView.java   View source code 5 votes vote down vote up
/**
 * Create the actions.
 */
private void createActions() {

	IMenuManager popup = new MenuManager();
	List<IContributionManager> mans = Arrays.asList(getViewSite().getActionBars().getToolBarManager(), getViewSite().getActionBars().getMenuManager(), popup);

	IAction showHardware   = createPreferenceAction("Show Devices",   DevicePreferenceConstants.SHOW_HARDWARE,   "icons/camera-lens.png");
	IAction showMalcolm   = createPreferenceAction("Show Malcolm Devices",   DevicePreferenceConstants.SHOW_MALCOLM,   "icons/alarm-clock-select.png");
	IAction showProcessing = createPreferenceAction("Show Processing", DevicePreferenceConstants.SHOW_PROCESSING, "icons/processing.png");
	ViewUtil.addGroups("visibility", mans, showHardware, showMalcolm, showProcessing);

	IAction refresh = new Action("Refresh", Activator.getImageDescriptor("icons/recycle.png")) {
		@Override
		public void run() {
			refresh();
		}
	};

	ViewUtil.addGroups("refresh", mans, refresh);

	IAction configure = new Action("Configure", Activator.getImageDescriptor("icons/configure.png")) {
		@Override
		public void run() {
			configure();
		}
	};
	ViewUtil.addGroups("camera", mans, configure);

}
 
Example 33
Project: neoscada   File: ChartActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
protected void addGlobalActions ( final IMenuManager menuManager )
{
    menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) );
    menuManager.insertAfter ( "ui-actions", this.showPropertiesViewAction );

    this.refreshViewerAction.setEnabled ( this.refreshViewerAction.isEnabled () );
    menuManager.insertAfter ( "ui-actions", this.refreshViewerAction );
    menuManager.insertAfter ( "ui-actions", this.saveAsAction );

    super.addGlobalActions ( menuManager );
}
 
Example 34
Project: neoscada   File: ItemActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions ( IMenuManager menuManager )
{
    menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    menuManager.insertAfter ( "ui-actions", showPropertiesViewAction ); //$NON-NLS-1$

    refreshViewerAction.setEnabled ( refreshViewerAction.isEnabled () );
    menuManager.insertAfter ( "ui-actions", refreshViewerAction ); //$NON-NLS-1$

    super.addGlobalActions ( menuManager );
}
 
Example 35
Project: time4sys   File: GqamActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}
 
Example 36
Project: neoscada   File: MonitorsView.java   View source code 5 votes vote down vote up
private void hookContextMenu ()
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu", VIEW_ID );
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( this.viewer.getControl () );
    this.viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( menuMgr, this.viewer );
}
 
Example 37
Project: neoscada   File: MonitorsViewTable.java   View source code 5 votes vote down vote up
protected void hookContextMenu ( final Control control, final ISelectionProvider selectionProvider, final IViewSite viewSite )
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( control );
    control.setMenu ( menu );
    viewSite.registerContextMenu ( menuMgr, selectionProvider );
}
 
Example 38
Project: neoscada   File: EventViewTable.java   View source code 5 votes vote down vote up
protected void hookContextMenu ( final Control control, final ISelectionProvider selectionProvider, final IViewSite viewSite )
{
    final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown ( true );
    menuMgr.addMenuListener ( new IMenuListener () {
        @Override
        public void menuAboutToShow ( final IMenuManager manager )
        {
            fillContextMenu ( manager );
        }
    } );
    final Menu menu = menuMgr.createContextMenu ( control );
    control.setMenu ( menu );
    viewSite.registerContextMenu ( menuMgr, selectionProvider );
}
 
Example 39
Project: neoscada   File: DetailViewActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions ( IMenuManager menuManager )
{
    menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    menuManager.insertAfter ( "ui-actions", showPropertiesViewAction ); //$NON-NLS-1$

    refreshViewerAction.setEnabled ( refreshViewerAction.isEnabled () );
    menuManager.insertAfter ( "ui-actions", refreshViewerAction ); //$NON-NLS-1$

    super.addGlobalActions ( menuManager );
}
 
Example 40
Project: time4sys   File: MappingActionBarContributor.java   View source code 5 votes vote down vote up
/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
protected void addGlobalActions(IMenuManager menuManager) {
	menuManager.insertAfter("additions-end", new Separator("ui-actions"));
	menuManager.insertAfter("ui-actions", showPropertiesViewAction);

	refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());		
	menuManager.insertAfter("ui-actions", refreshViewerAction);

	super.addGlobalActions(menuManager);
}