Package org.eclipse.jface.commands

Examples of org.eclipse.jface.commands.ActionHandler


                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newProject ) );
                        commandService.getCommand( renameProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( renameProject ) );
                        commandService.getCommand( deleteProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( deleteProject ) );
                    }
                }
            }

View Full Code Here


        registerToolbarActions(actionBars);
        final IHandlerService handlerService = (IHandlerService) site
                .getService(IHandlerService.class);
        handlerService.activateHandler(
                IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR,
                new ActionHandler(fToggleLinkingAction));
        fPartListener = new IPartListener() {

            @Override
            public void partOpened(final IWorkbenchPart part) {
                addFilters(); // JC borde filter-metoden ovan r�cka?
View Full Code Here

        if (commandId != null) {
          actionIdByCommandId.put(commandId, actionID);
          // Register this as a handler with the given definition id.
          // the expression gives the setGlobalActionHandler() a
          // priority.
          final IHandler actionHandler = new ActionHandler(handler);
          Expression handlerExpression = EXPRESSION;
          //XXX add new API in next release to avoid down-casting (bug 137091)
          if (this instanceof EditorActionBars) {
            handlerExpression = ((EditorActionBars)this).getHandlerExpression();
          }
View Full Code Here

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newServer.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newServer ) );
                        commandService.getCommand( openConfiguration.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openConfiguration ) );
                        commandService.getCommand( delete.getActionDefinitionId() ).setHandler(
                            new ActionHandler( delete ) );
                        commandService.getCommand( rename.getActionDefinitionId() ).setHandler(
                            new ActionHandler( rename ) );
                        commandService.getCommand( run.getActionDefinitionId() ).setHandler( new ActionHandler( run ) );
                        commandService.getCommand( stop.getActionDefinitionId() )
                            .setHandler( new ActionHandler( stop ) );
                        commandService.getCommand( properties.getActionDefinitionId() ).setHandler(
                            new ActionHandler( properties ) );
                    }
                }
            }

View Full Code Here

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newSchema.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newSchema ) );
                        commandService.getCommand( newAttributeType.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newAttributeType ) );
                        commandService.getCommand( newObjectClass.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newObjectClass ) );
                        commandService.getCommand( openElement.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openElement ) );
                        commandService.getCommand( openTypeHierarchy.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openTypeHierarchy ) );
                        commandService.getCommand( deleteSchemaElement.getActionDefinitionId() ).setHandler(
                            new ActionHandler( deleteSchemaElement ) );
                    }
                }
            }

View Full Code Here

         *
         * @param action
         *            the action to register.
         */
        private void registerKeybindings(IAction action) {
            final IHandler handler = new ActionHandler(action);
            final IHandlerService handlerService = (IHandlerService) PlatformUI
                    .getWorkbench().getAdapter(IHandlerService.class);
            final IHandlerActivation activation = handlerService.activateHandler(
                    action.getActionDefinitionId(), handler);
//                    new ActiveShellExpression(dialog.getShell()),
View Full Code Here

      return actionContributor.createCommandContribution(commandId);
    }
   
    @Override
    protected ActionHandler getHandler(ITextEditor textEditor) {
      return new ActionHandler(getAction(textEditor, editorActionId));
    }
View Full Code Here

    @Override
  protected void createActions() {
        IAction copyAction = new CopyAction(this, Messages.getString("button.copy"));
        copyAction.setId("copy");
        new ActionHandler(copyAction);
        getActionRegistry().registerAction(copyAction);
        getSelectionActions().add(copyAction.getId());
        IAction pasteAction = new PasteAction(this, Messages.getString("button.paste"));
        pasteAction.setId("paste");
        getActionRegistry().registerAction(pasteAction);
View Full Code Here

        IContextService ctx = (IContextService) getSite().getService(IContextService.class);
        ctx.activateContext("gefEditor.context");
  }
    private void activateHandler(String actionId) {
        IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
        handlerService.activateHandler(actionId, new ActionHandler(getActionRegistry().getAction(actionId)));
    }
View Full Code Here

        ApplicationUtils.showViewByID(HelpView.ID);
      }
    };
    showHelpViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/help_16.png"));
    showHelpViewAction.setActionDefinitionId("Jampa.showHelpView");
    handlerService.activateHandler("Jampa.showHelpView", new ActionHandler(showHelpViewAction));
   
    checkUpdateAction = new Action(Messages.getString("Menu.Help.CheckUpdate"), SWT.NONE) {
      public void run() {
        new VersionCheckerJobLauncher(false, true).start();
      }
    };
    checkUpdateAction.setActionDefinitionId("Jampa.menuCheckVersion");
    handlerService.activateHandler("Jampa.menuCheckVersion", new ActionHandler(checkUpdateAction));
   
    showDebugViewAction = new Action(Messages.getString("Menu.Help.ShowDebugView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(DebugView.ID);
      }
    };
    showDebugViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/debug.png"));
    showDebugViewAction.setActionDefinitionId("Jampa.showConsoleView");
    handlerService.activateHandler("Jampa.showConsoleView", new ActionHandler(showDebugViewAction));
   
    resetUIAction = new Action(Messages.getString("Menu.Help.ResetUI"), SWT.NONE) {
      public void run() {
        try {
          PlatformUI.getWorkbench().showPerspective(MainPerspective.ID, window);
          PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
        } catch (WorkbenchException e) {
          Log.getInstance(MenuController.class).warn("Unable to reset UI: " + e.getMessage());
        }       
      }
    };
    resetUIAction.setActionDefinitionId("Jampa.resetViews");
    handlerService.activateHandler("Jampa.resetViews", new ActionHandler(resetUIAction));
   
    showAboutAction = ActionFactory.ABOUT.create(window);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.commands.ActionHandler

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.