Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.Command


        }
        ICommandService service = (ICommandService) PlatformUI.getWorkbench().getAdapter(
                ICommandService.class);

        Command command = service.getCommand("org.locationtech.udig.tool.edit.clearAction"); //$NON-NLS-1$
        command.setHandler(clearEditBlackboardHandler);
       
        if(clearEditBlackboardCommandListener == null){
            clearEditBlackboardCommandListener  =  new ICommandListener(){

                public void commandChanged( CommandEvent commandEvent ) {
                    if (commandEvent.isHandledChanged()) {
                        commandEvent.getCommand().removeCommandListener(this);
                        clearEditBlackboardCommandListener = null;
                       
                        IMap map = ApplicationGIS.getActiveMap();
                        resetBlackboards(map);
                    }
                }

            };
            command.addCommandListener(clearEditBlackboardCommandListener);
        }
    }
View Full Code Here


     *  Called from <code>EditToolHandler.disableListeners()</code>.
     */
    static synchronized void disableClearBlackboardCommand() {
        ICommandService service = (ICommandService) PlatformUI.getWorkbench().getAdapter(
                ICommandService.class);
        Command command = service.getCommand("org.locationtech.udig.tool.edit.clearAction"); //$NON-NLS-1$

        if(clearEditBlackboardCommandListener != null){
            command.removeCommandListener(clearEditBlackboardCommandListener);
            clearEditBlackboardCommandListener = null;
        }
       
        command.setHandler(null);

    }
View Full Code Here

    ICommandService service = (ICommandService) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class);
    private IHandler commandHandler;

    public void activate( EditToolHandler handler ) {
        Command command = service.getCommand(COMMAND_ID);
        IToolContext context = handler.getContext();
        commandHandler=new SnapBehaviourCommandHandler(context.getMapDisplay(), context.getMap());
        if (command != null)
            command.setHandler(commandHandler);
    }
View Full Code Here

            command.setHandler(commandHandler);
    }

    public void deactivate( EditToolHandler handler ) {
        commandHandler=null;
        Command command = service.getCommand(COMMAND_ID);
        if (command != null)
            command.setHandler(null);
    }
View Full Code Here

  private final AcceptEditCommandHandler commandHandler = new AcceptEditCommandHandler();
  private final MapPartListener mapPartListener = new MapPartListener();

  public void activate(EditToolHandler handler) {
    commandHandler.handler = handler;
    Command command = service.getCommand(COMMAND_ID);
    mapPartListener.command = command;
    mapPartListener.activate();
  }
View Full Code Here

            ICommandService.class);
    private IHandler commandHandler;;

    public void activate( EditToolHandler handler ) {
        commandHandler=new AdvancedBehaviourCommandHandler(handler.getContext().getMapDisplay());
        Command command = service.getCommand(COMMAND_ID);
        if (command != null)
            command.setHandler(commandHandler);
    }
View Full Code Here

            command.setHandler(commandHandler);
    }

    public void deactivate( EditToolHandler handler ) {
        commandHandler=null;
        Command command = service.getCommand(COMMAND_ID);
        if (command != null)
            command.setHandler(null);
    }
View Full Code Here

            if (!ids.contains(tool.getId())) {
                ids.add(category.getId());

                for( String currentId : tool.getCommandIds() ) {
                    currentId=currentId.trim();
                    Command command = service.getCommand(currentId);
                    if (command != null)
                        command.setHandler(tool.getHandler(currentId));
                }
            }
        }
    }
View Full Code Here

    createDefaultPageButtonList(composite);
  }

  private void createDefaultPageLabel(Composite composite, int h_span) {
      final ICommandService commandSvc= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);
    final Command command= commandSvc.getCommand(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    ParameterizedCommand pCmd= new ParameterizedCommand(command, null);
    String key= getKeyboardShortcut(pCmd);
    if (key == null) {
      key= SSEUIMessages.CodeAssistAdvancedConfigurationBlock_no_shortcut;
    }
View Full Code Here

public class ContentModelSynchWithEditorHandler extends
    AbstractHandler  {

  public Object execute(ExecutionEvent event) throws ExecutionException {
       Command command = event.getCommand();
       HandlerUtil.toggleCommandState(command);
       return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.Command

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.