Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.GroupMarker


    protected void configureToolBar(IToolBarManager tbm) {
        tbm.add(getAction("ShowLogicalStructure"));
    }

    protected void fillContextMenu(IMenuManager menu) {
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    }
View Full Code Here


            Event causeEvent = selected.getCauseEvent();
            if (causeEvent != null) {
                menu.add(getAction("ShowEventCause"));
            }
        }
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    }
View Full Code Here

    protected void configureToolBar(IToolBarManager tbm) {
        tbm.add(getAction("ShowLogicalStructure"));
    }

    protected void fillContextMenu(IMenuManager menu) {
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    }
View Full Code Here

  private IContributionItem createSeparatorAdditionContribution(
      final IConfigurationElement sepAddition) {
    if (isSeparatorVisible(sepAddition)) {
      return new Separator(getName(sepAddition));
    }
    return new GroupMarker(getName(sepAddition));
  }
View Full Code Here

        MenuManager fileMenu = new MenuManager("&Qpid Manager", "qpidmanager");
        MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
       
        menuBar.add(fileMenu);
        // Add a group marker indicating where action set menus will appear.
        menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        menuBar.add(helpMenu);
       
        fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        fileMenu.add(new Separator());
        fileMenu.add(new GroupMarker("mbeanactions"));
        fileMenu.add(new Separator());
        fileMenu.add(exitAction);
       
        // Help
        helpMenu.add(_aboutAction);
View Full Code Here

    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() {

            @Override
View Full Code Here

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

        // Populating File Menu
        fileMenu.add( newAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.NEW_EXT ) );
        fileMenu.add( openFileAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.OPEN_EXT ) );
        fileMenu.add( new Separator() );
        fileMenu.add( closeAction );
        fileMenu.add( closeAllAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.CLOSE_EXT ) );
        fileMenu.add( new Separator() );
        fileMenu.add( saveAction );
        fileMenu.add( saveAsAction );
        fileMenu.add( saveAllAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.SAVE_EXT ) );
        fileMenu.add( new Separator() );
        fileMenu.add( refreshAction );
        fileMenu.add( new Separator() );
        fileMenu.add( printAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.PRINT_EXT ) );
        fileMenu.add( new Separator() );
        fileMenu.add( importAction );
        fileMenu.add( exportAction );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.IMPORT_EXT ) );
        fileMenu.add( new Separator() );
        fileMenu.add( propertiesAction );
        fileMenu.add( reopenEditorsList );
        fileMenu.add( new GroupMarker( IWorkbenchActionConstants.MRU ) );
        if ( ApplicationActionBarAdvisor.OS_MACOSX.equalsIgnoreCase( os ) )
        {
            // We hide the exit (quit) action, it will be added by the "Carbon" plugin
            hiddenMenu.add( exitAction );
        }
        else
        {
            fileMenu.add( new Separator() );
            fileMenu.add( exitAction );
        }

        // Populating Edit Menu
        editMenu.add( undoAction );
        editMenu.add( redoAction );
        editMenu.add( new Separator() );
        editMenu.add( cutAction );
        editMenu.add( copyAction );
        editMenu.add( pasteAction );
        editMenu.add( new Separator() );
        editMenu.add( deleteAction );
        editMenu.add( selectAllAction );
        editMenu.add( new Separator() );
        editMenu.add( moveAction );
        editMenu.add( renameAction );
        editMenu.add( new Separator() );
        editMenu.add( findAction );

        // Populating Navigate Menu
        navigateMenu.add( nextAction );
        navigateMenu.add( previousAction );
        navigateMenu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
        navigateMenu.add( new GroupMarker( IWorkbenchActionConstants.NAV_END ) );
        navigateMenu.add( new Separator() );
        navigateMenu.add( backwardHistoryAction );
        navigateMenu.add( forwardHistoryAction );

        // Window
View Full Code Here

        toolbar.add( printAction );
        toolbar.add( preferencesAction );
        coolBar.add( new ToolBarContributionItem( toolbar, Application.PLUGIN_ID + ".toolbar" ) ); //$NON-NLS-1$

        // add marker for additions
        coolBar.add( new GroupMarker( IWorkbenchActionConstants.MB_ADDITIONS ) );

        // add navigation tool bar
        // some actions are added from org.eclipse.ui.editor to the HISTORY_GROUP
        IToolBarManager navToolBar = new ToolBarManager( SWT.FLAT | SWT.RIGHT );
        navToolBar.add( new Separator( IWorkbenchActionConstants.HISTORY_GROUP ) );
