org.eclipse.wst.common.frameworks.datamodel
Class AbstractDataModelOperation

java.lang.Object
  extended byAbstractOperation
      extended byorg.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation
All Implemented Interfaces:
IDataModelOperation

public abstract class AbstractDataModelOperation
extends AbstractOperation
implements IDataModelOperation

Abstract implementation for an IDataModelOperation.

Since:
1.0
See Also:
IDataModelOperation, Serialized Form

Constructor Summary
AbstractDataModelOperation()
          Default constructor.
AbstractDataModelOperation(IDataModel model)
          Constructor taking an IDataModel
 
Method Summary
 IDataModel getDataModel()
          Default implementation of getDataModel()
 java.util.Set getDataModelIDs()
           
 IEnvironment getEnvironment()
          An operation can call this method to get the environment that has been set by the operations framework.
 java.lang.String getID()
          Default implementation of getID().
 int getOperationExecutionFlags()
           
 java.util.List getPostOperations()
          An operation can specify a list of operations that should run after this operation.
 java.util.List getPreOperations()
          An operation can specify a list of operations that should run before this operation.
 ISchedulingRule getSchedulingRule()
           
 IStatus redo(IProgressMonitor monitor, IAdaptable info)
           
 void setDataModel(IDataModel model)
          Default implementation of setDataModel()
 void setEnvironment(IEnvironment env)
          The framework will set the environment on this operation before it is executed.
 void setID(java.lang.String id)
          Default implementation of setID().
 IStatus undo(IProgressMonitor monitor, IAdaptable info)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataModelOperation

public AbstractDataModelOperation()
Default constructor.


AbstractDataModelOperation

public AbstractDataModelOperation(IDataModel model)
Constructor taking an IDataModel

Parameters:
model - the IDataModel used to drive this operation
Method Detail

setID

public void setID(java.lang.String id)
Default implementation of setID().

Specified by:
setID in interface IDataModelOperation
Parameters:
id - the unique operation id
See Also:
IDataModelOperation.setID(String)

getID

public java.lang.String getID()
Default implementation of getID().

Specified by:
getID in interface IDataModelOperation
Returns:
the unique operation id
See Also:
IDataModelOperation.getID()

setDataModel

public void setDataModel(IDataModel model)
Default implementation of setDataModel()

Specified by:
setDataModel in interface IDataModelOperation
Parameters:
model - the IDataModel used to run this operation
See Also:
IDataModelOperation.setDataModel(IDataModel)

getDataModel

public IDataModel getDataModel()
Default implementation of getDataModel()

Specified by:
getDataModel in interface IDataModelOperation
Returns:
this operation's IDataModel.
See Also:
IDataModelOperation.getDataModel()

getDataModelIDs

public java.util.Set getDataModelIDs()
Specified by:
getDataModelIDs in interface IDataModelOperation

getSchedulingRule

public ISchedulingRule getSchedulingRule()
Specified by:
getSchedulingRule in interface IDataModelOperation

getOperationExecutionFlags

public int getOperationExecutionFlags()
Specified by:
getOperationExecutionFlags in interface IDataModelOperation

setEnvironment

public final void setEnvironment(IEnvironment env)
The framework will set the environment on this operation before it is executed. The operation can then use the environment to report status, log information, and access resources in an environment neutral way.

Specified by:
setEnvironment in interface IDataModelOperation

getEnvironment

public final IEnvironment getEnvironment()
An operation can call this method to get the environment that has been set by the operations framework.

Returns:
returns an environment.

getPreOperations

public java.util.List getPreOperations()
An operation can specify a list of operations that should run before this operation. Subclasses can override this method to provide these operations. The operations provided will be executed in the order specified in the list.

Specified by:
getPreOperations in interface IDataModelOperation
Returns:
returns a list of data model operations or null. Null indicates that there are no pre operations.

getPostOperations

public java.util.List getPostOperations()
An operation can specify a list of operations that should run after this operation. Subclasses can override this method to provide these operations. The operations provided will be executed in the order specified in the list.

Specified by:
getPostOperations in interface IDataModelOperation
Returns:
returns a list of data model operations or null. Null indicates that there are no post operations.

redo

public IStatus redo(IProgressMonitor monitor,
                    IAdaptable info)
             throws ExecutionException
Throws:
ExecutionException

undo

public IStatus undo(IProgressMonitor monitor,
                    IAdaptable info)
             throws ExecutionException
Throws:
ExecutionException