Examples of IContextService


Examples of org.eclipse.ui.contexts.IContextService

                        commandService.getCommand( openElement.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( openTypeHierarchy.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( deleteSchemaElement.getActionDefinitionId() ).setHandler( null );
                    }

                    IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                        IContextService.class );
                    contextService.deactivateContext( contextActivation );
                    contextActivation = null;
                }
            }


            /**
             * This implementation activates the shortcuts when the part is activated.
             */
            public void partActivated( IWorkbenchPartReference partRef )
            {
                if ( partRef.getPart( false ) == view )
                {
                    IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                        IContextService.class );
                    contextActivation = contextService.activateContext( PluginConstants.CONTEXT_SCHEMA_VIEW );

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

                        commandService.getCommand( newProject.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( renameProject.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( deleteProject.getActionDefinitionId() ).setHandler( null );
                    }

                    IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                        IContextService.class );
                    contextService.deactivateContext( contextActivation );
                    contextActivation = null;
                }
            }


            /**
             * This implementation activates the shortcuts when the part is activated.
             */
            public void partActivated( IWorkbenchPartReference partRef )
            {
                if ( partRef.getPart( false ) == view )
                {
                    IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                        IContextService.class );
                    contextActivation = contextService.activateContext( PluginConstants.CONTEXT_PROJECTS_VIEW );

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

    public void activated() {
        // add EOF submissions
        final IPageSite site = fPage.getSite();
        final IHandlerService handlerService = (IHandlerService) site
                .getService(IHandlerService.class);
        final IContextService contextService = (IContextService) site
                .getService(IContextService.class);
        fActivatedContext = contextService.activateContext(fContextId);
        fActivatedHandler = handlerService.activateHandler(
                "org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

    public void deactivated() {
        // remove EOF submissions
        final IPageSite site = fPage.getSite();
        final IHandlerService handlerService = (IHandlerService) site
                .getService(IHandlerService.class);
        final IContextService contextService = (IContextService) site
                .getService(IContextService.class);
        handlerService.deactivateHandler(fActivatedHandler);
        contextService.deactivateContext(fActivatedContext);
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

        fOutlineViewer.addPostSelectionChangedListener(this);
        final IPageSite site = getSite();
        fLinkHelper = new LinkingHelper();

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

Examples of org.eclipse.ui.contexts.IContextService

        if (viewSite instanceof ICommonViewerWorkbenchSite) {
            final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite) viewSite;
            final IWorkbenchPartSite site = workbenchSite.getSite();
            openAction = new OpenErlangAction(aSite, workbenchSite.getSelectionProvider());
            searchActionGroup = new ErlangSearchActionGroup(site);
            final IContextService service = (IContextService) site
                    .getService(IContextService.class);
            service.activateContext("org.erlide.ui.erlangOutlineAndNavigatorScope");
        }
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

            this.configuration.dispose();
            this.configuration = null;

            if ( contextActivation != null )
            {
                IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                    IContextService.class );
                contextService.deactivateContext( contextActivation );
                contextActivation = null;
            }
        }
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

            // create actions
            actionGroup = new EntryEditorWidgetActionGroupWithAttribute( mainWidget, configuration );
            actionGroup.fillToolBar( mainWidget.getToolBarManager() );
            actionGroup.fillMenu( mainWidget.getMenuManager() );
            actionGroup.fillContextMenu( mainWidget.getContextMenuManager() );
            IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                IContextService.class );
            contextActivation = contextService.activateContext( BrowserCommonConstants.CONTEXT_DIALOGS );
            actionGroup.activateGlobalActionHandlers();

            // hack to activate the action handlers when changing the selection
            mainWidget.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
            {
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

    {
        if ( partRef.getPart( false ) == this && contextActivation != null )
        {
            deactivateGlobalActionHandlers();

            IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                IContextService.class );
            contextService.deactivateContext( contextActivation );
            contextActivation = null;
        }
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

     */
    public void partActivated( IWorkbenchPartReference partRef )
    {
        if ( partRef.getPart( false ) == this )
        {
            IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                IContextService.class );
            contextActivation = contextService.activateContext( BrowserCommonConstants.CONTEXT_WINDOWS );

            activateGlobalActionHandlers();
        }
    }
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.