Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.MenuManager


            setViewerInput((IStructuredSelection) selection);
        }
    }

    protected void createDetailContextMenu(Control menuControl) {
        MenuManager menuMgr = new MenuManager(); //$NON-NLS-1$
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(new IMenuListener() {
            public void menuAboutToShow(IMenuManager mgr) {
                fillDetailContextMenu(mgr);
            }
        });
        Menu menu = menuMgr.createContextMenu(menuControl);
        menuControl.setMenu(menu);

        // register the context menu such that other plugins may contribute to
        // it
        getSite().registerContextMenu(
View Full Code Here


        menuManager.add( ( IAction ) connectionActionMap.get( deleteConnectionAction ) );
        menuManager.add( ( IAction ) connectionActionMap.get( renameConnectionAction ) );
        menuManager.add( new Separator() );

        // import/export
        MenuManager importMenuManager = new MenuManager( Messages.getString( "ConnectionViewActionGroup.Import" ) ); //$NON-NLS-1$
        importMenuManager.add( ( IAction ) connectionActionMap.get( importLdifAction ) );
        importMenuManager.add( ( IAction ) connectionActionMap.get( importDsmlAction ) );
        importMenuManager.add( new Separator() );
        importMenuManager.add( ( IAction ) connectionActionMap.get( importConnectionsAction ) );
        importMenuManager.add( new Separator() );
        menuManager.add( importMenuManager );
        MenuManager exportMenuManager = new MenuManager( Messages.getString( "ConnectionViewActionGroup.Export" ) ); //$NON-NLS-1$
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportLdifAction ) );
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportDsmlAction ) );
        exportMenuManager.add( new Separator() );
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportCsvAction ) );
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportExcelAction ) );
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportOdfAction ) );
        exportMenuManager.add( new Separator() );
        exportMenuManager.add( ( IAction ) connectionActionMap.get( exportConnectionsAction ) );
        exportMenuManager.add( new Separator() );
        menuManager.add( exportMenuManager );
        menuManager.add( new Separator() );

        // additions
        menuManager.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
