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

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project acceleo-modules, under directory /psm-gen-scala/plugins/com.github.sbegaudeau.acceleo.modules.psm.gen.scala.editor/src-gen/com/github/sbegaudeau/acceleo/modules/psm/gen/scala/model/scala/presentation/.

Source file: ScalaActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(ScalaEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(ScalaEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 2

From project acceleo-webapp-generator, under directory /plugins/org.eclipse.acceleo.tutorial.webapp.editor/src-gen/org/eclipse/acceleo/tutorial/webapp/presentation/.

Source file: WebappActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(WebappEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(WebappEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 3

From project aws-toolkit-for-eclipse, under directory /com.amazonaws.eclipse.ec2/src/com/amazonaws/eclipse/ec2/ui/.

Source file: SelectionTable.java

  22 
vote

/** 
 * Hooks a context (popup) menu for the table control.
 */
private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new AcountValidatingMenuListener());
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  menuMgr.createContextMenu(this);
}
 

Example 4

From project bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/views/.

Source file: ResourceView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      ResourceView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 5

From project Bio-PEPA, under directory /uk.ac.ed.inf.common.ui.plotview/src/uk/ac/ed/inf/common/ui/plotview/views/.

Source file: PlotView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      PlotView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(folder);
  folder.setMenu(menu);
}
 

Example 6

From project bioclipse.speclipse, under directory /plugins/net.bioclipse.specmol/src/net/bioclipse/specmol/editor/.

Source file: SpecMolEditorContributor.java

  22 
vote

public void contributeToMenu(IMenuManager manager){
  super.contributeToMenu(manager);
  MenuManager specmolMenu=new MenuManager("SpecMol","net.bioclipse.specmol.menu");
  manager.insertAfter("additions",specmolMenu);
  specmolMenu.add(new ViewBibtexAction(this));
  specmolMenu.add(new AssignBibtexAction(this));
}
 

Example 7

From project bpelunit, under directory /tycho/net.bpelunit.toolsupport/editors/sections/.

Source file: StructuredSection.java

  22 
vote

protected void hookMenu(){
  MenuManager popupMenuManager=new MenuManager();
  IMenuListener listener=new IMenuListener(){
    public void menuAboutToShow(    IMenuManager mng){
      fillContextMenu(mng);
    }
  }
;
  popupMenuManager.addMenuListener(listener);
  popupMenuManager.setRemoveAllWhenShown(true);
  Control control=getViewer().getControl();
  Menu menu=popupMenuManager.createContextMenu(control);
  control.setMenu(menu);
}
 

Example 8

From project bundlemaker, under directory /main/org.bundlemaker.core.ui.projecteditor/src/org/bundlemaker/core/ui/projecteditor/.

Source file: ProjectEditorPage.java

  22 
vote

/** 
 */
private void createMenuManager(){
  MenuManager menuMgr=new MenuManager();
  Menu menu=menuMgr.createContextMenu(_treeViewer.getControl());
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      fillContextMenu(manager);
    }
  }
);
  menuMgr.setRemoveAllWhenShown(true);
  _treeViewer.getControl().setMenu(menu);
}
 

Example 9

From project ceylon-ide-eclipse, under directory /plugins/com.redhat.ceylon.eclipse.ui/src/com/redhat/ceylon/eclipse/code/refactor/.

Source file: RefactorMenuItems.java

  22 
vote

@Override protected IContributionItem[] getContributionItems(){
  IContributionItem[] items=getItems(getCurrentEditor());
  if (collapseMenuItems(getParent())) {
    MenuManager submenu=new MenuManager("Refactor");
    for (    IContributionItem item : items) {
      submenu.add(item);
    }
    return new IContributionItem[]{submenu};
  }
 else {
    return items;
  }
}
 

Example 10

From project CIShell, under directory /clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/.

Source file: MenuAdapter.java

  22 
vote

private void processTopMenu(Element topMenuNode){
  String topMenuName=topMenuNode.getAttribute(NAME_ATTRIBUTE);
  MenuManager topMenuBar=(MenuManager)this.menuManager.findUsingPath(topMenuName);
  if (topMenuBar == null) {
    topMenuBar=new MenuManager(topMenuName,topMenuName.toLowerCase());
    this.menuManager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS,topMenuBar);
  }
  processSubMenu(topMenuNode,topMenuBar);
}
 

Example 11

From project Database-Designer, under directory /plugins/org.obeonetwork.dsl.database.editor/src/org/obeonetwork/dsl/database/presentation/.

