Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.MenuManager


          listener = null;
      }
  }

  private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
      public void menuAboutToShow(IMenuManager manager) {
        JcrPropertiesView.this.fillContextMenu(manager);
      }
    });
    Menu menu = menuMgr.createContextMenu(viewer.getControl());
    viewer.getControl().setMenu(menu);
    IWorkbenchPartSite site = getSite();
    if (site!=null) {
        site.registerContextMenu(menuMgr, viewer);
    }
View Full Code Here


    MeclipsePlugin.getDefault().setMongoDbView(this);
  }

  private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
      public void menuAboutToShow(IMenuManager manager) {

        IStructuredSelection selection = (IStructuredSelection) viewer
            .getSelection();

        if (selection.isEmpty()) {
          MeclipseView.this.fillContextMenu(manager);
          return;
        }
        TreeObject obj = (TreeObject) selection.getFirstElement();

        manager.add(new Separator());
        obj.fillContextMenu(manager);

      }
    });
    Menu menu = menuMgr.createContextMenu(viewer.getControl());
    viewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, viewer);
  }
View Full Code Here

    hookContextMenu();

  }

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

    Menu menuRegExp = menuMgr.createContextMenu(regExpText);
    regExpText.setMenu(menuRegExp);

    Menu menuMatch = menuMgr.createContextMenu(matchText);
    matchText.setMenu(menuMatch);
    //getSite().registerContextMenu(menuMgr, );
  }
View Full Code Here

    colorTable.add(new Color(display, 214, 179, 74));
    colorTable.add(new Color(display, 204, 74, 214));
  }

  private void createShortcutsMenu(IMenuManager mgr) {
    IMenuManager submenu = new MenuManager("Shortcuts");
    mgr.add(submenu);

    Action shortcut;

    try {
       InputStream is = getClass().getResourceAsStream(SHORTCUTS_FILE);
     
      BufferedReader br = new BufferedReader(new InputStreamReader(is));

      String line;

      while ((line = br.readLine()) != null) {
        StringTokenizer st = new StringTokenizer(line, "\t");

        if (st.countTokens() == 2) {

          final String shortc = st.nextToken();
          String descr = st.nextToken();

          shortcut = new Action() {
            public void run() {
              insertShortcut(shortc);
            }
          };

          shortcut.setText(shortc + " - " + descr);
          submenu.add(shortcut);
          //}

          mgr.update(true);
        } else if (st.countTokens() == 1) {
          String token = st.nextToken();
          if (token.equals("<DEL>")) {
            submenu.add(new Separator());
          }
        }
      }
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

            }
        });
    }

    private void hookContextMenu() {
        final MenuManager menuMgr = new MenuManager("#PopupMenu");
        final Menu menu = menuMgr.createContextMenu(viewer.getControl());
        viewer.getControl().setMenu(menu);
        getSite().registerContextMenu(menuMgr, viewer);
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(new IMenuListener() {

            @Override
            public void menuAboutToShow(final IMenuManager manager) {
                ProcessListView.this.fillContextMenu(manager);
            }
View Full Code Here

        addAction(action, manager);
    }

    @Override
    public void fillContextMenu(final IMenuManager manager) {
        final MenuManager erlangSearchMM = new MenuManager(getName(),
                IContextMenuConstants.GROUP_SEARCH);
        addAction(fFindReferencesAction, erlangSearchMM);
        addAction(fFindReferencesInProjectAction, erlangSearchMM);

        erlangSearchMM.add(new Separator());

        for (final IWorkingSet[] i : SearchUtil.getLRUWorkingSets().getSorted()) {
            addWorkingSetAction(i, erlangSearchMM);
        }
        addAction(fFindReferencesInWorkingSetAction, erlangSearchMM);

        if (!erlangSearchMM.isEmpty()) {
            manager.appendToGroup(fGroupId, erlangSearchMM);
        }
    }
View Full Code Here

        colPercentage.setWidth(150);

    }

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

    /**
     * Creates the context menu for this view.
     */
    protected void createContextMenu() {
        final MenuManager menuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
        menuManager.setRemoveAllWhenShown(true);
        menuManager.addMenuListener(this);
        final Menu contextMenu = menuManager.createContextMenu(getControl());
        getControl().setMenu(contextMenu);
    }
View Full Code Here

        hookDoubleClickAction();
        contributeToActionBars();
    }

    private void hookContextMenu() {
        final MenuManager menuMgr = new MenuManager("#PopupMenu");
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(new IMenuListener() {

            @Override
            public void menuAboutToShow(final IMenuManager manager) {
                TraceLogView.this.fillContextMenu(manager);
            }
        });
        final Menu menu = menuMgr.createContextMenu(viewer.getControl());
        viewer.getControl().setMenu(menu);
        getSite().registerContextMenu(menuMgr, viewer);
    }
View Full Code Here

        final IContextService service = (IContextService) site
                .getService(IContextService.class);
        service.activateContext("org.erlide.ui.erlangOutlineAndNavigatorScope");

        final MenuManager manager = new MenuManager();
        manager.setRemoveAllWhenShown(true);
        manager.addMenuListener(new IMenuListener() {
            @Override
            public void menuAboutToShow(final IMenuManager m) {
                // recursive loop?
                // menuAboutToShow(m);
                contextMenuAboutToShow(m);
            }
        });
        final Menu menu = manager.createContextMenu(tree);
        tree.setMenu(menu);

        site.registerContextMenu(ErlangCore.PLUGIN_ID + ".outline", manager,
                fOutlineViewer);
        fActionGroups = new CompositeActionGroup(
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.MenuManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.