View Full Code Here

     * {@inheritDoc}
     */
    public void menuAboutToShow( IMenuManager menuManager )
    {
        // new
        MenuManager newMenuManager = new MenuManager( Messages.getString( "BrowserViewActionGroup.New" ) ); //$NON-NLS-1$
        newMenuManager.add( browserActionMap.get( newEntryAction ) );
        newMenuManager.add( browserActionMap.get( newContextEntryAction ) );
        newMenuManager.add( new Separator() );
        newMenuManager.add( browserActionMap.get( newSearchAction ) );
        newMenuManager.add( browserActionMap.get( newBookmarkAction ) );
        newMenuManager.add( new Separator() );
        newMenuManager.add( browserActionMap.get( newBatchOperationAction ) );
        menuManager.add( newMenuManager );
        menuManager.add( new Separator() );

        // navigation
        menuManager.add( browserActionMap.get( openEntryEditorAction ) );
        MenuManager openWithEntryEditorMenuManager = new EntryEditorMenuManager( mainWidget.getViewer() );
        menuManager.add( openWithEntryEditorMenuManager );
        BrowserViewActionProxy leid = ( BrowserViewActionProxy ) browserActionMap.get( locateEntryInDitAction );
        leid.setImageDescriptor( leid.getAction().getImageDescriptor() );
        menuManager.add( leid );
        menuManager.add( browserActionMap.get( gotoDnAction ) );
        menuManager.add( browserActionMap.get( upAction ) );
        menuManager.add( new Separator() );

        // copy/paste/...
        menuManager.add( browserActionMap.get( copyAction ) );
        menuManager.add( browserActionMap.get( pasteAction ) );
        menuManager.add( browserActionMap.get( deleteAction ) );
        menuManager.add( browserActionMap.get( moveAction ) );
        menuManager.add( browserActionMap.get( renameAction ) );
        MenuManager advancedMenuManager = new MenuManager( Messages.getString( "BrowserViewActionGroup.Advanced" ) ); //$NON-NLS-1$
        advancedMenuManager.add( browserActionMap.get( copyDnAction ) );
        advancedMenuManager.add( browserActionMap.get( copyUrlAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsLdifDnOnlyAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsLdifReturningAttributesOnlyAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsLdifAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsLdifOperationalAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsCsvDnOnlyAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsCsvReturningAttributesOnlyAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsCsvAction ) );
        advancedMenuManager.add( browserActionMap.get( copyEntryAsCsvOperationalAction ) );
        advancedMenuManager.add( new Separator() );
        menuManager.add( advancedMenuManager );
        menuManager.add( new Separator() );

        // filter, batch
        menuManager.add( browserActionMap.get( filterChildrenAction ) );
        if ( ( browserActionMap.get( unfilterChildrenAction ) ).isEnabled() )
        {
            menuManager.add( browserActionMap.get( unfilterChildrenAction ) );
        }
        menuManager.add( new Separator() );

        // import/export
        MenuManager importMenuManager = new MenuManager( Messages.getString( "BrowserViewActionGroup.Import" ) ); //$NON-NLS-1$
        importMenuManager.add( browserActionMap.get( importLdifAction ) );
        importMenuManager.add( browserActionMap.get( importDsmlAction ) );
        importMenuManager.add( new Separator() );
        menuManager.add( importMenuManager );

        MenuManager exportMenuManager = new MenuManager( Messages.getString( "BrowserViewActionGroup.Export" ) ); //$NON-NLS-1$
        exportMenuManager.add( browserActionMap.get( exportLdifAction ) );
        exportMenuManager.add( browserActionMap.get( exportDsmlAction ) );
        exportMenuManager.add( new Separator() );
        exportMenuManager.add( browserActionMap.get( exportCsvAction ) );
        exportMenuManager.add( browserActionMap.get( exportExcelAction ) );
        exportMenuManager.add( browserActionMap.get( exportOdfAction ) );
        menuManager.add( exportMenuManager );
        menuManager.add( new Separator() );

        // refresh
        menuManager.add( browserActionMap.get( refreshAction ) );
        MenuManager fetchMenuManager = new MenuManager( Messages.getString( "BrowserViewActionGroup.Fetch" ) ); //$NON-NLS-1$
        if ( browserActionMap.get( fetchOperationalAttributesAction ).isEnabled() )
        {
            fetchMenuManager.add( browserActionMap.get( fetchOperationalAttributesAction ) );
        }
        if ( browserActionMap.get( fetchAliasesAction ).isEnabled() )
        {
            fetchMenuManager.add( browserActionMap.get( fetchAliasesAction ) );
        }
        if ( browserActionMap.get( fetchReferralsAction ).isEnabled() )
        {
            fetchMenuManager.add( browserActionMap.get( fetchReferralsAction ) );
        }
        if ( browserActionMap.get( fetchSubentriesAction ).isEnabled() )
        {
            fetchMenuManager.add( browserActionMap.get( fetchSubentriesAction ) );
        }
        menuManager.add( fetchMenuManager );
        menuManager.add( new Separator() );

        // additions
View Full Code Here

     * @param menuManager the menu manager
     */
    protected void addEditMenu( IMenuManager menuManager )
    {
        menuManager.add( openDefaultValueEditorActionProxy );
        MenuManager editorMenuManager = new MenuManager( Messages
            .getString( "EntryEditorWidgetActionGroup.EditValueWith" ) ); //$NON-NLS-1$
        if ( openBestValueEditorActionProxy.isEnabled() )
        {
            editorMenuManager.add( openBestValueEditorActionProxy );
            editorMenuManager.add( new Separator() );
        }
        for ( EntryEditorActionProxy action : openValueEditorActionProxies )
        {
            if ( action.isEnabled()
                && ( ( OpenEditorAction ) action.getAction() ).getValueEditor().getClass() != ( ( OpenBestEditorAction ) openBestValueEditorActionProxy
                    .getAction() ).getBestValueEditor().getClass() )
            {
                editorMenuManager.add( action );
            }
        }
        editorMenuManager.add( new Separator() );
        editorMenuManager.add( openValueEditorPreferencesAction );
        menuManager.add( editorMenuManager );
    }
View Full Code Here

        // copy, paste, delete
        menuManager.add( ( IAction ) entryEditorActionMap.get( copyAction ) );
        menuManager.add( ( IAction ) entryEditorActionMap.get( pasteAction ) );
        menuManager.add( ( IAction ) entryEditorActionMap.get( deleteAction ) );
        menuManager.add( ( IAction ) entryEditorActionMap.get( selectAllAction ) );
        MenuManager copyMenuManager = new MenuManager( Messages
            .getString( "EntryEditorWidgetActionGroupWithAttribute.Advanced" ) ); //$NON-NLS-1$
        copyMenuManager.add( ( IAction ) entryEditorActionMap.get( deleteAllValuesAction ) );
        menuManager.add( copyMenuManager );
        menuManager.add( new Separator() );

        // edit
        menuManager.add( ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction ) );
View Full Code Here

    /**
     * Initializes the ContextMenu.
     */
    private void initContextMenu()
    {
        contextMenu = new MenuManager( "" ); //$NON-NLS-1$
        contextMenu.setRemoveAllWhenShown( true );
        contextMenu.addMenuListener( new IMenuListener()
        {
            public void menuAboutToShow( IMenuManager manager )
            {
                MenuManager importManager = new MenuManager( Messages.getString( "ProjectsViewController.ImportAction" ) ); //$NON-NLS-1$
                MenuManager exportManager = new MenuManager( Messages.getString( "ProjectsViewController.ExportAction" ) ); //$NON-NLS-1$
                manager.add( newProject );
                manager.add( new Separator() );
                manager.add( openProject );
                manager.add( closeProject );
                manager.add( new Separator() );
                manager.add( renameProject );
                manager.add( new Separator() );
                manager.add( deleteProject );
                manager.add( new Separator() );
                manager.add( importManager );
                importManager.add( importProjects );
                manager.add( exportManager );
                exportManager.add( exportProjects );

                manager.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
            }
        } );

View Full Code Here

        addBundlesAction.setToolTipText("Add Bundles to Repository");
        addBundlesAction.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "/icons/brick_add.png"));
    }

    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();
