de.cau.cs.kieler.core.model.util
Class SetIndexCommand<T extends EObject>

java.lang.Object
  extended by org.eclipse.emf.common.command.AbstractCommand
      extended by de.cau.cs.kieler.core.model.util.SetIndexCommand<T>
Type Parameters:
T - Type to sort.
All Implemented Interfaces:
Command

public class SetIndexCommand<T extends EObject>
extends AbstractCommand

Set an integer feature of the element to its index in a list.

Rating red

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
SetIndexCommand(EList<T> theList, EStructuralFeature theFeature, int theOffset)
           
 
Method Summary
 void execute()
          
protected  EList<T> getList()
          Get the list.
protected  boolean prepare()
           
 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
 

Constructor Detail

SetIndexCommand

public SetIndexCommand(EList<T> theList,
                       EStructuralFeature theFeature,
                       int theOffset)
Parameters:
theList - the List to sort
theFeature - the feature to set the index to
theOffset - an offset to add to the index
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

getList

protected EList<T> getList()
Get the list.

Returns:
list.

prepare

protected boolean prepare()
Overrides:
prepare in class AbstractCommand