Class CommandExec


  • public class CommandExec
    extends java.lang.Object
    The Class CommandExec.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean executeCommand​(ICommand command, org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
      Execute a given command within the given TransactionalEditingDomain.
      IMPORTANT: use this method only in situations in which you don't have an open diagram editor.
      static void executeFeatureWithContext​(IFeature feature, IContext context)
      Execute feature with context.
      IMPORTANT: use this method only in situations in which you don't have an open diagram editor.
      static CommandExec getSingleton()
      Gets the singleton.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • executeCommand

        public boolean executeCommand​(ICommand command,
                                      org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
        Execute a given command within the given TransactionalEditingDomain.
        IMPORTANT: use this method only in situations in which you don't have an open diagram editor. This method will simply execute the command on the command stack of the EMF editing domain, while the editor wraps this with a workspace command stack that will additionally monitor if an operation has really done any changes and in case not will reset the editor dirty flag again (see IFeature.hasDoneChanges().
        If you have a DiagramEditor instance use its method executeFeature instead.
        Parameters:
        command - the command
        editingDomain - the transactional editingDomain
        Returns:
        true, if successful
      • getSingleton

        public static CommandExec getSingleton()
        Gets the singleton.
        Returns:
        the singleton
      • executeFeatureWithContext

        public static void executeFeatureWithContext​(IFeature feature,
                                                     IContext context)
        Execute feature with context.
        IMPORTANT: use this method only in situations in which you don't have an open diagram editor. This method will simply execute the command on the command stack of the EMF editing domain, while the editor wraps this with a workspace command stack that will additionally monitor if an operation has really done any changes and in case not will reset the editor dirty flag again (see IFeature.hasDoneChanges().
        If you have a DiagramEditor instance use its method executeFeature instead.
        Parameters:
        feature - the feature
        context - the context