Source file: DatabaseActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(DatabaseEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(DatabaseEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 12

From project dawn-isenciaui, under directory /com.isencia.passerelle.workbench.model.editor.ui/src/main/java/com/isencia/passerelle/workbench/model/editor/ui/views/.

Source file: ActorTreeViewerPage.java

  22 
vote

private void createContextMenus(){
  MenuManager menuManager=new ActorTreeMenuProvider(getTreeViewer());
  Menu menu=menuManager.createContextMenu(getTreeViewer().getControl());
  getTreeViewer().getControl().setMenu(menu);
  getSite().registerContextMenu("#Pop up",menuManager,getSite().getSelectionProvider());
}
 

Example 13

From project dawn-workflow, under directory /org.dawb.passerelle.actors/src/org/dawb/passerelle/editors/.

Source file: UserModifyComposite.java

  22 
vote

/** 
 * Create the actions.
 */
protected void initializePopup(IActionBars bars){
  MenuManager man=new MenuManager();
  man.add(confirm);
  man.add(stop);
  man.add(new Separator(getClass().getName() + ".sep1"));
  man.add(add);
  man.add(delete);
  final Menu menu=man.createContextMenu(tableViewer.getTable());
  tableViewer.getTable().setMenu(menu);
}
 

Example 14

From project Diver, under directory /ca.uvic.chisel.javasketch/src/ca/uvic/chisel/javasketch/ui/internal/presentation/.

Source file: TimeLineAnnotationHook.java

  22 
vote

private void hookContextMenu(){
  MenuManager manager=new MenuManager();
  manager.addMenuListener(this);
  manager.setRemoveAllWhenShown(true);
  Menu menu=manager.createContextMenu(editor.getTimeRange());
  editor.getTimeRange().setMenu(menu);
}
 

Example 15

From project droolsjbpm-tools, under directory /drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/views/.

Source file: RepositoryView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      RepositoryView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 16

From project eclipse-instasearch, under directory /instasearch/src/it/unibz/instasearch/ui/.

Source file: InstaSearchView.java

  22 
vote

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(resultViewer.getControl());
  resultViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,resultViewer);
}
 

Example 17

From project eclipse-integration-commons, under directory /org.springsource.ide.eclipse.dashboard.ui/src/org/springsource/ide/eclipse/dashboard/internal/ui/editors/.

Source file: EditorToolkit.java

  22 
vote

protected void configureContextMenuManager(Control control){
  MenuManager manager=new MenuManager();
  IMenuListener listener=new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      contextMenuAboutToShow(manager);
    }
  }
;
  manager.setRemoveAllWhenShown(true);
  manager.addMenuListener(listener);
  control.setMenu(manager.createContextMenu(control));
}
 

Example 18

From project eclipse-integration-gradle, under directory /org.springsource.ide.eclipse.gradle.ui.taskview/src/org/springsource/ide/eclipse/gradle/ui/taskview/.

Source file: GradleTasksView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      GradleTasksView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 19

From project eclipse-task-editor, under directory /plugins/de.sebastianbenz.task.application/src/de/sebastianbenz/task/app/actions/.

Source file: TaskEditorActionBarAdvisor.java

  22 
vote

private MenuManager createHelpMenu(){
  MenuManager helpMenu=new MenuManager("&Help",IWorkbenchActionConstants.M_HELP);
  helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  helpMenu.add(new Separator());
  ActionContributionItem aboutAction=new ActionContributionItem(getAction(ActionFactory.ABOUT.getId()));
  helpMenu.add(aboutAction);
  if (Util.isMac()) {
    aboutAction.setVisible(false);
  }
  return helpMenu;
}
 

Example 20

From project EMF-IncQuery, under directory /tests/org.eclipse.viatra2.emf.incquery.snapshot.editor/src/org/eclipse/viatra2/emf/incquery/snapshot/EIQSnapshot/presentation/.

