de.cau.cs.kieler.synccharts.text.interfaces.bridge
Class InterfaceDeclSerializeCommand

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

public class InterfaceDeclSerializeCommand
extends AbstractCommand

Command for serializing all contained signals of a state and its regions back into the interface declaration.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying
 
Field Summary
static int DELETE
          determines that a signal was deleted.
static int INPUT
          determines that the input status of a signal was changed.
static int NAME
          determines that a signal name was changed.
static int NEW
          determines that a new signal was added.
static int OUTPUT
          determines that the output status of a signal was changed.
static int REGION_SIGNAL
          determines that a region's signal was modified.
static int REGION_SIGNAL_DELETE
           
static int REGION_SIGNAL_NEW
           
static int REGION_VARIABLE
          determines that a region's variable was modified.
static int REGION_VARIABLE_DELETE
           
static int REGION_VARIABLE_NEW
           
static int UNDEFINED
          determines that the modification is not further specified.
 
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label
 
Constructor Summary
InterfaceDeclSerializeCommand(State theRootState, EObject changedSignalOrVariable, org.eclipse.xtext.resource.XtextResource theResource, String theOldName, com.google.inject.Injector theInjector, int theOccurredChange)
          Constructor being used if the name of a signal has changed or a new signal was created.
InterfaceDeclSerializeCommand(State theRootState, com.google.inject.Injector theInjector, org.eclipse.xtext.resource.XtextResource theResource)
          Constructor used for canonical serialization.
 
Method Summary
 void execute()
          
protected  boolean prepare()
          
protected  void processCanonicalSerialization()
           
 void redo()
          
 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
 

Field Detail

NEW

public static final int NEW
determines that a new signal was added.

See Also:
Constant Field Values

NAME

public static final int NAME
determines that a signal name was changed.

See Also:
Constant Field Values

INPUT

public static final int INPUT
determines that the input status of a signal was changed.

See Also:
Constant Field Values

OUTPUT

public static final int OUTPUT
determines that the output status of a signal was changed.

See Also:
Constant Field Values

DELETE

public static final int DELETE
determines that a signal was deleted.

See Also:
Constant Field Values

REGION_SIGNAL

public static final int REGION_SIGNAL
determines that a region's signal was modified.

See Also:
Constant Field Values

REGION_SIGNAL_NEW

public static final int REGION_SIGNAL_NEW
See Also:
Constant Field Values

REGION_SIGNAL_DELETE

public static final int REGION_SIGNAL_DELETE
See Also:
Constant Field Values

REGION_VARIABLE

public static final int REGION_VARIABLE
determines that a region's variable was modified.

See Also:
Constant Field Values

REGION_VARIABLE_NEW

public static final int REGION_VARIABLE_NEW
See Also:
Constant Field Values

REGION_VARIABLE_DELETE

public static final int REGION_VARIABLE_DELETE
See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
determines that the modification is not further specified.

See Also:
Constant Field Values
Constructor Detail

InterfaceDeclSerializeCommand

public InterfaceDeclSerializeCommand(State theRootState,
                                     EObject changedSignalOrVariable,
                                     org.eclipse.xtext.resource.XtextResource theResource,
                                     String theOldName,
                                     com.google.inject.Injector theInjector,
                                     int theOccurredChange)
Constructor being used if the name of a signal has changed or a new signal was created.

Parameters:
theRootState - the root state containing the interface declaration.
changedSignalOrVariable - either the changed signal or the variable.
theResource - resource containing the prior representation of the parsed interface declaration or null
theOldName - if there was a renaming - the name prior modifying
theInjector - the injector
theOccurredChange - determines the change that occurred

InterfaceDeclSerializeCommand

public InterfaceDeclSerializeCommand(State theRootState,
                                     com.google.inject.Injector theInjector,
                                     org.eclipse.xtext.resource.XtextResource theResource)
Constructor used for canonical serialization.

Parameters:
theRootState - state whose interface declaration should be serialized
theInjector - injector
theResource - old resource, only needed for undo
Method Detail

execute

public void execute()


redo

public void redo()


undo

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

prepare

protected boolean prepare()

Overrides:
prepare in class AbstractCommand

processCanonicalSerialization

protected void processCanonicalSerialization()