View Full Code Here

        IContextService contextService = (IContextService) workbench.getService(IContextService.class);
        Collection<String> active = (Collection<String> )contextService.getActiveContextIds();
       
        MenuManager actionMenu = new MenuManager(name, id);
        final String actionExt = "action.ext";
    actionMenu.add(new GroupMarker(actionExt)); //$NON-NLS-1$
        actionMenu.add(new GroupMarker("modal.ext")); //$NON-NLS-1$
        for( ModalItem item : this ) {
            ToolProxy tool = (ToolProxy) item;
            String categoryId = tool.getCategoryId();
            if( contextService.getDefinedContextIds().contains(categoryId)){
                // we have an context for this tool category
                if( !active.contains( categoryId )){
                    continue; // skip this category please!
                }               
            }
            if (tool.getType() == ToolProxy.ACTION) {               
                String menuPath = tool.getMenuPath();
                IAction action = tool.getAction();
               
                if (menuPath != null) {
                    String root = menuPath.substring(0, menuPath.lastIndexOf("/")); //$NON-NLS-1$
                    String groupName = menuPath.substring(
                            menuPath.lastIndexOf("/") + 1, menuPath.length()); //$NON-NLS-1$
                    if( groupName.equals( Constants.M_TOOL)){
                        groupName = "map";
                    }
                    IMenuManager targetMenu = manager.findMenuUsingPath(root);
                    if (targetMenu != null) {
                        IContributionItem find = targetMenu.find(groupName);
                        if ( find!=null && find instanceof GroupMarker ){
                            //targetMenu.appendToGroup(groupName, action); //$NON-NLS-1$
                            targetMenu.appendToGroup(groupName, tool.getAction());
                            targetMenu.setVisible(true);
                        }else{
                            targetMenu.add(action);
                            targetMenu.setVisible(true);
                        }
                    } else
                        actionMenu.appendToGroup(actionExt, tool.getAction()); //$NON-NLS-1$
                } else {
                    actionMenu.appendToGroup(actionExt, tool.getAction()); //$NON-NLS-1$
                }
            }
            if (tool.getType() == ToolProxy.MODAL) {
                MenuCurrentToolItem menuItem = new MenuCurrentToolItem(tool);
                tool.addContribution(menuItem);
                actionMenu.appendToGroup("modal.ext", menuItem); //$NON-NLS-1$
            }
        }
        if (actionMenu.getItems().length > 0) {
            // Handle left over tools! Place them in the map menu?
            String menuPath = "map"; // was Constants.M_TOOL
            IMenuManager toolManager = manager.findMenuUsingPath( menuPath );
            if( toolManager==null ){
                toolManager=new MenuManager(Messages.MenuToolCategory_menu_manager_title,"tools"); //$NON-NLS-1$
                manager.add(toolManager);
                toolManager.add(new GroupMarker(actionExt)); //$NON-NLS-1$
                toolManager.add(new GroupMarker("modal.ext")); //$NON-NLS-1$
            }
            if( toolManager.find(actionExt)==null ){
              toolManager.add(new GroupMarker(actionExt)); //$NON-NLS-1$
            }
            toolManager.appendToGroup(actionExt, actionMenu); //$NON-NLS-1$
            toolManager.setVisible(true);
        }
    }
View Full Code Here

    }

    private void createToolBar() {
        IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();

        mgr.add(new GroupMarker(CHOOSER_MENU_GROUP));
        mgr.appendToGroup(CHOOSER_MENU_GROUP, new ControlContribution("none"){ //$NON-NLS-1$
                    protected Control createControl( Composite parent ) {
                        configChooser = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);

                        // update the chooser with the currently selected layer
                        //
                        updateChooser();

                        configChooser.addSelectionListener(chooserListener);

                        // setFocus();
                        // updateChooser();
                        /*
                         * XXX Justin what are you doing?
                         * PlatformUI.getWorkbench().getDisplay().asyncExec( new Runnable() { public
                         * void run() { chooserListener.widgetSelected(null); } } );
                         */
                        return configChooser;
                    }

                    protected int computeWidth( Control control ) {
                        return 125;
                    }
                });
        mgr.add(new GroupMarker(STYLE_MENU_GROUP));
        mgr.appendToGroup(STYLE_MENU_GROUP, new Separator());
        mgr.appendToGroup(STYLE_MENU_GROUP, applyAction);
        mgr.appendToGroup(STYLE_MENU_GROUP, cancelAction);

        mgr.add(new GroupMarker(CONFIG_MENU_GROUP));
        mgr.add(new Separator());
    }
View Full Code Here

TOP

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

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.