Package org.eclipse.emf.common.command

Examples of org.eclipse.emf.common.command.CompoundCommand


            } else if (eObject instanceof ServerDataStoreEntryImpl) {
              ServerData serverData = ((ServerDataStoreEntryImpl)eObject).getValue();
              removeValueCommand = RemoveCommand.create(editingDomain, serverData.eContainer(), RfcPackage.Literals.SERVER_DATA_STORE__SERVER_DATA, Collections.singletonList(serverData));
            }
            if (canDelete(selection)) {
              command = new CompoundCommand();
              command.append(deleteEntryCommand);
              command.append(removeValueCommand);
              setBaseEnabled(true);
            }
          }
View Full Code Here


          EObject eObject = (EObject) obj;
          editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
          if (editingDomain != null) {
            pasteFromClipboardCommand = PasteFromClipboardCommand.create(editingDomain, eObject, null);
            if (canPaste(selection)) {
              command = new CompoundCommand();
              command.append(createAddValueCommand(obj, editingDomain.getClipboard()));
              command.append(pasteFromClipboardCommand);
              setBaseEnabled(true);
            }
          }
View Full Code Here

 
  protected Command createAddValueCommand(Object owner, Collection<Object> values) {
    if (owner instanceof ServerDataStore) {
      isServerPaste = true;
      serverDataStore = (ServerDataStore) owner;
      CompoundCommand command = new CompoundCommand();
      for (Object value: values) {
        ServerDataStoreEntryImpl entry = (ServerDataStoreEntryImpl) value;
        command.append(AddCommand.create(editingDomain, owner, RfcPackage.Literals.SERVER_DATA_STORE__SERVER_DATA, entry.getValue()));
      }
      return command;
    } else if (owner instanceof DestinationDataStore) {
      isServerPaste = false;
      destinationDataStore = (DestinationDataStore) owner;
      CompoundCommand command = new CompoundCommand();
      for (Object value: values) {
        DestinationDataStoreEntryImpl entry = (DestinationDataStoreEntryImpl) value;
        command.append(AddCommand.create(editingDomain, owner, RfcPackage.Literals.DESTINATION_DATA_STORE__DESTINATION_DATA, entry.getValue()));
      }
      return command;
    }
    return null;
  }
View Full Code Here

              continue;
            }

          }
          if(createDestinationDataStoreEntryCommand != null && createDestinationDataCommand != null) {
            command = new CompoundCommand();
            command.append(createDestinationDataCommand);
            command.append(SetCommand.create(editingDomain, destinationDataStoreEntry, RfcPackage.Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, destinationData));
            command.append(createDestinationDataStoreEntryCommand);
            setBaseEnabled(true);
          }
View Full Code Here

          EObject eObject = (EObject) obj;
          editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
          if (editingDomain != null) {
            cutToClipboardCommand = CutToClipboardCommand.create(editingDomain, Collections.singletonList(eObject));
            if (canCut(selection)) {
              command = new CompoundCommand();
              command.append(cutToClipboardCommand);
              command.append(createRemoveValueCommand(obj));
              setBaseEnabled(true);
            }
          }
View Full Code Here

              continue;
            }

          }
          if(createServerDataStoreEntryCommand != null && createServerDataCommand != null) {
            command = new CompoundCommand();
            command.append(createServerDataCommand);
            command.append(SetCommand.create(editingDomain, serverDataStoreEntry, RfcPackage.Literals.SERVER_DATA_STORE_ENTRY__VALUE, serverData));
            command.append(createServerDataStoreEntryCommand);
            setBaseEnabled(true);
          }
View Full Code Here

   * {@link AbstractOverrideableCommand#setOverride(org.eclipse.emf.common.command.Command)}
   * .
   */
  @Override
  public void doExecute() {
    CompoundCommand cmd = new CompoundCommand(getLabel());
    for (EObject element : elements) {
      createCreateLinkCommand(cmd, element);
    }
    setOverride(cmd);
    if (cmd.canExecute())
      cmd.execute();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.command.CompoundCommand

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.