Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.GroupMarker


        if (newMenu == null) {
            newMenu = new MenuManager(Messages.UDIGWorkbenchAdvisor_new, ActionFactory.NEW.getId());
            fileMenu.insertAfter(Constants.FILE_START, newMenu);
        }

        newMenu.add(new GroupMarker(Constants.NEW_START));

        List<IConfigurationElement> list = ExtensionPointList
                .getExtensionPointList(NewObjectContribution.NEW_ACTION_ID);
        Collections.sort(list, new NewObjectDelegateComparator());
        for( IConfigurationElement element : list ) {
            final NewObjectDelegate item = new NewObjectDelegate(element, window);
            Action newAction = new Action(){
                @Override
                public void runWithEvent( org.eclipse.swt.widgets.Event event ) {
                    item.runAction();
                }
            };
            newAction.setText(item.text);
            newAction.setImageDescriptor(item.icon);
            newMenu.appendToGroup(Constants.NEW_START, newAction);
        }
        newMenu.add(ContributionItemFactory.NEW_WIZARD_SHORTLIST.create(window));

        if (fileMenu.findUsingPath(ActionFactory.CLOSE.getId()) == null) {
            IAction close = ActionFactory.CLOSE.create(window);
            fileMenu.insertAfter(Constants.CLOSE_EXT, close);
        }

        if (fileMenu.findUsingPath(ActionFactory.CLOSE_ALL.getId()) == null) {
            IAction closeAll = ActionFactory.CLOSE_ALL.create(window);
            fileMenu.insertAfter(ActionFactory.CLOSE.getId(), closeAll);
        }

        if (fileMenu.findUsingPath(ActionFactory.SAVE.getId()) == null) {
            IAction save = ActionFactory.SAVE.create(window);
            fileMenu.insertBefore(Constants.SAVE_EXT, save);
        }

        if (fileMenu.findUsingPath(ActionFactory.SAVE_ALL.getId()) == null) {
            IAction saveAll = ActionFactory.SAVE_ALL.create(window);
            fileMenu.insertBefore(Constants.SAVE_EXT, saveAll);
        }

        //fileMenu.insertAfter(Constants.SAVE_EXT, new GroupMarker(Constants.REVERT_EXT));
        fileMenu.insertAfter(Constants.SAVE_EXT, new GroupMarker(Constants.COMMIT_EXT));

        fileMenu.insertBefore(Constants.FILE_END, new GroupMarker(Constants.RENAME_EXT));
        fileMenu.insertAfter(Constants.RENAME_EXT, new Separator());

        if (fileMenu.findUsingPath(ActionFactory.REFRESH.getId()) == null) {
            fileMenu.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, new GroupMarker(
                    ActionFactory.REFRESH.getId()));
        }

        if (fileMenu.findUsingPath(ActionFactory.IMPORT.getId()) == null) {
            IAction _import = ActionFactory.IMPORT.create(window);
            fileMenu.insertBefore(Constants.FILE_END, _import);
            fileMenu.insertAfter(ActionFactory.IMPORT.getId(), new Separator());
        }

        if (fileMenu.findUsingPath(ActionFactory.EXPORT.getId()) == null) {
            IAction _export = ActionFactory.EXPORT.create(window);
            fileMenu.insertBefore(Constants.FILE_END, _export);
            fileMenu.insertAfter(ActionFactory.EXPORT.getId(), new Separator());
        }

        fileMenu.insertBefore(Constants.FILE_END, new GroupMarker(Constants.CONFIG_EXT));
        fileMenu.insertAfter(Constants.CONFIG_EXT, new Separator());

        if (fileMenu.findUsingPath(ActionFactory.QUIT.getId()) == null) {
            IAction exit = ActionFactory.QUIT.create(window);
            fileMenu.insertAfter(Constants.FILE_END, exit);
View Full Code Here


    }

    private void fillEditMenu( IWorkbenchWindow window, IMenuManager editMenu ) {
        if (editMenu.findUsingPath(Constants.EDIT_START) == null) {
            if (editMenu.getItems().length > 0) {
                editMenu.insertBefore(editMenu.getItems()[0].getId(), new GroupMarker(
                        Constants.EDIT_START));
            } else {
                editMenu.add(new GroupMarker(Constants.EDIT_START));
            }
        }

        if (editMenu.findUsingPath(Constants.UNDO_EXT) == null) {
            editMenu.insertAfter(Constants.EDIT_START, new GroupMarker(Constants.UNDO_EXT));
        }

        if (editMenu.findUsingPath(Constants.CUT_EXT) == null) {
            editMenu.insertAfter(Constants.UNDO_EXT, new GroupMarker(Constants.CUT_EXT));
        }

        if (editMenu.findUsingPath(Constants.ADD_EXT) == null) {
            editMenu.insertAfter(Constants.CUT_EXT, new GroupMarker(Constants.ADD_EXT));
        }

        if (editMenu.findUsingPath(Constants.EDIT_END) == null) {
            editMenu.insertAfter(Constants.ADD_EXT, new GroupMarker(Constants.EDIT_END));
        }
        if (editMenu.findUsingPath(IWorkbenchActionConstants.MB_ADDITIONS) == null) {
            editMenu.insertAfter(Constants.EDIT_END, new GroupMarker(
                    IWorkbenchActionConstants.MB_ADDITIONS));
        }

        editMenu.appendToGroup(Constants.UNDO_EXT, ActionFactory.UNDO.create(window));
        editMenu.appendToGroup(Constants.UNDO_EXT, ActionFactory.REDO.create(window));
View Full Code Here

    }

    private IMenuManager createLayerMenu() {
        MenuManager menu = new MenuManager(Messages.UDIGWorkbenchAdvisor_layerMenu,
                Constants.M_LAYER);
        menu.add(new GroupMarker(Constants.LAYER_ADD_EXT));
        menu.add(new Separator());
        menu.add(new GroupMarker(Constants.LAYER_EDIT_EXT));
        menu.add(new Separator());
        menu.add(new GroupMarker(Constants.LAYER_MAPGRAPHIC_EXT));
        menu.add(new GroupMarker(Constants.LAYER_MAPGRAPHIC_OTHER));

        menu.add(new Separator());
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

        return menu;
    }
