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

java.lang.Object
  extended by org.eclipse.core.commands.operations.AbstractOperation
      extended by org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation
All Implemented Interfaces:
org.eclipse.core.commands.operations.IUndoableOperation, IDataModelOperation

public abstract class AbstractDataModelOperation
extends org.eclipse.core.commands.operations.AbstractOperation
implements IDataModelOperation

Abstract implementation for an IDataModelOperation.

Since:
1.0
See Also:
IDataModelOperation

Constructor Summary
AbstractDataModelOperation()
           Default constructor.
AbstractDataModelOperation(IDataModel model)
           Constructor taking an IDataModel
 
Method Summary
 IDataModel getDataModel()
           Default implementation of getDataModel()
 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()
           Default implementation of getOperationExecutionFlags() returns IWorkspace.AVOID_UPDATE.
 org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()
           Default implementation of getSchedulingRule() returns ResourcesPlugin.getWorkspace().getRoot().
 org.eclipse.core.runtime.IStatus redo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)
           Default empty implementation of redo.
 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().
 org.eclipse.core.runtime.IStatus undo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)
           Default empty implementation of undo.
 
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation
addContext, canExecute, canRedo, canUndo, dispose, execute, getContexts, getLabel, hasContext, removeContext, setLabel, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation
addContext, canExecute, canRedo, canUndo, dispose, execute, getContexts, getLabel, hasContext, removeContext
 

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()

getSchedulingRule

public org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()

Default implementation of getSchedulingRule() returns ResourcesPlugin.getWorkspace().getRoot().

Specified by:
getSchedulingRule in interface IDataModelOperation
Returns:
the ISchedulingRule
See Also:
IDataModelOperation.getSchedulingRule()

getOperationExecutionFlags

public int getOperationExecutionFlags()

Default implementation of getOperationExecutionFlags() returns IWorkspace.AVOID_UPDATE.

Specified by:
getOperationExecutionFlags in interface IDataModelOperation
Returns:
the OperationExecutionFlags
See Also:
IDataModelOperation.getOperationExecutionFlags()

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
Parameters:
env - the environment.

getEnvironment

public final IEnvironment getEnvironment()

An operation can call this method to get the environment that has been set by the operations framework.

Specified by:
getEnvironment in interface IDataModelOperation
Returns:
returns an environment.
See Also:
IDataModelOperation.setEnvironment(IEnvironment)

redo

public org.eclipse.core.runtime.IStatus redo(org.eclipse.core.runtime.IProgressMonitor monitor,
                                             org.eclipse.core.runtime.IAdaptable info)
                                      throws org.eclipse.core.commands.ExecutionException

Default empty implementation of redo.

Specified by:
redo in interface org.eclipse.core.commands.operations.IUndoableOperation
Specified by:
redo in class org.eclipse.core.commands.operations.AbstractOperation
Throws:
org.eclipse.core.commands.ExecutionException

undo

public org.eclipse.core.runtime.IStatus undo(org.eclipse.core.runtime.IProgressMonitor monitor,
                                             org.eclipse.core.runtime.IAdaptable info)
                                      throws org.eclipse.core.commands.ExecutionException

Default empty implementation of undo.

Specified by:
undo in interface org.eclipse.core.commands.operations.IUndoableOperation
Specified by:
undo in class org.eclipse.core.commands.operations.AbstractOperation
Throws:
org.eclipse.core.commands.ExecutionException