Examples of INestableKeyBindingService


Examples of org.eclipse.ui.INestableKeyBindingService

  private void setFocus(int pageIndex) {
    final IKeyBindingService service = getSite().getKeyBindingService();
    if (pageIndex < 0 || pageIndex >= getPageCount()) {
      // There is no selected page, so deactivate the active service.
      if (service instanceof INestableKeyBindingService) {
        final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
        nestableService.activateKeyBindingService(null);
      } else {
        WorkbenchPlugin
            .log("MultiPageEditorPart.setFocus()   Parent key binding service was not an instance of INestableKeyBindingService.  It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
      }
      return;
    }

    final IEditorPart editor = getEditor(pageIndex);
    if (editor != null) {
      editor.setFocus();
      // There is no selected page, so deactivate the active service.
      if (service instanceof INestableKeyBindingService) {
        final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
        if (editor != null) {
          nestableService.activateKeyBindingService(editor
              .getEditorSite());
        } else {
          nestableService.activateKeyBindingService(null);
        }
      } else {
        WorkbenchPlugin
            .log("MultiPageEditorPart.setFocus()   Parent key binding service was not an instance of INestableKeyBindingService.  It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
      }

    } else {
      // There is no selected editor, so deactivate the active service.
      if (service instanceof INestableKeyBindingService) {
        final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
        nestableService.activateKeyBindingService(null);
      } else {
        WorkbenchPlugin
            .log("MultiPageEditorPart.setFocus()   Parent key binding service was not an instance of INestableKeyBindingService.  It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
      }
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

    // Remove myself from the list of nested key binding services.
    if (service != null) {
      IKeyBindingService parentService = getEditor().getSite()
          .getKeyBindingService();
      if (parentService instanceof INestableKeyBindingService) {
        INestableKeyBindingService nestableParent = (INestableKeyBindingService) parentService;
        nestableParent.removeKeyBindingService(this);
      }
      service = null;
    }

    if (serviceLocator != null) {
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

  public IKeyBindingService getKeyBindingService() {
    if (service == null) {
      service = getMultiPageEditor().getEditorSite()
          .getKeyBindingService();
      if (service instanceof INestableKeyBindingService) {
        INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
        service = nestableService.getKeyBindingService(this);

      } else {
        /*
         * This is an internal reference, and should not be copied by
         * client code. If you are thinking of copying this, DON'T DO
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

    // Remove myself from the list of nested key binding services.
    if (_service != null) {
      IKeyBindingService parentService = getEditor().getSite()
          .getKeyBindingService();
      if (parentService instanceof INestableKeyBindingService) {
        INestableKeyBindingService nestableParent = (INestableKeyBindingService) parentService;
        nestableParent.removeKeyBindingService(this);
      }
      _service = null;
    }
  }
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

   */
  public IKeyBindingService getKeyBindingService() {
    if (_service == null) {
      _service = getSashEditor().getEditorSite().getKeyBindingService();
      if (_service instanceof INestableKeyBindingService) {
        INestableKeyBindingService nestableService = (INestableKeyBindingService) _service;
        _service = nestableService.getKeyBindingService(this);

      } else {
        /*
         * This is an internal reference, and should not be copied by
         * client code. If you are thinking of copying this, DON'T DO
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

    final IKeyBindingService service = getSite().getKeyBindingService();

    if (editor == null) {
      // There is no selected page, so deactivate the active service.
      if (service instanceof INestableKeyBindingService) {
        final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
        nestableService.activateKeyBindingService(null);
      } else {
        //WorkbenchPlugin
        PDPlugin
            .getLogger(getClass()).error("MultiPageEditorPart.setFocus()   Parent key binding service was not an instance of INestableKeyBindingService.  It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
      }
      return;
    }
        editor.setFocus();
        // There is no selected page, so deactivate the active service.
        if (service instanceof INestableKeyBindingService) {
          final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
          if (editor != null) {
            nestableService.activateKeyBindingService(editor
                .getEditorSite());
          } else {
            nestableService.activateKeyBindingService(null);
          }
        } else {
            PDPlugin
                .getLogger(getClass()).error("MultiPageEditorPart.setFocus()   Parent key binding service was not an instance of INestableKeyBindingService.  It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
        }
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

  /**
   * Returns a CompositeEditorKeybinding for an embedded editor.
   */
  public IKeyBindingService getKeyBindingService() {
    if (keyBindingService == null) {
      INestableKeyBindingService service = (INestableKeyBindingService) parent.getKeyBindingService();
      keyBindingService = service.getKeyBindingService(this);
    }
    return keyBindingService;
  }
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

   */
  public void activate() {
    if (keyBindingService == null) {
      return;
    }
    INestableKeyBindingService service = (INestableKeyBindingService) parent.getKeyBindingService();
    service.activateKeyBindingService(this);
   
    // The workbench only calls updateActiveKeyBindingService() when a workbench part
    // becomes active. We have to explicitly call it since for the
    // workbench the active part has not changed.
    // TODO: find an alternative in Eclipse 3.0 for the following call:
View Full Code Here

Examples of org.eclipse.ui.INestableKeyBindingService

   */
  public void deactivate() {
    if (keyBindingService == null) {
      return;
    }
    INestableKeyBindingService service = (INestableKeyBindingService) parent.getKeyBindingService();
    service.activateKeyBindingService(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.