org.eclipse.emf.common.ui.wizard
Class AbstractExampleInstallerWizard
java.lang.Object
org.eclipse.jface.wizard.Wizard
org.eclipse.emf.common.ui.wizard.AbstractExampleInstallerWizard
- All Implemented Interfaces:
- IShellProvider, IWizard, INewWizard, IWorkbenchWizard
- Direct Known Subclasses:
- ExampleInstallerWizard
public abstract class AbstractExampleInstallerWizard
- extends Wizard
- implements INewWizard, IShellProvider
This abstract example installer wizard simply copies or unzips a number of files and
directories into the workspace, creating the projects to hold them. This wizard 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 getProjectDescriptors()
method to provide the location and name of the project content that should be added to 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. Any label and icon can be
freely given to the wizard to suit the needs of the client.
- Since:
- 2.2.0
Methods inherited from class org.eclipse.jface.wizard.Wizard |
addPage, canFinish, createPageControls, 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, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer |
OVERWRITE_ALL_QUERY
protected static final IOverwriteQuery OVERWRITE_ALL_QUERY
workbench
protected IWorkbench workbench
structuredSelection
protected IStructuredSelection structuredSelection
projectPage
protected AbstractExampleInstallerWizard.ProjectPage projectPage
AbstractExampleInstallerWizard
public AbstractExampleInstallerWizard()
init
public void init(IWorkbench workbench,
IStructuredSelection selection)
- Specified by:
init
in interface IWorkbenchWizard
getProjectDescriptors
protected abstract java.util.List<AbstractExampleInstallerWizard.ProjectDescriptor> getProjectDescriptors()
- Returns the project descriptors to be used by this wizard. This method is
called multiple times, so subclasses are expected to cache this information
if necessary.
- Returns:
- a list of ProjectDescriptors
getFilesToOpen
protected abstract java.util.List<AbstractExampleInstallerWizard.FileToOpen> getFilesToOpen()
dispose
public void dispose()
- Specified by:
dispose
in interface IWizard
- Overrides:
dispose
in class Wizard
addPages
public void addPages()
- Specified by:
addPages
in interface IWizard
- Overrides:
addPages
in class Wizard
performFinish
public boolean performFinish()
- Specified by:
performFinish
in interface IWizard
- Specified by:
performFinish
in class Wizard
deleteExistingProjects
protected Diagnostic deleteExistingProjects(IProgressMonitor monitor)
installExample
protected void installExample(IProgressMonitor progressMonitor)
throws java.lang.Exception
- Throws:
java.lang.Exception
openFiles
protected void openFiles(IProgressMonitor progressMonitor)
openErrorDialog
protected void openErrorDialog(java.lang.String message,
java.lang.Throwable throwable)
createProject
protected void createProject(AbstractExampleInstallerWizard.ProjectDescriptor projectDescriptor,
IProgressMonitor monitor)
throws CoreException
- Throws:
CoreException
createImportOperation
protected ImportOperation createImportOperation(AbstractExampleInstallerWizard.ProjectDescriptor projectDescriptor)
throws java.lang.Exception
- Throws:
java.lang.Exception
createDirectoryImportOperation
protected ImportOperation createDirectoryImportOperation(AbstractExampleInstallerWizard.ProjectDescriptor projectDescriptor)
throws java.lang.Exception
- Throws:
java.lang.Exception
createFileImportOperation
protected ImportOperation createFileImportOperation(AbstractExampleInstallerWizard.ProjectDescriptor projectDescriptor)
throws java.lang.Exception
- Throws:
java.lang.Exception
isZipFile
protected boolean isZipFile(java.io.File file)
createZipImportOperation
protected ImportOperation createZipImportOperation(AbstractExampleInstallerWizard.ProjectDescriptor projectDescriptor,
java.io.File file)
throws java.lang.Exception
- Throws:
java.lang.Exception
getWorkbench
protected IWorkbench getWorkbench()
getSelection
protected IStructuredSelection getSelection()
openEditor
protected void openEditor(IFile file,
java.lang.String editorID)
throws PartInitException
- Throws:
PartInitException