org.mockcentral.editor.nodes.mockobject.wizard
Class EditMockObjectWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.mockcentral.editor.nodes.mockobject.wizard.EditMockObjectWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard

public class EditMockObjectWizard
extends org.eclipse.jface.wizard.Wizard

A Wizard used to edit data for a Mock Object. This wizard provides three pages: an EditMockObjectDataPage for setting the name, interface and (optional) JNDI name, and an AddMethodExpectationsPage on which the user can select methods to mock, and a SetMethodDetailsPage used to control how the application will build the method expectations when the wizard completes.

Author:
David Hutchinson

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
EditMockObjectWizard(org.mockcentral.editor.nodes.mockobject.MockObjectDataBean bean, org.mockcentral.editor.nodes.mockobject.IMockObjectDataManager dataManager, org.mockcentral.editor.nodes.expectation_group.IMethodsListEditor methodsListEditor, EditMockObjectWizardType wizardType)
           
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
protected  void createSettings(EditMockObjectWizardDialog dialog)
          Creates the dialog settings manager.
 org.mockcentral.editor.nodes.mockobject.MockObjectDataBean getBean()
          Returns the MockObjectDataBean storing the Mock Object data.
 WizardDialogSettingsManager getDialogSettingsManager()
          Returns the WizardDialogSettingsManager.
 boolean performFinish()
           
protected  void updateError(EditMockObjectWizardError error, boolean add)
          Adds or removes the supplied EditMockObjectWizardError from the set of error indications.
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditMockObjectWizard

public EditMockObjectWizard(org.mockcentral.editor.nodes.mockobject.MockObjectDataBean bean,
                            org.mockcentral.editor.nodes.mockobject.IMockObjectDataManager dataManager,
                            org.mockcentral.editor.nodes.expectation_group.IMethodsListEditor methodsListEditor,
                            EditMockObjectWizardType wizardType)
Parameters:
bean - the MockObjectDataBean storing the Mock Object data.
dataManager - the class used for managing basic Mock Object data editing and validation.
methodsListEditor - the class used for managing the list of mockable methods.
wizardType - the EditMockObjectWizardType, the value of which determines which pages are added to the wizard and whether various controls are enabled.
Method Detail

getDialogSettingsManager

public WizardDialogSettingsManager getDialogSettingsManager()
Returns the WizardDialogSettingsManager.

Returns:
the WizardDialogSettingsManager.

getBean

public org.mockcentral.editor.nodes.mockobject.MockObjectDataBean getBean()
Returns the MockObjectDataBean storing the Mock Object data.

Returns:
the MockObjectDataBean storing the Mock Object data.

addPages

public void addPages()
Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

canFinish

public boolean canFinish()
Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard

performFinish

public boolean performFinish()
Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard

createSettings

protected void createSettings(EditMockObjectWizardDialog dialog)
Creates the dialog settings manager.

Parameters:
dialog - the WizardDialog.

updateError

protected void updateError(EditMockObjectWizardError error,
                           boolean add)
Adds or removes the supplied EditMockObjectWizardError from the set of error indications.

Parameters:
error - the EditMockObjectWizardError value indicating an error on one of the wizard pages.
add - whether to add or remove the error indication.