Package org.eclipse.ui.dialogs
Class WizardNewFolderMainPage
- java.lang.Object
-
- org.eclipse.jface.dialogs.DialogPage
-
- org.eclipse.jface.wizard.WizardPage
-
- org.eclipse.ui.dialogs.WizardNewFolderMainPage
-
- All Implemented Interfaces:
IDialogPage,IMessageProvider,IWizardPage,Listener
public class WizardNewFolderMainPage extends WizardPage implements Listener
Standard main page for a wizard that creates a folder resource.This page may be used by clients as-is; it may be also be subclassed to suit.
Subclasses may extend
handleEvent
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
-
-
Constructor Summary
Constructors Constructor Description WizardNewFolderMainPage(String pageName, IStructuredSelection selection)Creates a new folder creation wizard page.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcreateAdvancedControls(Composite parent)Creates the widget for advanced options.protected IContainercreateContainerHandle(IPath containerPath)Creates a container resource handle for the container with the given workspace path.voidcreateControl(Composite parent)Creates the top level control for this dialog page under the given parent composite.protected voidcreateFolder(IFolder folderHandle, IProgressMonitor monitor)Deprecated.As of 3.3, usecreateNewFolder()which uses the undoable operation support.protected IFoldercreateFolderHandle(IPath folderPath)Creates a folder resource handle for the folder with the given workspace path.protected voidcreateLinkTarget()Creates the link target path if a link target has been specified.IFoldercreateNewFolder()Creates a new folder resource in the selected container and with the selected name.voiddispose()TheDialogPageimplementation of thisIDialogPagemethod disposes of the page image if it has one.protected voidhandleAdvancedButtonSelect()Shows/hides the advanced option widgets.voidhandleEvent(Event ev)TheWizardNewFolderCreationPageimplementation of thisListenermethod handles all events and enablements for controls on this page.protected voidinitializePage()Initializes this page's controls.voidsetVisible(boolean visible)TheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state.protected IStatusvalidateLinkedResource()Checks whether the linked resource target is valid.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, 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
getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp
-
-
-
-
Constructor Detail
-
WizardNewFolderMainPage
public WizardNewFolderMainPage(String pageName, IStructuredSelection selection)
Creates a new folder creation wizard page. If the initial resource selection contains exactly one container resource then it will be used as the default container resource.- Parameters:
pageName- the name of the pageselection- the current resource selection
-
-
Method Detail
-
createAdvancedControls
protected void createAdvancedControls(Composite parent)
Creates the widget for advanced options.- Parameters:
parent- the parent composite
-
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- Specified by:
createControlin interfaceIDialogPage- Parameters:
parent- the parent composite
-
createFolder
@Deprecated protected void createFolder(IFolder folderHandle, IProgressMonitor monitor) throws CoreException
Deprecated.As of 3.3, usecreateNewFolder()which uses the undoable operation support.Creates a folder resource given the folder handle.- Parameters:
folderHandle- the folder handle to create a folder resource formonitor- the progress monitor to show visual progress with- Throws:
CoreException- if the operation failsOperationCanceledException- if the operation is canceled
-
createFolderHandle
protected IFolder createFolderHandle(IPath folderPath)
Creates a folder resource handle for the folder with the given workspace path. This method does not create the folder resource; this is the responsibility ofcreateFolder.- Parameters:
folderPath- the path of the folder resource to create a handle for- Returns:
- the new folder resource handle
- See Also:
createFolder(org.eclipse.core.resources.IFolder, org.eclipse.core.runtime.IProgressMonitor)
-
createContainerHandle
protected IContainer createContainerHandle(IPath containerPath)
Creates a container resource handle for the container with the given workspace path. This method does not create the resource.- Parameters:
containerPath- the path of the container resource to create a handle for- Returns:
- the new container resource handle
- Since:
- 3.6
- See Also:
createFolder(org.eclipse.core.resources.IFolder, org.eclipse.core.runtime.IProgressMonitor)
-
createLinkTarget
protected void createLinkTarget()
Creates the link target path if a link target has been specified.
-
createNewFolder
public IFolder createNewFolder()
Creates a new folder resource in the selected container and with the selected name. Creates any missing resource containers along the path; does nothing if the container resources already exist.In normal usage, this method is invoked after the user has pressed Finish on the wizard; the enablement of the Finish button implies that all controls on this page currently contain valid values.
Note that this page caches the new folder once it has been successfully created; subsequent invocations of this method will answer the same folder resource without attempting to create it again.
This method should be called within a workspace modify operation since it creates resources.
- Returns:
- the created folder resource, or
nullif the folder was not created
-
handleAdvancedButtonSelect
protected void handleAdvancedButtonSelect()
Shows/hides the advanced option widgets.
-
dispose
public void dispose()
Description copied from class:DialogPageTheDialogPageimplementation of thisIDialogPagemethod disposes of the page image if it has one. Subclasses may extend.- Specified by:
disposein interfaceIDialogPage- Overrides:
disposein classDialogPage
-
handleEvent
public void handleEvent(Event ev)
TheWizardNewFolderCreationPageimplementation of thisListenermethod handles all events and enablements for controls on this page. Subclasses may extend.- Specified by:
handleEventin interfaceListener- Parameters:
ev- the event which occurred
-
initializePage
protected void initializePage()
Initializes this page's controls.
-
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
-
validateLinkedResource
protected IStatus validateLinkedResource()
Checks whether the linked resource target is valid. Sets the error message accordingly and returns the status.- Returns:
- IStatus validation result from the CreateLinkedResourceGroup
-
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
-
-