Source file: EIQSnapshotActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(EiqsnapshotEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(EiqsnapshotEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 21

From project Extensions2Services, under directory /eu.wwuk.eclipse.extsvcs.examples.client/src/eu/wwuk/eclipse/extsvcs/examples/client/.

Source file: ApplicationActionBarAdvisor.java

  22 
vote

protected void fillMenuBar(IMenuManager menuBar){
  MenuManager windowMenu=new MenuManager("Window");
  menuBar.add(windowMenu);
  windowMenu.add(viewsShortlist);
  windowMenu.add(new Separator());
  windowMenu.add(openPrefs);
}
 

Example 22

From project fr.obeo.performance, under directory /fr.obeo.performance.editor/src-gen/fr/obeo/performance/presentation/.

Source file: PerformanceActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(PerformanceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(PerformanceEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 23

From project gmc, under directory /src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/.

Source file: ApplicationActionBarAdvisor.java

  22 
vote

protected void fillMenuBar(IMenuManager menuBar){
  MenuManager fileMenu=new MenuManager("&File",IWorkbenchActionConstants.M_FILE);
  fileMenu.add(new Separator());
  fileMenu.add(exitAction);
  MenuManager helpMenu=new MenuManager("&Help",IWorkbenchActionConstants.M_HELP);
  helpMenu.add(helpContentsAction);
  helpMenu.add(aboutAction);
  menuBar.add(fileMenu);
  menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menuBar.add(helpMenu);
}
 

Example 24

From project gted, under directory /net.sf.gted.editor/src/net/sf/gted/editor/entry/master/.

Source file: POMasterDetailsBlock.java

  22 
vote

private void createPopupMenu(){
  MenuManager popupMenu=new MenuManager();
  IProject project=this.getPage().getEditor().getPoEditor().getIFile().getProject();
  IAction newRowAction=new RenameMsgidAction(this,project);
  popupMenu.add(newRowAction);
  Menu menu=popupMenu.createContextMenu(table);
  table.setMenu(menu);
}
 

Example 25

From project ivyde, under directory /org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/.

Source file: ResolveVisualizerView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      ResolveVisualizerView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 26

From project libra, under directory /plugins/org.eclipse.libra.framework.editor.ui/src/org/eclipse/libra/framework/editor/ui/dependencies/.

Source file: BundleDependencyEditorPage.java

  22 
vote

private void initPopupMenu(){
  zoomContributionItem=new ZoomContributionViewItem(this);
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 27

From project logsaw-app, under directory /net.sf.logsaw.ui/src/net/sf/logsaw/ui/editors/.

Source file: LogViewEditor.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 28

From project m2eclipse-hudson, under directory /org.sonatype.m2e.hudson.ui/src/main/java/com/sonatype/buildserver/eclipse/ui/job/view/.

Source file: ScmChangesPage.java

  22 
vote

private void createContextMenu(){
  MenuManager menuMgr=new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      populateContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(treeViewer.getControl());
  treeViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,treeViewer);
}
 

Example 29

From project m2eclipse-webby, under directory /org.sonatype.m2e.webby/src/org/sonatype/m2e/webby/internal/view/.

Source file: WebbyView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager(null);
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      manager.add(browse);
      manager.add(new Separator());
      manager.add(stop);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(table);
  table.setMenu(menu);
}
 

Example 30

From project mwe, under directory /plugins/org.eclipse.emf.mwe.ewm.editor/src/org/eclipse/emf/mwe/ewm/orchestration/presentation/.

Source file: OrchestrationActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(WorkflowEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(WorkflowEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 31

From project mylyn.builds, under directory /org.eclipse.mylyn.builds.ui/src/org/eclipse/mylyn/internal/builds/ui/view/.

Source file: BuildsView.java

  22 
vote

protected void createPopupMenu(Composite parent){
  MenuManager menuManager=new MenuManager();
  menuManager.add(new GroupMarker("group.open"));
  menuManager.add(new Separator("group.edit"));
  menuManager.add(new Separator("group.file"));
  menuManager.add(new Separator("group.run"));
  menuManager.add(new Separator("group.refresh"));
  menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  menuManager.add(new Separator(BuildsUiConstants.GROUP_PROPERTIES));
  Menu contextMenu=menuManager.createContextMenu(parent);
  viewer.getTree().setMenu(contextMenu);
  getSite().registerContextMenu(menuManager,viewer);
}
 

Example 32

From project mylyn.docs, under directory /org.eclipse.mylyn.wikitext.ui/src/org/eclipse/mylyn/internal/wikitext/ui/editor/.

Source file: MarkupEditor.java

  22 
vote

@Override protected void editorContextMenuAboutToShow(IMenuManager menu){
  super.editorContextMenuAboutToShow(menu);
  final MarkupLanguage markupLanguage=getMarkupLanguage();
  MenuManager markupLanguageMenu=new MenuManager(Messages.MarkupEditor_markupLanguage);
  for (  String markupLanguageName : new TreeSet<String>(WikiText.getMarkupLanguageNames())) {
    markupLanguageMenu.add(new SetMarkupLanguageAction(this,markupLanguageName,markupLanguage != null && markupLanguageName.equals(markupLanguage.getName())));
  }
  menu.prependToGroup(ITextEditorActionConstants.GROUP_SETTINGS,markupLanguageMenu);
  OutlineItem nearestOutlineItem=getNearestMatchingOutlineItem();
  if (nearestOutlineItem != null && !nearestOutlineItem.isRootItem()) {
    menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN,new PreviewOutlineItemAction(this,nearestOutlineItem));
  }
}
 

Example 33

From project mylyn.incubator, under directory /org.eclipse.mylyn.sandbox.dev/src/org/eclipse/mylyn/internal/sandbox/dev/views/.

Source file: RepositorySpyView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      RepositorySpyView.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
 

Example 34

From project neoclipse, under directory /org.neo4j.neoclipse/src/main/java/org/neo4j/neoclipse/property/.

Source file: NeoPropertySheetPage.java

  22 
vote

/** 
 * Create the context menu for this property sheet.
 * @param parent
 */
private void createMenu(final Composite parent){
  MenuManager menuManager=createMainMenu(parent);
  menu=menuManager.createContextMenu(getControl());
  MenuManager addMenuManager=createNewSubmenu(parent);
  addMenuManager.setParent(menuManager);
  menuManager.add(addMenuManager);
  MenuManager addArrayMenuManager=createNewArraySubmenu(parent);
  addArrayMenuManager.setParent(menuManager);
  menuManager.add(addArrayMenuManager);
}
 

Example 35

From project netifera, under directory /platform/com.netifera.platform.host/com.netifera.platform.host.filesystem.ui/src/com/netifera/platform/host/filesystem/ui/.

Source file: FileSystemView.java

  22 
vote

/** 
 * Initialise right-click menu, but does not display it. 
 */
private void createContextMenu(){
  MenuManager menuManager=new MenuManager("#PopupMenu");
  menuManager.setRemoveAllWhenShown(true);
  menuManager.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      fillContextMenu(manager);
    }
  }
);
  Menu menu=menuManager.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuManager,viewer);
}
 

Example 36

From project Newsreader, under directory /bundles/org.eclipse.ecf.salvo.application/src/org/eclipse/ecf/salvo/application/internal/.

Source file: ApplicationActionBarAdvisor.java

  22 
vote

@Override protected void fillMenuBar(IMenuManager menuBar){
  MenuManager fileMenu=new MenuManager("&File",IWorkbenchActionConstants.M_FILE);
  menuBar.add(fileMenu);
  fileMenu.add(aboutAction);
  fileMenu.add(preferenceAction);
  fileMenu.add(exitAction);
  MenuManager viewsMenu=new MenuManager("Show View",IWorkbenchActionConstants.M_VIEW);
  viewsMenu.add(showViewAction);
  fileMenu.add(viewsMenu);
  MenuManager helpMenu=new MenuManager("&Help",IWorkbenchActionConstants.M_HELP);
  menuBar.add(helpMenu);
  helpMenu.add(perspectiveAction);
}
 

