Package org.eclipse.ui.contexts

Examples of org.eclipse.ui.contexts.IContextService


    // code snippet from
    // http://sry-for-my-english.blogspot.com/2007/05/rcp-keybinding
    // -issues.html
    // activate our own context:
    IContextService service = (IContextService) PlatformUI.getWorkbench()
        .getService(IContextService.class);
    service.activateContext("net.sourceforge.syncyoursecrets.context");

    String editorArea = layout.getEditorArea();
    layout.setEditorAreaVisible(false);
    layout.setFixed(true);
View Full Code Here


            windowShell.removeListener(SWT.Resize, resizeListener);
            DragUtil.removeDragTarget(windowShell, this);
            bounds = windowShell.getBounds();

            // Unregister this detached view as a window (for key bindings).
      final IContextService contextService = (IContextService) getWorkbenchPage().getWorkbenchWindow().getWorkbench().getService(IContextService.class);
      contextService.unregisterShell(windowShell);

            windowShell.setData(null);
            windowShell = null;
        }
View Full Code Here

    protected void configureShell(Shell shell) {
        updateTitle();
        shell.addListener(SWT.Resize, resizeListener);

        // Register this detached view as a window (for key bindings).
    final IContextService contextService = (IContextService) getWorkbenchPage()
        .getWorkbenchWindow().getWorkbench().getService(IContextService.class);
        contextService.registerShell(shell,
                IContextService.TYPE_WINDOW);

        page.getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp(shell,
        IWorkbenchHelpContextIds.DETACHED_WINDOW);
    }
View Full Code Here

    final IWorkbench workbench = getWorkbench();
    workbench.getHelpSystem().setHelp(shell,
        IWorkbenchHelpContextIds.WORKBENCH_WINDOW);

//    initializeDefaultServices();
    final IContextService contextService = (IContextService) getWorkbench().getService(IContextService.class);
    contextService.registerShell(shell, IContextService.TYPE_WINDOW);

    trackShellActivation(shell);
    trackShellResize(shell);
  }
View Full Code Here

      }
      handlerActivations.clear();
      globalActionHandlersByCommandId.clear();

      // Remove the enabled submissions. Bug 64024.
      final IContextService contextService = (IContextService) workbench.getService(IContextService.class);
      contextService.unregisterShell(getShell());

      closeAllPages();

      fireWindowClosed();
     
View Full Code Here

        .getService(IHandlerService.class);
    final IHandlerService handlerService = new SlaveHandlerService(
        parentHandlerService, defaultExpression);
    serviceLocator.registerService(IHandlerService.class, handlerService);

    final IContextService parentContextService = (IContextService) serviceLocator
        .getService(IContextService.class);
    final IContextService contextService = new SlaveContextService(
        parentContextService, defaultExpression);
    serviceLocator.registerService(IContextService.class, contextService);

    final ICommandService parentCommandService = (ICommandService) serviceLocator
        .getService(ICommandService.class);
View Full Code Here

    initializeKeyBindingScopes();
  }

  protected void initializeKeyBindingScopes() {
    IContextService service = (IContextService) getSite().getService(IContextService.class);

    service.activateContext("factOrFiction.deckEditorContext"); //$NON-NLS-1$
  }
View Full Code Here

   * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
   */
  public void partActivated(IWorkbenchPartReference partRef) {
    if (isThisPart(partRef)) {
      fActive = true;
      IContextService contextService = (IContextService)getSite().getService(IContextService.class);
      if(contextService != null) {
        fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW);
        activateParticipants(fActiveConsole);
      }
    }
  }
View Full Code Here

   * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
   */
  public void partDeactivated(IWorkbenchPartReference partRef) {
        if (isThisPart(partRef)) {
      fActive = false;
      IContextService contextService = (IContextService)getSite().getService(IContextService.class);
      if(contextService != null) {
        contextService.deactivateContext(fActivatedContext);
        deactivateParticipants(fActiveConsole);
      }
        }
  }
View Full Code Here

                        commandService.getCommand( openTypeHierarchy.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( deleteSchemaElement.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( renameSchemaElement.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

TOP

Related Classes of org.eclipse.ui.contexts.IContextService

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.