Package org.eclipse.emf.common.command

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


        float position = (float) (y / height);

        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


      this.eObject = eObject;
    }

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

          public void run() {
            firePropertyChange( IEditorPart.PROP_DIRTY );

            // Try to select the affected objects.
            //
            Command mostRecentCommand = ( (CommandStack) event.getSource() ).getMostRecentCommand();
            if ( mostRecentCommand != null ) {
              setSelectionToViewer( mostRecentCommand.getAffectedObjects() );
            }
          }
        } );
      }
    } );
View Full Code Here

                  MessageDialog.openInformation( getSite().getShell(), "Not valid",
                      "The selected resource has to be part of the source folder" );
                }
                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() ) {
                    cmd.execute();
                  }
                }
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.command.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.