Examples of ICommandService


Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Activates global action handlers
     */
    public void activateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction elaa = getAction( EditLdifAttributeAction.class.getName() );
            commandService.getCommand( elaa.getActionDefinitionId() ).setHandler( new ActionHandler( elaa ) );
            IAction elva = getAction( OpenDefaultValueEditorAction.class.getName() );
            commandService.getCommand( elva.getActionDefinitionId() ).setHandler( new ActionHandler( elva ) );
            IAction elra = getAction( EditLdifRecordAction.class.getName() );
            commandService.getCommand( elra.getActionDefinitionId() ).setHandler( new ActionHandler( elra ) );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Deactivates global action handlers
     */
    public void deactivateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction elaa = getAction( EditLdifAttributeAction.class.getName() );
            commandService.getCommand( elaa.getActionDefinitionId() ).setHandler( null );
            IAction elva = getAction( OpenDefaultValueEditorAction.class.getName() );
            commandService.getCommand( elva.getActionDefinitionId() ).setHandler( null );
            IAction elra = getAction( EditLdifRecordAction.class.getName() );
            commandService.getCommand( elra.getActionDefinitionId() ).setHandler( null );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

     * Activates global action handlers.
     */
    public void activateGlobalActionHandlers()
    {

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.COPY.getId(), ( IAction ) entryEditorActionMap
                .get( copyAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.PASTE.getId(), ( IAction ) entryEditorActionMap
                .get( pasteAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.DELETE.getId(), ( IAction ) entryEditorActionMap
                .get( deleteAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.SELECT_ALL.getId(), ( IAction ) entryEditorActionMap
                .get( selectAllAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), ( IAction ) entryEditorActionMap
                .get( propertyDialogAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.FIND.getId(), showQuickFilterAction ); // IWorkbenchActionDefinitionIds.FIND_REPLACE

            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction da = ( IAction ) entryEditorActionMap.get( deleteAction );
                da.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.delete" );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( new ActionHandler( da ) );

                IAction ca = ( IAction ) entryEditorActionMap.get( copyAction );
                ca.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.copy" );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( new ActionHandler( ca ) );

                IAction pa = ( IAction ) entryEditorActionMap.get( pasteAction );
                pa.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.paste" );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( new ActionHandler( pa ) );

                showQuickFilterAction.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.find" );
                commandService.getCommand( showQuickFilterAction.getActionDefinitionId() ).setHandler(
                    new ActionHandler( showQuickFilterAction ) );

                IAction pda = ( IAction ) entryEditorActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );
            }
        }

        if ( commandService != null )
        {
            IAction nva = ( IAction ) entryEditorActionMap.get( newValueAction );
            commandService.getCommand( nva.getActionDefinitionId() ).setHandler( new ActionHandler( nva ) );
            commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler(
                new ActionHandler( openDefaultValueEditorActionProxy ) );
        }

    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

     * Deactivates global action handlers.
     */
    public void deactivateGlobalActionHandlers()
    {

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.COPY.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.PASTE.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.DELETE.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.SELECT_ALL.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.FIND.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), null );

            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction da = ( IAction ) entryEditorActionMap.get( deleteAction );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( null );

                IAction ca = ( IAction ) entryEditorActionMap.get( copyAction );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( null );

                IAction pa = ( IAction ) entryEditorActionMap.get( pasteAction );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( null );

                commandService.getCommand( showQuickFilterAction.getActionDefinitionId() ).setHandler( null );

                IAction pda = ( IAction ) entryEditorActionMap.get( propertyDialogAction );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( null );
            }
        }

        if ( commandService != null )
        {
            IAction nva = ( IAction ) entryEditorActionMap.get( newValueAction );
            commandService.getCommand( nva.getActionDefinitionId() ).setHandler( null );
            commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler( null );
        }

    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Activates global action handlers
     */
    public void activateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction elaa = getAction( EditLdifAttributeAction.class.getName() );
            commandService.getCommand( elaa.getActionDefinitionId() ).setHandler( new ActionHandler( elaa ) );
            IAction elva = getAction( OpenDefaultValueEditorAction.class.getName() );
            commandService.getCommand( elva.getActionDefinitionId() ).setHandler( new ActionHandler( elva ) );
            IAction elra = getAction( EditLdifRecordAction.class.getName() );
            commandService.getCommand( elra.getActionDefinitionId() ).setHandler( new ActionHandler( elra ) );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Deactivates global action handlers
     */
    public void deactivateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction elaa = getAction( EditLdifAttributeAction.class.getName() );
            commandService.getCommand( elaa.getActionDefinitionId() ).setHandler( null );
            IAction elva = getAction( OpenDefaultValueEditorAction.class.getName() );
            commandService.getCommand( elva.getActionDefinitionId() ).setHandler( null );
            IAction elra = getAction( EditLdifRecordAction.class.getName() );
            commandService.getCommand( elra.getActionDefinitionId() ).setHandler( null );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Activates the action handlers.
     */
    public void activateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.COPY.getId(), ( IAction ) connectionActionMap
                .get( copyConnectionAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.PASTE.getId(), ( IAction ) connectionActionMap
                .get( pasteConnectionAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.DELETE.getId(), ( IAction ) connectionActionMap
                .get( deleteConnectionAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.RENAME.getId(), ( IAction ) connectionActionMap
                .get( renameConnectionAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), ( IAction ) connectionActionMap
                .get( propertyDialogAction ) );
            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction ca = ( IAction ) connectionActionMap.get( copyConnectionAction );
                ca.setActionDefinitionId( "org.apache.directory.studio.ldapbrowser.action.copy" );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( new ActionHandler( ca ) );

                IAction pa = ( IAction ) connectionActionMap.get( pasteConnectionAction );
                pa.setActionDefinitionId( "org.apache.directory.studio.ldapbrowser.action.paste" );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( new ActionHandler( pa ) );

                IAction da = ( IAction ) connectionActionMap.get( deleteConnectionAction );
                da.setActionDefinitionId( "org.apache.directory.studio.ldapbrowser.action.delete" );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( new ActionHandler( da ) );

                IAction pda = ( IAction ) connectionActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.studio.ldapbrowser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );

            }
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Deactivates the action handlers.
     */
    public void deactivateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.COPY.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.PASTE.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.DELETE.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.RENAME.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), null );
            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction ca = ( IAction ) connectionActionMap.get( copyConnectionAction );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( null );

                IAction pa = ( IAction ) connectionActionMap.get( pasteConnectionAction );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( null );

                IAction da = ( IAction ) connectionActionMap.get( deleteConnectionAction );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( null );

                IAction pda = ( IAction ) connectionActionMap.get( propertyDialogAction );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( null );

            }
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

                .get( refreshAttributesAction ) );
        }

        super.activateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction naa = ( IAction ) entryEditorActionMap.get( newAttributeAction );
            commandService.getCommand( naa.getActionDefinitionId() ).setHandler( new ActionHandler( naa ) );
            IAction lid = ( IAction ) entryEditorActionMap.get( locateDnInDitAction );
            commandService.getCommand( lid.getActionDefinitionId() ).setHandler( new ActionHandler( lid ) );
            IAction eada = ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction );
            commandService.getCommand( eada.getActionDefinitionId() ).setHandler( new ActionHandler( eada ) );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

            actionBars.setGlobalActionHandler( ActionFactory.REFRESH.getId(), null );
        }

        super.deactivateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction naa = ( IAction ) entryEditorActionMap.get( newAttributeAction );
            commandService.getCommand( naa.getActionDefinitionId() ).setHandler( null );
            IAction lid = ( IAction ) entryEditorActionMap.get( locateDnInDitAction );
            commandService.getCommand( lid.getActionDefinitionId() ).setHandler( null );
            IAction eada = ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction );
            commandService.getCommand( eada.getActionDefinitionId() ).setHandler( null );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.