Example 37

From project org.openscada.dakara, under directory /org.openscada.vi.model.editor/src/org/openscada/vi/model/VisualInterface/presentation/.

Source file: VisualInterfaceActionBarContributor.java

  22 
vote

/** 
 * This populates the pop-up menu before it appears. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager){
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager=null;
  submenuManager=new MenuManager(VisualInterfaceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager,createChildActions,null);
  menuManager.insertBefore("edit",submenuManager);
  submenuManager=new MenuManager(VisualInterfaceEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager,createSiblingActions,null);
  menuManager.insertBefore("edit",submenuManager);
}
 

Example 38

From project org.openscada.orilla, under directory /org.openscada.ae.ui.testing/src/org/openscada/ae/ui/testing/views/.

Source file: EventQueryView.java

  22 
vote

private void hookContextMenu(){
  final MenuManager menuMgr=new MenuManager("#PopupMenu",VIEW_ID);
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    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 39

From project org.openscada.othala, under directory /org.openscada.da.project/src/org/openscada/da/project/editor/realtimelist/.

Source file: RealtimeListEditor.java

  22 
vote

private void hookContextMenu(){
  final MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    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 40

From project radrails, under directory /plugins/com.aptana.rdt.profiling/src/com/aptana/rdt/internal/profiling/.

Source file: CallGraphView.java

  22 
vote

/** 
 * Creates and registers the context menu
 */
private void createPopupMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      manager.add(new OpenMethodCallAction(tree));
      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
  }
);
  Menu menu=menuMgr.createContextMenu(fViewer.getControl());
  fViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,fViewer);
}
 

Example 41

From project rcputils, under directory /de.ralfebert.rcputils/src/de/ralfebert/rcputils/menus/.

Source file: ContextMenu.java

  22 
vote

/** 
 * Creates an empty context menu for a structured viewer and registers it for the given workbench part site. The created menu is intended to be filled using contributions to "org.eclipse.ui.menus" with locationURI "popup:<viewid>". If defaultItemHandling = true,
 */
public ContextMenu(StructuredViewer viewer,final IWorkbenchPartSite site){
  this.viewer=viewer;
  this.site=site;
  MenuManager menuManager=new MenuManager();
  menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  this.menu=menuManager.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  site.registerContextMenu(menuManager,viewer);
  site.setSelectionProvider(viewer);
}
 

Example 42

From project samolisov-demo, under directory /Eclipse/RCP/Hyperbola/org.rcpbook.hyperbola.ui/src/org/rcpbook/hyperbola/ui/.

Source file: ApplicationWorkbenchWindowAdvisor.java

  22 
vote

private void hookPopupMenu(final IWorkbenchWindow window){
  trayItem.addListener(SWT.MenuDetect,new Listener(){
    public void handleEvent(    Event event){
      MenuManager trayMenu=new MenuManager();
      actionBarAdvisor.fillTrayItem(trayMenu);
      Menu menu=trayMenu.createContextMenu(window.getShell());
      menu.setVisible(true);
    }
  }
);
}
 

Example 43

From project savara-tools-eclipse, under directory /plugins/org.savara.tools.scenario/src/main/java/org/savara/tools/scenario/designer/editor/.

Source file: DesignerActionBarContributor.java

  22 
vote

public void contributeToMenu(IMenuManager menuManager){
  super.contributeToMenu(menuManager);
  MenuManager viewMenu=new MenuManager("View");
  viewMenu.add(getAction(GEFActionConstants.ZOOM_IN));
  viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT));
  menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT,viewMenu);
}
 

Example 44

From project scisoft-ui, under directory /uk.ac.diamond.scisoft/src/uk/ac/diamond/scisoft/feedback/.

Source file: FeedbackView.java

  22 
vote

private void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      FeedbackView.this.fillContextMenu(manager);
    }
  }
);
}
 

Example 45

From project bndtools, under directory /bndtools.core/src/bndtools/views/.

Source file: RepositoriesView.java

  21 
vote

void createContextMenu(){
  MenuManager mgr=new MenuManager();
  Menu menu=mgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  getSite().registerContextMenu(mgr,viewer);
  mgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      try {
        manager.removeAll();
        IStructuredSelection selection=(IStructuredSelection)viewer.getSelection();
        if (!selection.isEmpty()) {
          Object firstElement=selection.getFirstElement();
          if (firstElement instanceof Actionable) {
            Actionable act=(Actionable)firstElement;
            Map<String,Runnable> actions=act.actions();
            if (actions != null) {
              for (              final Entry<String,Runnable> e : actions.entrySet()) {
                final String label=e.getKey();
                final Action a=new Action(label){
                  @Override public void run(){
                    e.getValue().run();
                  }
                }
;
                manager.add(a);
              }
            }
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}
 

Example 46

From project BPMN2-Editor-for-Eclipse, under directory /org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/.

Source file: ImprovedAdvancedPropertiesComposite.java

  21 
vote

public void setSheetPage(TabbedPropertySheetPage aTabbedPropertySheetPage){
  this.aTabbedPropertySheetPage=aTabbedPropertySheetPage;
  MenuManager manager=new MenuManager("#PropertiesMenu");
  manager.setRemoveAllWhenShown(true);
  manager.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      ImprovedAdvancedPropertiesComposite.this.buildMenu((MenuManager)manager);
    }
  }
);
  Tree tree=treeViewer.getTree();
  Menu menu=manager.createContextMenu(tree);
  tree.setMenu(menu);
  aTabbedPropertySheetPage.getSite().registerContextMenu("#PropertiesMenu",manager,treeViewer);
}
 

