Package org.eclipse.ui.dialogs
Class WizardNewProjectCreationPage
- java.lang.Object
-
- org.eclipse.jface.dialogs.DialogPage
-
- org.eclipse.jface.wizard.WizardPage
-
- org.eclipse.ui.dialogs.WizardNewProjectCreationPage
-
- All Implemented Interfaces:
IDialogPage,IMessageProvider,IWizardPage
public class WizardNewProjectCreationPage extends WizardPage
Standard main page for a wizard that is creates a project resource.This page may be used by clients as-is; it may be also be subclassed to suit.
Example usage:
mainPage = new WizardNewProjectCreationPage("basicNewProjectPage"); mainPage.setTitle("Project"); mainPage.setDescription("Create a new project resource.");
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
-
-
Constructor Summary
Constructors Constructor Description WizardNewProjectCreationPage(String pageName)Creates a new project creation wizard page.WizardNewProjectCreationPage(String pageName, IStructuredSelection selection, String[] workingSetTypes)Deprecated.default placement of the working set group has been removed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateControl(Composite parent)Creates the top level control for this dialog page under the given parent composite.WorkingSetGroupcreateWorkingSetGroup(Composite composite, IStructuredSelection selection, String[] supportedWorkingSetTypes)Create a working set group for this page.IPathgetLocationPath()Returns the current project location path as entered by the user, or its anticipated initial value.URIgetLocationURI()/** Returns the current project location URI as entered by the user, ornullif a valid project location has not been entered.IProjectgetProjectHandle()Creates a project resource handle for the current project name field value.StringgetProjectName()Returns the current project name as entered by the user, or its anticipated initial value.IWorkingSet[]getSelectedWorkingSets()Return the selected working sets, if any.voidsetInitialProjectName(String name)Sets the initial project name that this page will use when created.voidsetVisible(boolean visible)TheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state.booleanuseDefaults()Returns the useDefaults.protected booleanvalidatePage()Returns whether this page's controls currently all contain valid values.-
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
-
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp
-
-
-
-
Constructor Detail
-
WizardNewProjectCreationPage
public WizardNewProjectCreationPage(String pageName)
Creates a new project creation wizard page.- Parameters:
pageName- the name of this page
-
WizardNewProjectCreationPage
@Deprecated public WizardNewProjectCreationPage(String pageName, IStructuredSelection selection, String[] workingSetTypes)
Deprecated.default placement of the working set group has been removed. If you wish to use the working set block please callcreateWorkingSetGroup(Composite, IStructuredSelection, String[])in your overriddencreateControl(Composite)implementation.Creates a new project creation wizard page.- Parameters:
pageName-selection-workingSetTypes-- Since:
- 3.4
-
-
Method Detail
-
createControl
public void createControl(Composite parent)
Description copied from interface:IDialogPageCreates the top level control for this dialog page under the given parent composite.Implementors are responsible for ensuring that the created control can be accessed via
getControl- Parameters:
parent- the parent composite
-
createWorkingSetGroup
public WorkingSetGroup createWorkingSetGroup(Composite composite, IStructuredSelection selection, String[] supportedWorkingSetTypes)
Create a working set group for this page. This method can only be called once.- Parameters:
composite- the composite in which to create the groupselection- the current workbench selectionsupportedWorkingSetTypes- an array of working set type IDs that will restrict what types of working sets can be chosen in this group- Returns:
- the created group. If this method has been called previously the original group will be returned.
- Since:
- 3.4
-
getLocationPath
public IPath getLocationPath()
Returns the current project location path as entered by the user, or its anticipated initial value. Note that if the default has been returned the path in a project description used to create a project should not be set.- Returns:
- the project location path or its anticipated initial value.
-
getLocationURI
public URI getLocationURI()
/** Returns the current project location URI as entered by the user, ornullif a valid project location has not been entered.- Returns:
- the project location URI, or
null - Since:
- 3.2
-
getProjectHandle
public IProject getProjectHandle()
Creates a project resource handle for the current project name field value. The project handle is created relative to the workspace root.This method does not create the project resource; this is the responsibility of
IProject::createinvoked by the new project resource wizard.- Returns:
- the new project resource handle
-
getProjectName
public String getProjectName()
Returns the current project name as entered by the user, or its anticipated initial value.- Returns:
- the project name, its anticipated initial value, or
nullif no project name is known
-
setInitialProjectName
public void setInitialProjectName(String name)
Sets the initial project name that this page will use when created. The name is ignored if the createControl(Composite) method has already been called. Leading and trailing spaces in the name are ignored. Providing the name of an existing project will not necessarily cause the wizard to warn the user. Callers of this method should first check if the project name passed already exists in the workspace.- Parameters:
name- initial project name for this page- See Also:
IWorkspace.validateName(String, int)
-
validatePage
protected boolean validatePage()
Returns whether this page's controls currently all contain valid values.- Returns:
trueif all controls are valid, andfalseif at least one is invalid
-
setVisible
public void setVisible(boolean visible)
Description copied from class:DialogPageTheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state. Subclasses may extend.- Specified by:
setVisiblein interfaceIDialogPage- Overrides:
setVisiblein classDialogPage- Parameters:
visible-trueto make this page visible, andfalseto hide it
-
useDefaults
public boolean useDefaults()
Returns the useDefaults.- Returns:
- boolean
-
getSelectedWorkingSets
public IWorkingSet[] getSelectedWorkingSets()
Return the selected working sets, if any. If this page is not configured to interact with working sets this will be an empty array.- Returns:
- the selected working sets
- Since:
- 3.4
-
-