de.cau.cs.kieler.core.model.effects
Class ReorderEffect

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractEffect
      extended by de.cau.cs.kieler.core.model.effects.ReorderEffect
All Implemented Interfaces:
IEffect

public class ReorderEffect
extends AbstractEffect

An effect for reordering elements in a feature list.

Rating red

Constructor Summary
ReorderEffect(EObject container, EStructuralFeature feature, int[] newIndices)
          Create a reorder effect for all elements.
ReorderEffect(EObject container, EStructuralFeature feature, int oldIndex, int newIndex)
          Create a reorder effect for one element.
 
Method Summary
 void execute()
          Execute the effect.
 IEffect merge(IEffect otherEffect)
          Merge this effect with another effect.
 
Methods inherited from class de.cau.cs.kieler.core.kivi.AbstractEffect
isMergeable, schedule, scheduleUndo, toString, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReorderEffect

public ReorderEffect(EObject container,
                     EStructuralFeature feature,
                     int oldIndex,
                     int newIndex)
Create a reorder effect for one element.

Parameters:
container - the container object
feature - the structural feature to affect
oldIndex - the old index of the object to reorder
newIndex - the new index of the object to reorder

ReorderEffect

public ReorderEffect(EObject container,
                     EStructuralFeature feature,
                     int[] newIndices)
Create a reorder effect for all elements.

Parameters:
container - the container object
feature - the structural feature to affect
newIndices - an array of new indices
Method Detail

execute

public void execute()
Execute the effect.


merge

public IEffect merge(IEffect otherEffect)
Merge this effect with another effect. Will return null if the effects can not be merged.

Specified by:
merge in interface IEffect
Overrides:
merge in class AbstractEffect
Parameters:
otherEffect - the effect to merge with
Returns:
the newly merged effect, or null if no merge was possible.