org.mockcentral.editor.nodes.expectation
Class EditExpectationPartActions

java.lang.Object
  extended by org.mockcentral.editor.nodes.actions.AbstractNodeEditingActions
      extended by org.mockcentral.editor.nodes.expectation.EditExpectationPartActions
All Implemented Interfaces:
IEditExpectationPartActions

public class EditExpectationPartActions
extends AbstractNodeEditingActions
implements IEditExpectationPartActions

A class used to create and run the editing actions for the EditExpectationPage.

Author:
David Hutchinson

Field Summary
 
Fields inherited from class org.mockcentral.editor.nodes.actions.AbstractNodeEditingActions
operationHistory, undoContext
 
Constructor Summary
EditExpectationPartActions()
           
 
Method Summary
 void addParameter(org.mockcentral.server.SignaturePartBean bean)
          Shows a dialog for adding a parameter to the Mock Object method signature.
 void createParametersTableActions()
          Creates the actions for the parameters table.
 void createResultTableActions()
          Creates the actions for the expected result table.
 void editExpectationData()
          Shows a dialog for editing the Mock Object method name and MockMethodType.
 void editParameter(org.mockcentral.server.SignaturePartBean partModel, int index)
          Shows a dialog for editing a Mock Object method parameter.
 void editResult()
          Shows a dialog for adding or editing the Mock Object method result
protected  TableViewerAdapter getParametersTableAdapter()
          Returns the TableViewerAdapter for the parameters table.
protected  TableViewerAdapter getResultTableAdapter()
          Returns the TableViewerAdapter for the result table.
 void init(org.mockcentral.editor.nodes.expectation.ExpectationModel nodeModel, IEditExpectationPartManager manager)
          Sets the ExpectationModel.
 void setAnyParameters()
          Sets the "anyParams" flag.
 void setParametersTableAdapter(TableViewerAdapter parametersTableAdapter)
          Assigns the TableViewerAdapter for the parameters table.
 void setResultAdapter(TableViewerAdapter resultTableAdapter)
          Assigns the TableViewerAdapter for the result table.
 void showParametersMenu(org.eclipse.jface.action.IMenuManager manager, java.lang.String selected, int selectionIndex, int itemCount)
          Shows the pop-up menu used for editing the parameters list.
 void showResultMenu(org.eclipse.jface.action.IMenuManager manager, java.lang.String selected)
          Shows the pop-up menu used for editing the expected method result.
 
Methods inherited from class org.mockcentral.editor.nodes.actions.AbstractNodeEditingActions
getOperationHistory, getUndoContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditExpectationPartActions

public EditExpectationPartActions()
Method Detail

init

public void init(org.mockcentral.editor.nodes.expectation.ExpectationModel nodeModel,
                 IEditExpectationPartManager manager)
Description copied from interface: IEditExpectationPartActions
Sets the ExpectationModel.

Specified by:
init in interface IEditExpectationPartActions
Parameters:
nodeModel - the ExpectationModel.
manager - the IEditExpectationPartManager that manages action invocations.

getParametersTableAdapter

protected TableViewerAdapter getParametersTableAdapter()
Returns the TableViewerAdapter for the parameters table.

Returns:
the TableViewerAdapter for the parameters table.

getResultTableAdapter

protected TableViewerAdapter getResultTableAdapter()
Returns the TableViewerAdapter for the result table.

Returns:
the TableViewerAdapter for the result table.

editExpectationData

public void editExpectationData()
Description copied from interface: IEditExpectationPartActions
Shows a dialog for editing the Mock Object method name and MockMethodType.

Specified by:
editExpectationData in interface IEditExpectationPartActions

setParametersTableAdapter

public void setParametersTableAdapter(TableViewerAdapter parametersTableAdapter)
Description copied from interface: IEditExpectationPartActions
Assigns the TableViewerAdapter for the parameters table.

Specified by:
setParametersTableAdapter in interface IEditExpectationPartActions
Parameters:
parametersTableAdapter - the TableViewerAdapter for the parameters table.

createParametersTableActions

public void createParametersTableActions()
Description copied from interface: IEditExpectationPartActions
Creates the actions for the parameters table.

Specified by:
createParametersTableActions in interface IEditExpectationPartActions

showParametersMenu

public void showParametersMenu(org.eclipse.jface.action.IMenuManager manager,
                               java.lang.String selected,
                               int selectionIndex,
                               int itemCount)
Description copied from interface: IEditExpectationPartActions
Shows the pop-up menu used for editing the parameters list.

Specified by:
showParametersMenu in interface IEditExpectationPartActions
Parameters:
manager - the IMenuManager for the menu.
selected - a toString value for the currently selected parameter.
selectionIndex - the index of the currently selected parameter.
itemCount - the count of all the current parameters.

setAnyParameters

public void setAnyParameters()
Description copied from interface: IEditExpectationPartActions
Sets the "anyParams" flag. This will allow any parameters for the Mock Object method expectation.

Specified by:
setAnyParameters in interface IEditExpectationPartActions

addParameter

public void addParameter(org.mockcentral.server.SignaturePartBean bean)
Description copied from interface: IEditExpectationPartActions
Shows a dialog for adding a parameter to the Mock Object method signature.

Specified by:
addParameter in interface IEditExpectationPartActions

editParameter

public void editParameter(org.mockcentral.server.SignaturePartBean partModel,
                          int index)
Description copied from interface: IEditExpectationPartActions
Shows a dialog for editing a Mock Object method parameter.

Specified by:
editParameter in interface IEditExpectationPartActions

setResultAdapter

public void setResultAdapter(TableViewerAdapter resultTableAdapter)
Description copied from interface: IEditExpectationPartActions
Assigns the TableViewerAdapter for the result table.

Specified by:
setResultAdapter in interface IEditExpectationPartActions
Parameters:
resultTableAdapter - the TableViewerAdapter for the result table.

createResultTableActions

public void createResultTableActions()
Description copied from interface: IEditExpectationPartActions
Creates the actions for the expected result table.

Specified by:
createResultTableActions in interface IEditExpectationPartActions

showResultMenu

public void showResultMenu(org.eclipse.jface.action.IMenuManager manager,
                           java.lang.String selected)
Description copied from interface: IEditExpectationPartActions
Shows the pop-up menu used for editing the expected method result.

Specified by:
showResultMenu in interface IEditExpectationPartActions
Parameters:
manager - the IMenuManager for the menu.
selected - a toString value for the (currently selected) result.

editResult

public void editResult()
Description copied from interface: IEditExpectationPartActions
Shows a dialog for adding or editing the Mock Object method result

Specified by:
editResult in interface IEditExpectationPartActions