use of org.eclipse.jface.action.IMenuListener in project InformationSystem by ObeoNetwork.
the class OverviewActionBarContributor method contributeToMenu.
/**
* This adds to the menu bar a menu and some separators for editor
* additions, as well as the sub-menus for object creation items. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(OverviewEditorPlugin.INSTANCE.getString("_UI_OverviewEditor_menu"), "org.obeonetwork.dsl.overviewMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(OverviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(OverviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager menuManager) {
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
use of org.eclipse.jface.action.IMenuListener in project titan.EclipsePlug-ins by eclipse.
the class MSCView method hookContextMenu.
/**
* Creates context menu for the message sequence chart
*/
private void hookContextMenu() {
// $NON-NLS-1$
this.menuMgr = new MenuManager("#PopupMenu");
this.menuMgr.setRemoveAllWhenShown(true);
this.menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(final IMenuManager manager) {
fillContextMenu(manager);
}
});
Menu menu = this.menuMgr.createContextMenu(this.mscWidget.getViewControl());
this.mscWidget.getViewControl().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener in project gemoc-studio by eclipse.
the class FsmActionBarContributor method contributeToMenu.
/**
* This adds to the menu bar a menu and some separators for editor additions,
* as well as the sub-menus for object creation items.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(FsmEditorPlugin.INSTANCE.getString("_UI_FsmEditor_menu"), "org.eclipse.gemoc.sample.legacyfsm.fsmMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(FsmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(FsmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager menuManager) {
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
use of org.eclipse.jface.action.IMenuListener in project gemoc-studio by eclipse.
the class AbstractTimelineView method createMenuManager.
/**
* Creates the {@link MenuManager}.
*/
private void createMenuManager() {
menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
menuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
Menu menu = menuManager.createContextMenu(timelineViewer.getControl());
timelineViewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuManager, timelineViewer);
// make the selection available
getSite().setSelectionProvider(timelineViewer);
}
use of org.eclipse.jface.action.IMenuListener in project gemoc-studio by eclipse.
the class GexpressionsActionBarContributor method contributeToMenu.
/**
* This adds to the menu bar a menu and some separators for editor additions,
* as well as the sub-menus for object creation items.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(GexpressionsEditorPlugin.INSTANCE.getString("_UI_GexpressionsEditor_menu"), "org.eclipse.gemoc.gexpressionsMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(GexpressionsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(GexpressionsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager menuManager) {
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
Aggregations