org.eclipse.ocl.examples.internal.wizard
Class AbstractExampleWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.eclipse.ocl.examples.internal.wizard.AbstractExampleWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard
Direct Known Subclasses:
EmptyExampleWizard, InterpreterExampleWizard, OCLinEcoreTutorialWizard, RoyalAndLoyalExampleWizard

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

This abstract example wizard simply unzips a number of zips into the workspace as projects. It does not offer any pages but can be added as a new wizard to the new wizards dialog through the org.eclipse.ui.newWizards extension point.

Clients should subclass this class and override the getProjectDescriptor() method to provide the location of the project zips that should be unzipped into the workspace. Note that any projects that are already in the workspace will not be overwritten because the user could have made changes to them that would be lost.

It is highly recommended when registering subclasses to the new wizards extension point that the wizard declaration should have canFinishEarly = true and hasPages = false. Any label and icon can be freely given to the wizard to suit the needs of the client.


Nested Class Summary
static class AbstractExampleWizard.ProjectDescriptor
          A descriptor class that describes where to find the zipped contents of a project and what that project should be named when unzipped into the workspace.
 
Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
AbstractExampleWizard()
           
 
Method Summary
protected abstract  java.util.Collection getProjectDescriptors()
          The subclass provides the specific project descriptors for the projects that should be unzipped into the workspace.
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
           
protected  void log(java.lang.Exception e)
           
 boolean performFinish()
           
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, addPages, 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
addPages, canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Constructor Detail

AbstractExampleWizard

public AbstractExampleWizard()
Method Detail

performFinish

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

log

protected void log(java.lang.Exception e)

getProjectDescriptors

protected abstract java.util.Collection getProjectDescriptors()
The subclass provides the specific project descriptors for the projects that should be unzipped into the workspace. Note that any projects that already exist in the workspace will not be overwritten as they may contain changes made by the user.

Returns:
The collection of project descriptors that should be unzipped into the workspace.

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
Specified by:
init in interface org.eclipse.ui.IWorkbenchWizard