Example 47

From project dawn-common, under directory /org.dawb.common.ui/src/org/dawb/common/ui/views/.

Source file: ImageMonitorView.java

  21 
vote

/** 
 * Create the actions.
 */
private void createActions(){
  final MenuManager menuManager=new MenuManager();
  gallery.setMenu(menuManager.createContextMenu(gallery));
  getSite().registerContextMenu(menuManager,null);
  final IToolBarManager man=getViewSite().getActionBars().getToolBarManager();
  final CheckableActionGroup grp=new CheckableActionGroup();
  final Action byDate=new Action("Sort by date, newest at the bottom",IAction.AS_CHECK_BOX){
    public void run(){
      currentComparitor=SortingUtils.DATE_SORT_BACKWARDS;
      refreshAll();
    }
  }
;
  byDate.setImageDescriptor(Activator.getImageDescriptor("icons/sortByDate.gif"));
  grp.add(byDate);
  man.add(byDate);
  byDate.setChecked(true);
  final Action byName=new Action("Sort by name",IAction.AS_CHECK_BOX){
    public void run(){
      currentComparitor=SortingUtils.NATURAL_SORT_CASE_INSENSITIVE;
      refreshAll();
    }
  }
;
  byName.setImageDescriptor(Activator.getImageDescriptor("icons/sortByName.gif"));
  grp.add(byName);
  man.add(byName);
  man.add(new Separator());
}
 

Example 48

From project dawn-ui, under directory /org.dawb.workbench.plotting/src/org/dawb/workbench/plotting/views/.

Source file: ToolPageSite.java

  21 
vote

/** 
 * Disposes of the menu extender contributions.
 */
protected void dispose(){
  if (menuExtenders != null) {
    HashSet managers=new HashSet(menuExtenders.size());
    for (int i=0; i < menuExtenders.size(); i++) {
      PopupMenuExtender ext=(PopupMenuExtender)menuExtenders.get(i);
      managers.add(ext.getManager());
      ext.dispose();
    }
    if (managers.size() > 0) {
      for (Iterator iterator=managers.iterator(); iterator.hasNext(); ) {
        MenuManager mgr=(MenuManager)iterator.next();
        mgr.dispose();
      }
    }
    menuExtenders=null;
  }
  subActionBars.dispose();
  serviceLocator.dispose();
}
 

Example 49

From project Eclipse, under directory /com.mobilesorcery.sdk.profiles.ui/src/com/mobilesorcery/sdk/profiles/ui/internal/.

Source file: ProfilesView.java

  21 
vote

private void initMenu(Control control){
  final MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      IStructuredSelection selection=(IStructuredSelection)profileTree.getSelection();
      if (selection.size() == 1 && selection.getFirstElement() instanceof IProfile) {
        menuMgr.add(setTargetAction);
        menuMgr.add(buildForProfile);
        menuMgr.add(new Separator());
        menuMgr.add(showProfileInfo);
      }
    }
  }
);
  control.setMenu(menuMgr.createContextMenu(control));
}
 

Example 50

From project eclipse-integration-cloudfoundry, under directory /org.cloudfoundry.ide.eclipse.server.ui/src/org/cloudfoundry/ide/eclipse/internal/server/ui/editor/.

Source file: ApplicationActionMenuControl.java

  21 
vote

public void createControl(){
  buttonComposite=toolkit != null ? toolkit.createComposite(parent,SWT.NONE) : new Composite(parent,SWT.NONE);
  GridLayoutFactory.fillDefaults().spacing(new Point(0,0)).numColumns(2).equalWidth(false).margins(0,0).applyTo(buttonComposite);
  applicationActionButton=createButton(buttonComposite,selectionButtonLabel,selectionButtonImage,SWT.FLAT);
  applicationActionButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      notifyListeners();
    }
  }
);
  GridDataFactory.fillDefaults().grab(true,false).align(SWT.END,SWT.BEGINNING).applyTo(applicationActionButton);
  setDefaultTooltipMessage();
  if (actions != null && actions.size() > 1) {
    final MenuManager viewMenuManager=new MenuManager();
    ToolBarManager manager=createToolBarManager(buttonComposite);
    toolBar=manager.getControl();
    viewMenuButton=new ToolItem(toolBar,SWT.PUSH,0);
    viewMenuButton.setImage(CloudFoundryImages.getImage(CloudFoundryImages.MENU_VIEW_ENABLED));
    viewMenuButton.setDisabledImage(CloudFoundryImages.getImage(CloudFoundryImages.MENU_VIEW_DISABLED));
    viewMenuButton.setToolTipText("Select mode");
    viewMenuButton.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        showViewMenu(viewMenuManager,toolBar);
      }
    }
);
    for (    ApplicationAction action : actions) {
      viewMenuManager.add(new MenuAction(action));
    }
  }
  setVisible(true);
}
 

Example 51

From project eclipse.platform.runtime, under directory /bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/.

Source file: BaseTextView.java

  21 
vote

