it.uniroma3.plasm.wizards
Class PlasmNewProject

java.lang.Object
  extended byorg.eclipse.jface.wizard.Wizard
      extended byorg.eclipse.ui.wizards.newresource.BasicNewResourceWizard
          extended byit.uniroma3.plasm.wizards.PlasmNewProject
All Implemented Interfaces:
org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.INewWizard, org.eclipse.jface.wizard.IWizard, org.eclipse.ui.IWorkbenchWizard

public class PlasmNewProject
extends org.eclipse.ui.wizards.newresource.BasicNewResourceWizard
implements org.eclipse.core.runtime.IExecutableExtension

Standard workbench wizard that creates a new project resource in the workspace.

This class may be instantiated and used without further configuration; this class is not intended to be subclassed.

Example:

 IWorkbenchWizard wizard = new PlasmNewProjectWizard();
 wizard.init(workbench, selection);
 WizardDialog dialog = new WizardDialog(shell, wizard);
 dialog.open();
 
During the call to open, the wizard dialog is presented to the user. When the user hits Finish, a project resource with the user-specified name is created, the dialog closes, and the call to open returns.


Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
PlasmNewProject()
          Creates a wizard for creating a new project resource in the workspace.
 
Method Summary
 void addPages()
           
 org.eclipse.core.resources.IProject getNewProject()
          Returns the newly created project.
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection currentSelection)
           
 boolean performFinish()
           
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement cfig, java.lang.String propertyName, java.lang.Object data)
          Stores the configuration element for the wizard.
static void updatePerspective(org.eclipse.core.runtime.IConfigurationElement configElement)
          Updates the perspective based on the current settings in the Workbench/Perspectives preference page.
 
Methods inherited from class org.eclipse.ui.wizards.newresource.BasicNewResourceWizard
getSelection, getWorkbench, selectAndReveal
 
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
equals, 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
 

Constructor Detail

PlasmNewProject

public PlasmNewProject()
Creates a wizard for creating a new project resource in the workspace.

Method Detail

addPages

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

getNewProject

public org.eclipse.core.resources.IProject getNewProject()
Returns the newly created project.

Returns:
the created project, or null if project not created

init

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

performFinish

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

setInitializationData

public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement cfig,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
Stores the configuration element for the wizard. The config element will be used in performFinish to set the result perspective.

Specified by:
setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension

updatePerspective

public static void updatePerspective(org.eclipse.core.runtime.IConfigurationElement configElement)
Updates the perspective based on the current settings in the Workbench/Perspectives preference page.

A new project wizard class will need to implement the IExecutableExtension interface so as to gain access to the wizard's IConfigurationElement. That is the configuration element to pass into this method.

See Also:
IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_WINDOW, IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_PAGE, IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE, IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE