Package org.eclipse.emf.common.command

Examples of org.eclipse.emf.common.command.Command.canExecute()


                if (initialObjectCreationPage.immediateChildrenButton.getSelection()) {
                  createChildrenCommand = new CreateChildrenFromJavaModelCommand(pack, Flags.AccPublic, false);
                } else if (initialObjectCreationPage.recursiveChildrenButton.getSelection()) {
                  createChildrenCommand = new CreateChildrenFromJavaModelCommand(pack, Flags.AccPublic, true);
                }
                if (createChildrenCommand != null && createChildrenCommand.canExecute()) {
                  createChildrenCommand.execute();
                }
              }
              // Save the contents of the resource to the file system.
              //
View Full Code Here


    return null;
  }
 
  public Object execute(ExecutionEvent event) throws ExecutionException {
    Command command = createEmfCommand(event);
    if (command != null && command.canExecute()) {
      EditingDomain editingDomain = getEditingDomain(event);
      if (editingDomain != null) {
        editingDomain.getCommandStack().execute(command);
      } else {
        command.execute();
View Full Code Here

  @Override
  protected void okPressed() {
    IStatus status = validate();
    if ( status.isOK() ) {
      Command cmd = generateOkCommand();
      if ( cmd.canExecute() ) {
        cmd.execute();
        dbContext.updateModels();
        doCleanUp();
        super.okPressed();
      }
View Full Code Here

  @Override
  public void commitEdit(Cell<?> treeCell, Object newValue) {
    Object item = treeCell.getItem();
    Object value = EcoreUtil.createFromString(attribute.getEAttributeType(), (String) newValue);
    Command command = SetCommand.create(editingDomain, item, attribute, value);
    if (command.canExecute())
      editingDomain.getCommandStack().execute(command);
  }

}
View Full Code Here

  @Execute
  void execute() {
    Group group = ContactsFactory.eINSTANCE.createGroup();
    group.setName("New Group");
    Command command = AddCommand.create(contactsManager.getEditingDomain(), contactsManager.getRootGroup(), ContactsPackage.Literals.GROUP__GROUPS, group);
    if (command != null && command.canExecute())
      contactsManager.getEditingDomain().getCommandStack().execute(command);
  }

}
View Full Code Here

  @Execute
  void execute() {
    Contact contact = ContactsFactory.eINSTANCE.createContact();
    Command command = AddCommand.create(contactsManager.getEditingDomain(), contactsManager.getRootGroup(), ContactsPackage.Literals.GROUP__CONTACTS, contact);
    if (command != null && command.canExecute())
      contactsManager.getEditingDomain().getCommandStack().execute(command);
  }

}
View Full Code Here

        Object object = LocalTransfer.INSTANCE.getObject();

        Command command = DragAndDropCommand.create(editingDomain, item, position, DragAndDropFeedback.DROP_MOVE
            | DragAndDropFeedback.DROP_LINK, DragAndDropFeedback.DROP_MOVE, (Collection<?>) object);

        if (command.canExecute()) {
          dndCommand = command;

          if (command instanceof DragAndDropFeedback) {
            DragAndDropFeedback dndFeedback = (DragAndDropFeedback) command;
            int feedback = dndFeedback.getFeedback();
View Full Code Here

    }

    @Override
    public void setValue(T newValue) {
      Command command = SetCommand.create(editingDomain, eObject, feature, newValue);
      if (command.canExecute())
        editingDomain.getCommandStack().execute(command);
    }

    @Override
    @SuppressWarnings("unchecked")
View Full Code Here

                }
                if ( template != null ) {
                  if ( getTask().getDeploy().getTemplate() == null ) {
                    Command cmd = new SetCommand( editingDomain, getTask().getDeploy(), DEPLOY__TEMPLATE, ParametersFactory.eINSTANCE
                        .createTemplate() );
                    if ( cmd.canExecute() ) {
                      cmd.execute();
                    }
                  }
                  Command cmd = new SetCommand( editingDomain, getTask().getDeploy().getTemplate(), TEMPLATE__FILE, template );
                  if ( cmd.canExecute() ) {
View Full Code Here

                    if ( cmd.canExecute() ) {
                      cmd.execute();
                    }
                  }
                  Command cmd = new SetCommand( editingDomain, getTask().getDeploy().getTemplate(), TEMPLATE__FILE, template );
                  if ( 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.