View Full Code Here

    private IMenuManager createNavigationMenu() {
        MenuManager menu = new MenuManager(Messages.UDIGWorkbenchAdvisor_navigationMenu,
                Constants.M_NAVIGATE);
        // menu.add(ActionFactory.BACKWARD_HISTORY.create(window));
        // menu.add(ActionFactory.FORWARD_HISTORY.create(window));
        menu.add(new GroupMarker(Constants.NAV_START));
        menu.add(new Separator());
        menu.add(new GroupMarker(Constants.NAV_ZOOM_EXT));

        menu.add(new Separator());
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

        menu.add(new Separator());
        menu.add(new GroupMarker(Constants.NAV_BOTTOM));

        return menu;
    }
View Full Code Here

        return menu;
    }

    private IMenuManager createToolMenu() {
        MenuManager menu = new MenuManager(Messages.UDIGWorkbenchAdvisor_tools, Constants.M_TOOL);
        menu.add(new GroupMarker(Constants.TOOL_ACTION));
        menu.add(new Separator());
        menu.add(new GroupMarker(Constants.TOOL_MODAL));
        menu.add(new Separator());
        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

        return menu;
    }
View Full Code Here

            preferences.setText(Messages.UDIGWorkbenchAdvisor_preferences_text);
            windowMenu.insertBefore(ContributionItemFactory.OPEN_WINDOWS.getId(), preferences);
        }

        if (windowMenu.findUsingPath(IWorkbenchActionConstants.MB_ADDITIONS) == null) {
            windowMenu.insertBefore(ActionFactory.PREFERENCES.getId(), new GroupMarker(
                    IWorkbenchActionConstants.MB_ADDITIONS));
        }

        if (windowMenu.findUsingPath(ActionFactory.CLOSE_ALL_PERSPECTIVES.getId()) == null) {
            IAction closeAllPerspectives = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
View Full Code Here

            }
        }

        if (helpMenu.findUsingPath(Constants.HELP_START) == null) {
            helpMenu
                    .insertAfter(ActionFactory.INTRO.getId(), new GroupMarker(Constants.HELP_START));
        }

        if (helpMenu.findUsingPath(ActionFactory.HELP_CONTENTS.getId()) == null) {
            IAction helpContents = ActionFactory.HELP_CONTENTS.create(window);
            helpContents.setText(Messages.UDIGWorkbenchAdvisor_helpContents_text);
            helpMenu.insertBefore(Constants.HELP_START, helpContents);
        }

        if (helpMenu.findUsingPath(Constants.HELP_END) == null) {
            helpMenu.insertAfter(Constants.HELP_START, new GroupMarker(Constants.HELP_END));
        }

        // Tips and tricks page would go after HELP_START

        if (helpMenu.findUsingPath(IWorkbenchActionConstants.MB_ADDITIONS) == null) {
            helpMenu.insertAfter(Constants.HELP_END, new GroupMarker(
                    IWorkbenchActionConstants.MB_ADDITIONS));
        }

        // Add the separators
        helpMenu.insertAfter(ActionFactory.INTRO.getId(), new Separator());
View Full Code Here

                }
            }
            for( OpAction action : actions ) {
                menuManager.add(action);
            }
            menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        }
        return menuManager;
    }
View Full Code Here

            // How do I grab the toolbar for this site toolbar?
            // FIXME: help with sub toolbar
            if (toolbarManager != null) {
                IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
                mgr.add(new GroupMarker(CONFIG_MENU_GROUP));
                for( IContributionItem item : toolbarManager.getItems() ) {
                    mgr.appendToGroup(CONFIG_MENU_GROUP, item);
                }
            } else {
                IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
View Full Code Here

        contextMenu.setRemoveAllWhenShown(true);
        contextMenu.addMenuListener(new IMenuListener(){

            public void menuAboutToShow( IMenuManager mgr ) {
                contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
                contextMenu.add(new Separator());
                contextMenu.add(removeAction);
                IWorkbenchWindow window = getSite().getWorkbenchWindow();
                IAction action = ActionFactory.IMPORT.create(window);
                contextMenu.add(action);
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.