Examples of IContextService


Examples of org.eclipse.ui.contexts.IContextService

        .getService(IHandlerService.class);
    final IHandlerService slave = new NestableHandlerService(parentService,
        defaultExpression);
    serviceLocator.registerService(IHandlerService.class, slave);

    final IContextService parentContext = (IContextService) serviceLocator
        .getService(IContextService.class);
    final IContextService context = new NestableContextService(
        parentContext, defaultExpression);
    serviceLocator.registerService(IContextService.class, context);

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

Examples of org.eclipse.ui.contexts.IContextService

    forwardTriggerSequences = bindingService
        .getActiveBindingsFor(commandForward);
    backwardTriggerSequences = bindingService
        .getActiveBindingsFor(commandBackward);

    final IContextService contextService = (IContextService) window
        .getWorkbench().getService(IContextService.class);
    try {
      dialog.open();
      addMouseListener(table, dialog);
      contextService.registerShell(dialog, IContextService.TYPE_NONE);
      addKeyListener(table, dialog);
      addTraverseListener(table);

      while (!dialog.isDisposed()) {
        if (!display.readAndDispatch()) {
          display.sleep();
        }
      }
    } finally {
      if (!dialog.isDisposed()) {
        cancel(dialog);
      }
      contextService.unregisterShell(dialog);
      forwardTriggerSequences = null;
      backwardTriggerSequences = null;
    }
  }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

        .getService(IHandlerService.class);
    final IHandlerService slave = new NestableHandlerService(parentService,
        defaultExpression);
    serviceLocator.registerService(IHandlerService.class, slave);

    final IContextService contextParent = (IContextService) serviceLocator
        .getService(IContextService.class);
    final IContextService contextSlave = new NestableContextService(
        contextParent, defaultExpression);
    serviceLocator.registerService(IContextService.class, contextSlave);
   
    final ICommandService parentCommandService = (ICommandService) serviceLocator
        .getService(ICommandService.class);
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

   * support. This ensures that it does not modify the current state of the
   * application.
   */
  private final void registerShellType() {
    final Shell shell = getShell();
    final IContextService contextService = (IContextService) keyBindingState
        .getAssociatedWindow().getWorkbench().getService(
            IContextService.class);
    contextService.registerShell(shell, contextService
        .getShellType((Shell) shell.getParent()));
  }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

        }
       
        private void updateActionSets(Perspective oldPersp, Perspective newPersp) {
      // Update action sets

      IContextService service = (IContextService) window
          .getService(IContextService.class);
      try {
        service.activateContext(ContextAuthority.DEFER_EVENTS);
        if (newPersp != null) {
          IActionSetDescriptor[] newAlwaysOn = newPersp
              .getAlwaysOnActionSets();
          for (int i = 0; i < newAlwaysOn.length; i++) {
            IActionSetDescriptor descriptor = newAlwaysOn[i];

            actionSets.showAction(descriptor);
          }

          IActionSetDescriptor[] newAlwaysOff = newPersp
              .getAlwaysOffActionSets();
          for (int i = 0; i < newAlwaysOff.length; i++) {
            IActionSetDescriptor descriptor = newAlwaysOff[i];

            actionSets.maskAction(descriptor);
          }
        }

        if (oldPersp != null) {
          IActionSetDescriptor[] newAlwaysOn = oldPersp
              .getAlwaysOnActionSets();
          for (int i = 0; i < newAlwaysOn.length; i++) {
            IActionSetDescriptor descriptor = newAlwaysOn[i];

            actionSets.hideAction(descriptor);
          }

          IActionSetDescriptor[] newAlwaysOff = oldPersp
              .getAlwaysOffActionSets();
          for (int i = 0; i < newAlwaysOff.length; i++) {
            IActionSetDescriptor descriptor = newAlwaysOff[i];

            actionSets.unmaskAction(descriptor);
          }
        }
      } finally {
        service.activateContext(ContextAuthority.SEND_EVENTS);
      }
    }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

        private boolean updateActionSets(ArrayList newActionSets) {
      if (oldActionSets.equals(newActionSets)) {
        return false;
      }

      IContextService service = (IContextService) window
          .getService(IContextService.class);
      try {
        service.activateContext(ContextAuthority.DEFER_EVENTS);

        // show the new
        for (int i = 0; i < newActionSets.size(); i++) {
          actionSets.showAction((IActionSetDescriptor) newActionSets
              .get(i));
        }

        // hide the old
        for (int i = 0; i < oldActionSets.size(); i++) {
          actionSets.hideAction((IActionSetDescriptor) oldActionSets
              .get(i));
        }

        oldActionSets = newActionSets;

      } finally {
        service.activateContext(ContextAuthority.SEND_EVENTS);
      }
      Perspective persp = getActivePerspective();
      if (persp == null) {
        return false;
      }
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

                        commandService.getCommand( run.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( stop.getActionDefinitionId() ).setHandler( null );
                        commandService.getCommand( properties.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 ) == instance )
                {
                    IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                        IContextService.class );
                    contextActivation = contextService.activateContext( ApacheDsPluginConstants.CONTEXTS_SERVERS_VIEW );

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

Examples of org.eclipse.ui.contexts.IContextService

            configuration.dispose();
            configuration = null;

            if ( contextActivation != null )
            {
                IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                    IContextService.class );
                contextService.deactivateContext( contextActivation );
                contextActivation = null;
            }
        }
        super.dispose();
    }
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();

        // create the listener
        universalListener = new EntryEditorWidgetUniversalListener( mainWidget.getViewer(), configuration, actionGroup,
            actionGroup.getOpenDefaultEditorAction() );
View Full Code Here

Examples of org.eclipse.ui.contexts.IContextService

            configuration.dispose();
            configuration = null;

            if ( contextActivation != null )
            {
                IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
                    IContextService.class );
                contextService.deactivateContext( contextActivation );
                contextActivation = 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.