public void createPartControl(Composite parent){
  viewer=new TextViewer(parent,SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
  viewer.setDocument(new Document());
  IActionBars bars=getViewSite().getActionBars();
  GlobalAction selectAllAction=new SelectAllAction(viewer);
  selectAllAction.registerAsGlobalAction(bars);
  GlobalAction copyAction=new CopyTextSelectionAction(viewer);
  copyAction.registerAsGlobalAction(bars);
  bars.updateActionBars();
  MenuManager menuMgr=new MenuManager();
  menuMgr.add(copyAction);
  menuMgr.add(selectAllAction);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
}
 

Example 52

From project eclipsefp, under directory /net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/.

Source file: HaskellEditor.java

  21 
vote

@Override public void editorContextMenuAboutToShow(final IMenuManager menu){
  super.editorContextMenuAboutToShow(menu);
  if (isEditable()) {
    IMenuManager mmSource=new MenuManager("Source","source");
    menu.prependToGroup(ITextEditorActionConstants.GROUP_EDIT,mmSource);
    mmSource.add(new Separator("comments"));
    mmSource.add(new Separator("formatting"));
    mmSource.add(new Separator("organize"));
    addAction(mmSource,"comments","Comment");
    addAction(mmSource,"comments","Uncomment");
  }
}
 

Example 53

From project egit-github, under directory /org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/.

Source file: IssueLabelAttributeEditor.java

  21 
vote

private void refreshLabels(){
  for (  CLabel labelControl : this.labelControls)   labelControl.dispose();
  this.labelControls.clear();
  Image labelImage=GitHubImages.get(GitHubImages.GITHUB_ISSUE_LABEL_OBJ);
  List<String> labels=new LinkedList<String>(getTaskAttribute().getValues());
  Collections.sort(labels,this.labelComparator);
  if (!labels.isEmpty())   for (  final String label : labels) {
    CLabel cLabel=new CLabel(labelsArea,SWT.NONE);
    MenuManager manager=new MenuManager();
    manager.setRemoveAllWhenShown(true);
    manager.addMenuListener(new IMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        manager.add(new RemoveLabelAction(label));
      }
    }
);
    Menu menu=manager.createContextMenu(cLabel);
    cLabel.setMenu(menu);
    String shortened=TaskDiffUtil.shortenText(displayArea,label,LABEL_WIDTH);
    cLabel.setImage(labelImage);
    cLabel.setText(shortened);
    cLabel.setForeground(toolkit.getColors().getForeground());
    if (!shortened.equals(label))     cLabel.setToolTipText(label);
    this.labelControls.add(cLabel);
  }
 else   this.labelControls.add(new CLabel(labelsArea,SWT.NONE));
  if (this.layout)   displayArea.getParent().getParent().layout(true,true);
}
 

Example 54

From project eik, under directory /plugins/info.evanchik.eclipse.karaf.workbench/src/main/java/info/evanchik/eclipse/karaf/workbench/ui/views/bundle/.

Source file: BundlesView.java

  21 
vote

protected void initContextMenu(){
  final MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    final IMenuManager manager){
      menuMgr.add(propertiesAction);
      menuMgr.add(new Separator());
      menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
  }
);
  final Menu menu=menuMgr.createContextMenu(treeTableViewer.getControl());
  treeTableViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,treeTableViewer);
}
 

Example 55

From project grails-ide, under directory /org.grails.ide.eclipse.explorer/src/org/grails/ide/eclipse/actions/.

Source file: GrailsRefactorActionGroup.java

  21 
vote

private void addRefactorSubmenu(IMenuManager menu){
  MenuManager refactorSubmenu=new MenuManager(ActionMessages.RefactorMenu_label,MENU_ID);
  refactorSubmenu.setActionDefinitionId(QUICK_MENU_ID);
  if (fEditor != null) {
    final ITypeRoot element=getEditorInput();
    if (element != null && ActionUtil.isOnBuildPath(element)) {
      refactorSubmenu.addMenuListener(new IMenuListener(){
        public void menuAboutToShow(        IMenuManager manager){
          refactorMenuShown(manager);
        }
      }
);
      refactorSubmenu.add(fNoActionAvailable);
      menu.appendToGroup(fGroupName,refactorSubmenu);
    }
  }
 else {
    ISelection selection=fSelectionProvider.getSelection();
    for (Iterator iter=fActions.iterator(); iter.hasNext(); ) {
      ((SelectionDispatchAction)iter.next()).update(selection);
    }
    if (fillRefactorMenu(refactorSubmenu) > 0)     menu.appendToGroup(fGroupName,refactorSubmenu);
  }
}
 

Example 56

From project mylyn.context, under directory /org.eclipse.mylyn.context.tasks.ui/src/org/eclipse/mylyn/internal/context/tasks/ui/editors/.

Source file: ContextEditorFormPage.java

  21 
vote

private void hookContextMenu(){
  MenuManager menuManager=new MenuManager("#PopupMenu"){
    private final IMenuListener listener=new IMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        fillContextMenu(manager);
      }
    }
;
{
      addMenuListener(listener);
    }
    @Override public void addMenuListener(    IMenuListener listener){
      super.removeMenuListener(this.listener);
      super.addMenuListener(listener);
      super.addMenuListener(this.listener);
    }
  }
;
  Menu menu=menuManager.createContextMenu(commonViewer.getControl());
  commonViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuManager,commonViewer);
}
 

Example 57

From project phing-eclipse, under directory /org.ganoro.phing.ui/src/org/ganoro/phing/ui/editors/outline/.

