Package org.eclipse.ui.services

Examples of org.eclipse.ui.services.IServiceLocator


    // done
    if (getActivePage() == -1) {
      setActivePage(0);
      IEditorPart part = getEditor(0);
      if (part!=null) {
        final IServiceLocator serviceLocator = part.getEditorSite();
        if (serviceLocator instanceof INestable) {
          activeServiceLocator = (INestable) serviceLocator;
          activeServiceLocator.activate();
        }
      }
View Full Code Here


          .setActivePage(activeEditor);
    }
    if (activeEditor != null) {

      // Activate the services for the new service locator.
      final IServiceLocator serviceLocator = activeEditor.getEditorSite();
      if (serviceLocator instanceof INestable) {
        activeServiceLocator = (INestable) serviceLocator;
        activeServiceLocator.activate();
      }
View Full Code Here

    Assert.isNotNull(multiPageEditor);
    Assert.isNotNull(editor);
    this.multiPageEditor = multiPageEditor;
    this.editor = editor;

    final IServiceLocator parentServiceLocator = multiPageEditor.getSite();
    serviceLocator = new ServiceLocator(parentServiceLocator);

    initializeDefaultServices();
  }
View Full Code Here

      // Clean up the activations.
      final Iterator activationItr = activationsByActionIdByServiceLocator
          .entrySet().iterator();
      while (activationItr.hasNext()) {
        final Map.Entry value = (Map.Entry) activationItr.next();
        final IServiceLocator locator = (IServiceLocator) value
            .getKey();
        final IHandlerService service = (IHandlerService) locator
            .getService(IHandlerService.class);
        final Map activationsByActionId = (Map) value.getValue();
        final Iterator iterator = activationsByActionId.values()
            .iterator();
        while (iterator.hasNext()) {
View Full Code Here

    this.page = page;
    extensionID = "org.eclipse.ui.UnknownID"; //$NON-NLS-1$
    extensionName = "Unknown Name"; //$NON-NLS-1$

    // Initialize the service locator.
    final IServiceLocator parentServiceLocator = page.getWorkbenchWindow();
    this.serviceLocator = new ServiceLocator(parentServiceLocator);

    initializeDefaultServices();
  }
View Full Code Here

   * Creates {@link ExecutionEvent} based on current selection
   *
   * @return {@link ExecutionEvent} with current selection
   */
  protected ExecutionEvent createExecutionEvent() {
    IServiceLocator locator = getServiceLocator();
    ICommandService srv = CommonUtils.getService(locator, ICommandService.class);
    IHandlerService hsrv = CommonUtils.getService(locator, IHandlerService.class);
    Command command = srv.getCommand(commandId);

    ExecutionEvent event = hsrv.createExecutionEvent(command, null);
View Full Code Here

  @Before
  public void setUp() throws Exception {
    switchToMenu = new SwitchToMenu();
    handlerService = mock(IHandlerService.class);
    IServiceLocator serviceLocator = mock(IServiceLocator.class);
    when(serviceLocator.getService(IHandlerService.class)).thenReturn(
        handlerService);
    switchToMenu.initialize(serviceLocator);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.services.IServiceLocator

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.