org.mockcentral.editor.nodes.expectation
Class EditExpectationPartManager

java.lang.Object
  extended by org.mockcentral.editor.nodes.expectation.EditExpectationPartManager
All Implemented Interfaces:
IEditExpectationPartManager

public class EditExpectationPartManager
extends java.lang.Object
implements IEditExpectationPartManager

A Class providing methods to show various dialogs for editing Mock Object method expectation data and to execute related IUndoableOperation objects.

Author:
David Hutchinson

Constructor Summary
EditExpectationPartManager(org.eclipse.core.commands.operations.IOperationHistory operationHistory, org.eclipse.core.commands.operations.IUndoContext undoContext, org.mockcentral.editor.nodes.expectation.ExpectationModel nodeModel)
          Creates a new instance.
 
Method Summary
 void clearAnyParameters()
          Clears the "any parameters" status.
 void deleteParameter(int selectionIndex, org.mockcentral.server.SignaturePartBean selection)
          Deletes the supplied parameter SignaturepartBean.
 void deleteResult()
          Deletes the supplied result SignaturepartBean.
 void moveParameterDown(int selectionIndex, org.mockcentral.server.SignaturePartBean selection)
          Moves the supplied parameter SignaturepartBean down in the list
 void moveParameterUp(int selectionIndex, org.mockcentral.server.SignaturePartBean selection)
          Moves the supplied parameter SignaturepartBean up in the list
 void setAnyParameters()
          Sets the "any parameters" status.
 void setExecutions(IEditExpectationOperationExecutions executions)
          Sets the IEditExpectationOperationExecutions.
 void showAddParameterDialog(org.mockcentral.server.SignaturePartBean model)
          Shows a dialog for adding a new Mock Object method parameter.
 void showAddResultDialog(org.mockcentral.server.SignaturePartBean model)
          Shows a dialog for adding a Mock Object method result.
 void showEditExpectationDataDialog(org.mockcentral.editor.nodes.expectation.ExpectationModel model, org.mockcentral.editor.nodes.expectation.MethodNameValidator validator)
          Shows a dialog for editing the Mock Object method expectation method name and/or type.
 void showEditParameterDialog(int index, org.mockcentral.server.SignaturePartBean model)
          Shows a dialog for editing the selected Mock Object method parameter.
 void showEditResultDialog(org.mockcentral.server.SignaturePartBean model)
          Shows a dialog for editing the Mock Object method result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditExpectationPartManager

public EditExpectationPartManager(org.eclipse.core.commands.operations.IOperationHistory operationHistory,
                                  org.eclipse.core.commands.operations.IUndoContext undoContext,
                                  org.mockcentral.editor.nodes.expectation.ExpectationModel nodeModel)
Creates a new instance.

Parameters:
operationHistory - the IOperationHistory.
undoContext - the UndoContext.
nodeModel - the ExpectationModel.
Method Detail

setExecutions

public void setExecutions(IEditExpectationOperationExecutions executions)
Sets the IEditExpectationOperationExecutions.

Parameters:
executions - the IEditExpectationOperationExecutions.

showEditExpectationDataDialog

public void showEditExpectationDataDialog(org.mockcentral.editor.nodes.expectation.ExpectationModel model,
                                          org.mockcentral.editor.nodes.expectation.MethodNameValidator validator)
Description copied from interface: IEditExpectationPartManager
Shows a dialog for editing the Mock Object method expectation method name and/or type.

Specified by:
showEditExpectationDataDialog in interface IEditExpectationPartManager
Parameters:
model - the ExpectationModel.
validator - the MethodNameValidator.

showAddParameterDialog

public void showAddParameterDialog(org.mockcentral.server.SignaturePartBean model)
Description copied from interface: IEditExpectationPartManager
Shows a dialog for adding a new Mock Object method parameter.

Specified by:
showAddParameterDialog in interface IEditExpectationPartManager
Parameters:
model - a new SignaturePartBean for recording the new Mock Object method expectation parameter data.

showEditParameterDialog

public void showEditParameterDialog(int index,
                                    org.mockcentral.server.SignaturePartBean model)
Description copied from interface: IEditExpectationPartManager
Shows a dialog for editing the selected Mock Object method parameter.

Specified by:
showEditParameterDialog in interface IEditExpectationPartManager
Parameters:
index - the index of parameter.
model - the SignaturePartBean containing the current Mock Object method expectation parameter data.

showAddResultDialog

public void showAddResultDialog(org.mockcentral.server.SignaturePartBean model)
Description copied from interface: IEditExpectationPartManager
Shows a dialog for adding a Mock Object method result.

Specified by:
showAddResultDialog in interface IEditExpectationPartManager
Parameters:
model - a new SignaturePartBean for recording the new Mock Object method expectation result data.

showEditResultDialog

public void showEditResultDialog(org.mockcentral.server.SignaturePartBean model)
Description copied from interface: IEditExpectationPartManager
Shows a dialog for editing the Mock Object method result.

Specified by:
showEditResultDialog in interface IEditExpectationPartManager
Parameters:
model - the SignaturePartBean containing the current Mock Object method expectation result data.

setAnyParameters

public void setAnyParameters()
Description copied from interface: IEditExpectationPartManager
Sets the "any parameters" status. If set, the method will expect/match any supplied parameters.

Specified by:
setAnyParameters in interface IEditExpectationPartManager

deleteParameter

public void deleteParameter(int selectionIndex,
                            org.mockcentral.server.SignaturePartBean selection)
Description copied from interface: IEditExpectationPartManager
Deletes the supplied parameter SignaturepartBean.

Specified by:
deleteParameter in interface IEditExpectationPartManager
Parameters:
selectionIndex - the index of the parameter, preserved in case of an undo.
selection - the parameter SignaturepartBean.

moveParameterUp

public void moveParameterUp(int selectionIndex,
                            org.mockcentral.server.SignaturePartBean selection)
Description copied from interface: IEditExpectationPartManager
Moves the supplied parameter SignaturepartBean up in the list

Specified by:
moveParameterUp in interface IEditExpectationPartManager
Parameters:
selectionIndex - the index of the parameter.
selection - the parameter SignaturepartBean.

clearAnyParameters

public void clearAnyParameters()
Description copied from interface: IEditExpectationPartManager
Clears the "any parameters" status.

Specified by:
clearAnyParameters in interface IEditExpectationPartManager

moveParameterDown

public void moveParameterDown(int selectionIndex,
                              org.mockcentral.server.SignaturePartBean selection)
Description copied from interface: IEditExpectationPartManager
Moves the supplied parameter SignaturepartBean down in the list

Specified by:
moveParameterDown in interface IEditExpectationPartManager
Parameters:
selectionIndex - the index of the parameter.
selection - the parameter SignaturepartBean.

deleteResult

public void deleteResult()
Description copied from interface: IEditExpectationPartManager
Deletes the supplied result SignaturepartBean.

Specified by:
deleteResult in interface IEditExpectationPartManager