org.mockcentral.editor.nodes.mockobject
Class SetMockObjectDataOperation

java.lang.Object
  extended by org.eclipse.core.commands.operations.AbstractOperation
      extended by org.mockcentral.editor.nodes.mockobject.SetMockObjectDataOperation
All Implemented Interfaces:
org.eclipse.core.commands.operations.IUndoableOperation

public class SetMockObjectDataOperation
extends org.eclipse.core.commands.operations.AbstractOperation

An AbstractOperation invoked on a MockObjectController instance to update the Mock Object name and/or interface.

Author:
David Hutchinson

Constructor Summary
SetMockObjectDataOperation(java.lang.String label, org.eclipse.core.commands.operations.IUndoContext undoContext, org.mockcentral.editor.nodes.mockobject.MockObjectController controller, java.lang.String[] data, java.lang.String[] originalData)
          Creates a new instance, assigining the supplied field data.
 
Method Summary
 org.eclipse.core.runtime.IStatus execute(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)
           
 org.eclipse.core.runtime.IStatus redo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)
           
 org.eclipse.core.runtime.IStatus undo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)
           
 
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation
addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetMockObjectDataOperation

public SetMockObjectDataOperation(java.lang.String label,
                                  org.eclipse.core.commands.operations.IUndoContext undoContext,
                                  org.mockcentral.editor.nodes.mockobject.MockObjectController controller,
                                  java.lang.String[] data,
                                  java.lang.String[] originalData)
Creates a new instance, assigining the supplied field data.

Parameters:
label - the label for the operation.
undoContext - the IUndoContext in which the operation is to be executed.
controller - the MockObjectController receiving the operation result.
data - a String array containing the updated values for the Mock Object name and interface Class name.
originalData - a String array containing the original values for the Mock Object name and interface Class name.
Method Detail

execute

public org.eclipse.core.runtime.IStatus execute(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                org.eclipse.core.runtime.IAdaptable info)
                                         throws org.eclipse.core.commands.ExecutionException
Specified by:
execute in interface org.eclipse.core.commands.operations.IUndoableOperation
Specified by:
execute 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
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

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