Source file: AntEditorContentOutlinePage.java

  21 
vote

/** 
 * Creates the control (outline view) for this page
 */
public void createControl(Composite parent){
  super.createControl(parent);
  TreeViewer viewer=getTreeViewer();
  viewer.setContentProvider(new AntModelContentProvider());
  setSort(fSort);
  viewer.setLabelProvider(new AntModelLabelProvider());
  viewer.addFilter(new AntOutlineFilter());
  if (fModel != null) {
    setViewerInput(fModel);
  }
  MenuManager manager=new MenuManager("#PopUp");
  manager.setRemoveAllWhenShown(true);
  manager.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager menuManager){
      contextMenuAboutToShow(menuManager);
    }
  }
);
  fMenu=manager.createContextMenu(viewer.getTree());
  viewer.getTree().setMenu(fMenu);
  IPageSite site=getSite();
  site.registerContextMenu(IAntUIConstants.PLUGIN_ID + ".antEditorOutline",manager,viewer);
  IToolBarManager tbm=site.getActionBars().getToolBarManager();
  tbm.add(new ToggleSortAntOutlineAction(this));
  tbm.add(new FilterInternalTargetsAction(this));
  tbm.add(new FilterPropertiesAction(this));
  tbm.add(new FilterImportedElementsAction(this));
  tbm.add(new FilterTopLevelAction(this));
  IMenuManager viewMenu=site.getActionBars().getMenuManager();
  viewMenu.add(new ToggleLinkWithEditorAction(fEditor));
  viewer.addPostSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      firePostSelectionChanged(event.getSelection());
    }
  }
);
}
 

Example 58

From project rascal-eclipse, under directory /src/org/rascalmpl/eclipse/editor/.

Source file: ActionsContributor.java

  21 
vote

@Override public void contributeToEditorMenu(UniversalEditor editor,IMenuManager menuManager){
  menuManager.add(new StartConsole(editor));
  menuManager.add(new CopyToConsole(editor));
  menuManager.add(new ImportInConsole(editor));
  MenuManager exp=new SubMenu(menuManager,"Experimental");
  exp.add(new RunTests(editor));
  exp.add(new RunAmbiDexter(editor));
  exp.add(new ListAmbiguities(editor));
  exp.add(new RunStaticChecker(editor));
  exp.add(new ReloadStaticChecker(editor));
  MenuManager devel=new SubMenu(menuManager,"Developers");
  devel.add(new ResetProjectState(editor));
  devel.add(new TextTree(editor));
  devel.add(new BrowseTree(editor));
}
 

Example 59

From project RegexUtil, under directory /RegexUtil/src/com/ess/regexutil/views/.

Source file: RegexEditor.java

  21 
vote

public RegexEditor(Composite parent,int style,Flags flags,final IAction[] actions){
  super(parent,SWT.SINGLE | style);
  setFont(new Font(Display.getDefault(),"Courier New",10,0));
  adapter=new SWTAdapter(this);
  highlighter=new RegexHighlighter(adapter,flags);
  MenuManager menuMgr=new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      for (      IAction action : actions) {
        manager.add(action);
      }
    }
  }
);
  Menu menu=menuMgr.createContextMenu(this);
  this.setMenu(menu);
}
 

Example 60

From project sandbox, under directory /xeclipse/org.xwiki.eclipse.rcp/src/main/java/org/xwiki/eclipse/rcp/.

Source file: ApplicationActionBarAdvisor.java

  21 
vote

protected void fillMenuBar(IMenuManager menuBar){
  MenuManager fileMenu=new MenuManager("File","org.xwiki.xeclipse.menu.File");
  menuBar.add(fileMenu);
  MenuManager editMenu=new MenuManager("Edit","org.xwiki.xeclipse.menu.Edit");
  menuBar.add(editMenu);
  MenuManager windowMenu=new MenuManager("Window","org.xwiki.xeclipse.menu.Window");
  MenuManager showViewMenu=new MenuManager("Show view","org.xwiki.xeclipse.menu.ShowView");
  for (  Action action : showViewActions) {
    showViewMenu.add(action);
  }
  windowMenu.add(showViewMenu);
  windowMenu.add(preferencesAction);
  menuBar.add(windowMenu);
  MenuManager helpMenu=new MenuManager("Help","org.xwiki.xeclipse.menu.Help");
  menuBar.add(helpMenu);
}
 

Example 61

From project dawn-tango, under directory /org.dawb.tango.extensions/src/org/dawb/tango/extensions/editors/.

Source file: MultiScanEditor.java

  20 
vote

@Override public void createPartControl(final Composite parent){
  final Composite main=new Composite(parent,SWT.NONE);
  final GridLayout gridLayout=new GridLayout(1,false);
  main.setLayout(gridLayout);
  GridUtils.removeMargins(main);
  final Composite tools=new Composite(main,SWT.RIGHT);
  tools.setLayout(new GridLayout(2,false));
  GridUtils.removeMargins(tools);
  tools.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,true,false));
  ToolBarManager toolMan=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  final ToolBar toolBar=toolMan.createControl(tools);
  toolBar.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false));
  ToolBarManager extraMan=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  final ToolBar extraBar=extraMan.createControl(tools);
  extraBar.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false));
  this.menuMan=new MenuManager();
  final IActionBars bars=this.getEditorSite().getActionBars();
  ActionBarWrapper wrapper=new ActionBarWrapper(toolMan,null,null,(IActionBars2)bars);
  createCustomMenuBarActionsRight(menuMan);
  createCustomToolbarActionsRight(extraMan);
  Action menuAction=new Action("",Activator.imageDescriptorFromPlugin("icons/DropDown.png")){
    @Override public void run(){
      final Menu mbar=menuMan.createContextMenu(extraBar);
      mbar.setVisible(true);
    }
  }
