de.cau.cs.kieler.synccharts.text.actions.bridge
Class ActionLabelParseCommand

java.lang.Object
  extended by org.eclipse.emf.common.command.AbstractCommand
      extended by de.cau.cs.kieler.synccharts.text.actions.bridge.ActionLabelParseCommand
All Implemented Interfaces:
Command

public class ActionLabelParseCommand
extends AbstractCommand

Wrapper of the parsing operation into a GMF AbstractTransactionalCommand. Hence parsing of an Action label into trigger and effects Expression objects can be done either by manually calling the parse method or by excuting the command on a GEF/GMF command stack.

Rating proposed yellow
(2010-01-19) proposed by haf

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying
 
Field Summary
 
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label
 
Constructor Summary
ActionLabelParseCommand(EObject theElement, String theNewString, com.google.inject.Injector theInjector)
           
 
Method Summary
static void copyActionContents(Action source, Action target)
          Move all contents from one Action object to another.
 void execute()
          
 void parse()
          Run the actual parse operation with the element and new string set by the constructor before.
protected  boolean prepare()
           
 void redo()
           Simply calls execute.
 void undo()
           
 
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, getResult, setDescription, setLabel, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionLabelParseCommand

public ActionLabelParseCommand(EObject theElement,
                               String theNewString,
                               com.google.inject.Injector theInjector)
Parameters:
theElement - the target element
theNewString - the String to be parsed
theInjector - the Xtext Guice Injector
Method Detail

execute

public void execute()


redo

public void redo()
Simply calls execute.


undo

public void undo()
Specified by:
undo in interface Command
Overrides:
undo in class AbstractCommand

parse

public void parse()
           throws KielerModelException,
                  IOException
Run the actual parse operation with the element and new string set by the constructor before.

Throws:
KielerModelException - if parsing of the string fails
IOException - only if there is an internal parser error

copyActionContents

public static void copyActionContents(Action source,
                                      Action target)
Move all contents from one Action object to another.

Parameters:
source - the source of the movement
target - the target of the movement

prepare

protected boolean prepare()
Overrides:
prepare in class AbstractCommand