Examples of IKeyBindingService


Examples of org.eclipse.ui.IKeyBindingService

        try{
            if (propertiesAction == null ||
                    propertiesAction.getSelectionProvider() != selectionProvider ){
                propertiesAction  = new PropertyDialogAction( part.getSite().getWorkbenchWindow(), selectionProvider );
            }
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(propertiesAction);
            return propertiesAction;
        } finally {
            propertiesLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            }
            if (pasteAction instanceof PasteAction) {
                ((PasteAction) pasteAction).setPart(part);
            }
   
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(pasteAction);
            return pasteAction;
        }finally{
            pasteLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        pasteLock.lock();
        try{
            pasteAction = action;
            pasteAction.setActionDefinitionId("org.eclipse.ui.edit.paste"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(pasteAction);
        }finally{
            pasteLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        deleteLock.lock();
        try{
            deleteAction = action;
            deleteAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(deleteAction);
        }finally{
            deleteLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

        IToolManager toolManager = ApplicationGIS.getToolManager();
        toolManager.contributeGlobalActions(this, actionBars);
        toolManager.registerActionsWithPart(this);

        IKeyBindingService keyBindings = getSite().getKeyBindingService();
        IAction delAction = getDeleteAction();
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delAction);
        keyBindings.registerAction(delAction);
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

      }
    }

    public void setActiveEditor(IEditorPart editor) {
      activeExtendedEditor = computeExtendedEditor(editor);
      IKeyBindingService svc = (editor != null) ? editor.getEditorSite().getKeyBindingService() : null;
      for (int i = 0; i < cache.size(); i++) {
        Object obj = cache.get(i);
        if (obj instanceof ActionDescriptor) {
          ActionDescriptor ad = (ActionDescriptor) obj;
          try {
            IAction action = ad.getAction();
            if (action instanceof IExtendedEditorAction) {
              ((IExtendedEditorAction) action).setActiveExtendedEditor(activeExtendedEditor);
              ((IExtendedEditorAction) action).update();
              // update visibility right now so that the menu
              // will show/hide properly
              if (!((IExtendedEditorAction) action).isVisible() && ad.getContributionItem() != null)
                ad.getContributionItem().setVisible(false);
              if (svc != null && action.getActionDefinitionId() != null) {
                svc.registerAction(action);
              }
            }
          }
          catch (Exception e) {
            Logger.logException("setting active editor on actions", e); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

//      _menuExtenders = null;
//    }

    // 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);
      }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

   *
   * @param pageIndex
   *            the index of the page
   */
  private void setFocus(IEditorPart editor) {
    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.IKeyBindingService

    CoverageTools.getSessionManager().addSessionListener(listener);
    CoverageTools.addJavaCoverageListener(coverageListener);
  }

  protected void createActions() {
    final IKeyBindingService kb = getSite().getKeyBindingService();
    final IActionBars ab = getViewSite().getActionBars();

    openAction = new OpenAction(getSite());
    openAction
        .setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
    ab.setGlobalActionHandler(JdtActionConstants.OPEN, openAction);
    openAction.setEnabled(false);

    copyAction = new CopyAction(tree.getDisplay(), settings, labelprovider,
        viewer);
    ab.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);

    relaunchSessionAction = new RelaunchSessionAction();
    kb.registerAction(relaunchSessionAction);

    removeActiveSessionAction = new RemoveActiveSessionAction();
    ab.setGlobalActionHandler(ActionFactory.DELETE.getId(),
        removeActiveSessionAction);

    removeAllSessionsAction = new RemoveAllSessionsAction();
    kb.registerAction(removeAllSessionsAction);

    mergeSessionsAction = new MergeSessionsAction(getSite()
        .getWorkbenchWindow());
    kb.registerAction(mergeSessionsAction);

    selectSessionAction = new SelectSessionAction();
    kb.registerAction(selectSessionAction);

    importAction = new ImportSessionAction(getSite().getWorkbenchWindow());
    kb.registerAction(importAction);

    exportAction = new ExportSessionAction(getSite().getWorkbenchWindow());
    kb.registerAction(exportAction);

    refreshAction = new RefreshSessionAction();
    ab.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);

    propertiesAction = new PropertyDialogAction(getSite(), viewer);
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

    CoverageTools.getSessionManager().addSessionListener(listener);
    CoverageTools.addJavaCoverageListener(coverageListener);
  }
 
  protected void createActions() {
    IKeyBindingService kb = getSite().getKeyBindingService();
    openAction = new OpenAction(getSite());
    openAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
    getViewSite().getActionBars().setGlobalActionHandler(JdtActionConstants.OPEN, openAction);
    openAction.setEnabled(false);
    kb.registerAction(openAction);
    relaunchSessionAction = new RelaunchSessionAction();
    kb.registerAction(relaunchSessionAction);
    removeActiveSessionAction = new RemoveActiveSessionAction();
    kb.registerAction(removeActiveSessionAction);
    removeAllSessionsAction = new RemoveAllSessionsAction();
    kb.registerAction(removeAllSessionsAction);
    mergeSessionsAction = new MergeSessionsAction(getSite().getWorkbenchWindow());
    kb.registerAction(mergeSessionsAction);
    selectSessionAction = new SelectSessionAction();
    kb.registerAction(selectSessionAction);
    importAction = new ImportSessionAction(getSite().getWorkbenchWindow());
    kb.registerAction(importAction);
    exportAction = new ExportSessionAction(getSite().getWorkbenchWindow());
    kb.registerAction(exportAction);
    refreshAction = new RefreshSessionAction();
    kb.registerAction(refreshAction);
    getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
  }
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.