;
  extraMan.add(menuAction);
  this.plot=new Composite(main,SWT.BORDER);
  plot.setLayout(new FillLayout());
  plot.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  final String plotName=this.getEditorInput().getName();
  plottingSystem.createPlotPart(plot,plotName,wrapper,PlotType.PT1D,this);
  if (toolMan != null)   toolMan.update(true);
  if (extraMan != null)   extraMan.update(true);
}
 

Example 62

From project incubator, under directory /net.karlmartens.ui/src/net/karlmartens/ui/widget/.

Source file: FilterGroupContribution.java

  20 
vote

@Override protected IContributionItem[] getContributionItems(){
  if (_columnIndex < 0 || _columnIndex >= _table.getColumnCount())   return new IContributionItem[0];
  final TableColumn column=_table.getColumn(_columnIndex);
  if (!column.isFilterable())   return new IContributionItem[0];
  final IMenuManager menu=new MenuManager(_menuText);
  final IAction allAction=new FilterColumnAction(column,_allText,Filter.<TableItem>all());
  menu.add(new ActionContributionItem(allAction));
  final TableItem[] items=_table.getItems();
  Arrays.sort(items,new TableItemSorter(_columnIndex));
  final int from=Math.max(items.length - 10,0);
  final int to=from + Math.min(10,items.length);
  final TableItem[] topTen=Arrays.copyOfRange(items,from,to);
  final IAction topTenFilter=new FilterColumnAction(column,_topTextText,Filter.accepting(topTen));
  menu.add(new ActionContributionItem(topTenFilter));
  menu.add(new Separator());
  String lastValue=null;
  final Set<TableItem> acceptedItems=new HashSet<TableItem>();
  for (  TableItem item : items) {
    final String value=item.getText(_columnIndex);
    if (!NullSafe.equals(lastValue,value)) {
      if (!acceptedItems.isEmpty()) {
        final TableItem[] arr=acceptedItems.toArray(new TableItem[0]);
        final IAction action=new FilterColumnAction(column,lastValue,Filter.accepting(arr));
        menu.add(new ActionContributionItem(action));
      }
      lastValue=value;
      acceptedItems.clear();
    }
    acceptedItems.add(item);
  }
  if (!acceptedItems.isEmpty()) {
    final TableItem[] arr=acceptedItems.toArray(new TableItem[0]);
    final IAction action=new FilterColumnAction(column,lastValue,Filter.accepting(arr));
    menu.add(new ActionContributionItem(action));
  }
  menu.update();
  return new IContributionItem[]{menu};
}
 

Example 63

From project JGit, under directory /org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/.

Source file: GitHistoryPage.java

  20 
vote

@Override public void createControl(final Composite parent){
  GridData gd;
  prefs=Activator.getDefault().getPluginPreferences();
  ourControl=createMainPanel(parent);
  gd=new GridData();
  gd.verticalAlignment=SWT.FILL;
  gd.horizontalAlignment=SWT.FILL;
  gd.grabExcessHorizontalSpace=true;
  gd.grabExcessVerticalSpace=true;
  ourControl.setLayoutData(gd);
  gd=new GridData();
  gd.verticalAlignment=SWT.FILL;
  gd.horizontalAlignment=SWT.FILL;
  gd.grabExcessHorizontalSpace=true;
  gd.grabExcessVerticalSpace=true;
  graphDetailSplit=new SashForm(ourControl,SWT.VERTICAL);
  graphDetailSplit.setLayoutData(gd);
  graph=new CommitGraphTable(graphDetailSplit);
  revInfoSplit=new SashForm(graphDetailSplit,SWT.HORIZONTAL);
  commentViewer=new CommitMessageViewer(revInfoSplit);
  fileViewer=new CommitFileDiffViewer(revInfoSplit);
  findToolbar=new FindToolbar(ourControl);
  layoutSashForm(graphDetailSplit,SPLIT_GRAPH);
  layoutSashForm(revInfoSplit,SPLIT_INFO);
  revObjectSelectionProvider=new RevObjectSelectionProvider();
  popupMgr=new MenuManager(null,POPUP_ID);
  attachCommitSelectionChanged();
  createLocalToolbarActions();
  createResourceFilterActions();
  createStandardActions();
  createViewMenu();
  finishContextMenu();
  attachContextMenu(graph.getControl());
  attachContextMenu(commentViewer.getControl());
  attachContextMenu(fileViewer.getControl());
  layout();
  Repository.addAnyRepositoryChangedListener(this);
}
 

Example 64

From project dawn-product, under directory /org.dawb.workbench.application/src/org/edna/workbench/application/.

Source file: ApplicationActionBarAdvisor.java

  19 
vote

/** 
 * Adds the perspective actions to the specified menu.
 */
private void addPerspectiveActions(MenuManager menu){
  menu.add(perspectiveCustomizeAction);
  menu.add(perspectiveSaveAsAction);
  menu.add(perspectiveResetAction);
  menu.add(perspectiveCloseAction);
  menu.add(perspectiveCloseAllAction);
}