View Full Code Here

     */
    public IMenuManager getContextMenuManager( TreeViewer viewer )
    {
        if ( this.contextMenuManager == null )
        {
            this.contextMenuManager = new MenuManager();
            Menu menu = this.contextMenuManager.createContextMenu( viewer.getControl() );
            viewer.getControl().setMenu( menu );
        }
        return this.contextMenuManager;
    }
View Full Code Here

        actionToolBar.setLayoutData( new GridData( SWT.END, SWT.NONE, true, false ) );
        actionToolBarManager = new ToolBarManager( actionToolBar );
        control.setTopCenter( actionToolBar );

        // local menu
        this.menuManager = new MenuManager();
        menuToolBar = new ToolBar( control, SWT.FLAT | SWT.RIGHT );
        ToolItem ti = new ToolItem( menuToolBar, SWT.PUSH, 0 );
        ti.setImage( ConnectionUIPlugin.getDefault().getImage( ConnectionUIConstants.IMG_PULLDOWN ) );
        ti.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                showViewMenu();
            }
        } );
        control.setTopRight( menuToolBar );

        // content
        Composite composite = BaseWidgetUtils.createColumnContainer( control, 1, 1 );
        GridLayout gl = new GridLayout();
        gl.horizontalSpacing = 0;
        gl.verticalSpacing = 0;
        gl.marginHeight = 0;
        gl.marginWidth = 0;
        composite.setLayout( gl );
        Control childControl = this.createContent( composite );
        control.setContent( composite );

        // context menu
        this.contextMenuManager = new MenuManager();
        Menu menu = this.contextMenuManager.createContextMenu( childControl );
        childControl.setMenu( menu );
    }
View Full Code Here

        menuManager.add( entryEditorActionMap.get( newBatchOperationAction ) );
        menuManager.add( new Separator() );

        // navigation
        menuManager.add( entryEditorActionMap.get( locateDnInDitAction ) );
        MenuManager schemaMenuManager = new MenuManager( Messages
            .getString( "EntryEditorActionGroup.OpenSchemaBrowser" ) ); //$NON-NLS-1$
        schemaMenuManager.add( entryEditorActionMap.get( showOcdAction ) );
        schemaMenuManager.add( entryEditorActionMap.get( showAtdAction ) );
        schemaMenuManager.add( entryEditorActionMap.get( showEqualityMrdAction ) );
        schemaMenuManager.add( entryEditorActionMap.get( showSubstringMrdAction ) );
        schemaMenuManager.add( entryEditorActionMap.get( showOrderingMrdAction ) );
        schemaMenuManager.add( entryEditorActionMap.get( showLsdAction ) );
        menuManager.add( schemaMenuManager );
        MenuManager showInSubMenu = new MenuManager( Messages.getString( "EntryEditorActionGroup.ShowIn" ) ); //$NON-NLS-1$
        showInSubMenu.add( ContributionItemFactory.VIEWS_SHOW_IN.create( PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow() ) );
        menuManager.add( showInSubMenu );

        menuManager.add( new Separator() );

        // copy, paste, delete
        menuManager.add( entryEditorActionMap.get( copyAction ) );
        menuManager.add( entryEditorActionMap.get( pasteAction ) );
        menuManager.add( entryEditorActionMap.get( deleteAction ) );
        menuManager.add( entryEditorActionMap.get( selectAllAction ) );
        MenuManager advancedMenuManager = new MenuManager( Messages.getString( "EntryEditorActionGroup.Advanced" ) ); //$NON-NLS-1$
        advancedMenuManager.add( entryEditorActionMap.get( copyDnAction ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyUrlAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( entryEditorActionMap.get( copyAttriuteDescriptionAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( entryEditorActionMap.get( copyDisplayValueAction ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyValueUtf8Action ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyValueBase64Action ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyValueHexAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( entryEditorActionMap.get( copyValueAsLdifAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( entryEditorActionMap.get( copySearchFilterAction ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyNotSearchFilterAction ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyAndSearchFilterAction ) );
        advancedMenuManager.add( entryEditorActionMap.get( copyOrSearchFilterAction ) );
        advancedMenuManager.add( new Separator() );
        advancedMenuManager.add( entryEditorActionMap.get( deleteAllValuesAction ) );
        menuManager.add( advancedMenuManager );
        menuManager.add( new Separator() );

        // edit
        menuManager.add( entryEditorActionMap.get( editAttributeDescriptionAction ) );
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.