edu.wpi.ebob.wizards
Class AddToObjectBenchWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by edu.wpi.ebob.wizards.AddToObjectBenchWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard

public class AddToObjectBenchWizard
extends org.eclipse.jface.wizard.Wizard
implements org.eclipse.ui.INewWizard

This wizard guides a user through the process of adding an instance to the Object Bench.


Field Summary
private  java.lang.String fqClassName
          The fully qualified classname retrieved from the selection.
private  IObject obj
           
private  AddToObjectBenchWizardPage page1
           
private  AddToObjectBenchWizardPageExtension page2
           
private  org.eclipse.jdt.core.IJavaProject project
          the currently selected project, retrieved from the selection.
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
AddToObjectBenchWizard()
          Constructor for AddToObjectBenchWizard.
 
Method Summary
 void addPages()
          Adding the page to the wizard.
private  void doFinish(java.lang.String instanceName, IConstructor constructor, IObject[] args, org.eclipse.core.runtime.IProgressMonitor monitor)
          The worker method.
private  IConstructor getConstructor()
           
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
          Retrieves the fully-qualified classname and project from the selection.
 boolean performFinish()
          This method is called when 'Finish' button is pressed in the wizard.
 void setProject(org.eclipse.jdt.core.IJavaProject project)
          Sets this wizard to use project as the default project in the project selection drop-down.
 void setType(org.eclipse.jdt.core.IType type)
          sets the type for this wizard.
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, 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
 
Methods inherited from interface org.eclipse.jface.wizard.IWizard
canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Field Detail

fqClassName

private java.lang.String fqClassName
The fully qualified classname retrieved from the selection.

See Also:
init(IWorkbench, IStructuredSelection)

obj

private IObject obj

page1

private AddToObjectBenchWizardPage page1

page2

private AddToObjectBenchWizardPageExtension page2

project

private org.eclipse.jdt.core.IJavaProject project
the currently selected project, retrieved from the selection.

See Also:
init(IWorkbench, IStructuredSelection)
Constructor Detail

AddToObjectBenchWizard

public AddToObjectBenchWizard()
Constructor for AddToObjectBenchWizard.

Method Detail

addPages

public void addPages()
Adding the page to the wizard.

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

doFinish

private void doFinish(java.lang.String instanceName,
                      IConstructor constructor,
                      IObject[] args,
                      org.eclipse.core.runtime.IProgressMonitor monitor)
               throws org.eclipse.core.runtime.CoreException,
                      RemoteException
The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.

Parameters:
args -
constructor -
Throws:
RemoteException
org.eclipse.core.runtime.CoreException

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
Retrieves the fully-qualified classname and project from the selection. An object of type IType, ICompilationUnit, or IFile is expected to be found in the selection.

Specified by:
init in interface org.eclipse.ui.IWorkbenchWizard
See Also:
IWorkbenchWizard.init(IWorkbench, IStructuredSelection)

performFinish

public boolean performFinish()
This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard

getConstructor

private IConstructor getConstructor()
Returns:
the constructor that should be used to construct the instance

setProject

public void setProject(org.eclipse.jdt.core.IJavaProject project)
Sets this wizard to use project as the default project in the project selection drop-down.

Parameters:
project - The desired project

setType

public void setType(org.eclipse.jdt.core.IType type)
sets the type for this wizard. This in turn sets the associated project and sets the default class selection.

Parameters:
type - the java element to be associated with the project.