Package org.eclipse.gef.commands

Examples of org.eclipse.gef.commands.Command.canExecute()


      ccr.setSourceEditPart(sourceEditPart);
      sourceEditPart.getCommand(ccr);
      ccr.setTargetEditPart(targetEditPart);
      ccr.setType(RequestConstants.REQ_CONNECTION_END);
      Command cmd = targetEditPart.getCommand(ccr);
      if (cmd != null && cmd.canExecute()) {
        executeCommand(cmd);
        IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
        if (viewAdapter != null) {
          adapters.add(viewAdapter);
        }
View Full Code Here


            if( !action.isDone() )
                return;
           
            Command command = action.getCommand();
           
            if( command!=null && command.canExecute() ){
                getViewer().getEditDomain().getCommandStack().execute(command);
            }
        }
    }
View Full Code Here

        updateTargetRequest();
        updateTargetEditPart();

        if (getTargetEditPart() != null) {
          Command command = getCommand();
          if (command != null && command.canExecute())
            getViewer().getEditDomain().getCommandStack()
                .execute(command);
          else
            getCurrentEvent().detail = DND.DROP_NONE;
        } else
View Full Code Here

  @Override
  protected boolean calculateEnabled() {
    Command cmd = createCopyCommand(getSelectedObjects());
    if (cmd == null)
      return false;
    return cmd.canExecute();
  }

  @Override
  public void run() {
    Command cmd = createCopyCommand(getSelectedObjects());
View Full Code Here

  }

  @Override
  public void run() {
    Command cmd = createCopyCommand(getSelectedObjects());
    if (cmd != null && cmd.canExecute()) {
      cmd.execute();
      // force an updateActions for paste command
      if (getWorkbenchPart().getSite().getPage().getActivePart() instanceof SarosWhiteboardView) {
        ((SarosWhiteboardView) getWorkbenchPart().getSite().getPage()
            .getActivePart()).getEditor().updateSelectionActions();
View Full Code Here

  }

  @Override
  protected boolean calculateEnabled() {
    Command command = createPasteCommand();
    return command != null && command.canExecute();
  }

  @Override
  public void run() {
    Command command = createPasteCommand();
View Full Code Here

  }

  @Override
  public void run() {
    Command command = createPasteCommand();
    if (command != null && command.canExecute()) {
      execute(command);
      shiftCount++;
    }
  }
View Full Code Here

        updateTargetRequest();
        updateTargetEditPart();

        if (getTargetEditPart() != null) {
            Command command = getCommand();
            if (command != null && command.canExecute())
                if (customizeAndCheckExecute(command))
                {
                    getViewer().getEditDomain().getCommandStack().execute(command);
                }
            else
View Full Code Here

   * operations may have caused to make it non-executable.
   */
  @Override
  public boolean canRedo() {
    Command c = getRedoCommand();
    if (c != null && !c.canExecute())
      return false;
    return super.canRedo();

  }

View Full Code Here

    }

    if (_linkType != null) {
      Request request = new LinkRequest(_linkType, _range);
      Command cmd = _editPart.getCommand(request);
      if (cmd != null && cmd.canExecute()) {
        cmd.execute();
      }
    }

  }
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.