Class WizardNewFileCreationPage
- All Implemented Interfaces:
- IDialogPage,- IMessageProvider,- IWizardPage,- Listener
This page may be used by clients as-is; it may be also be subclassed to suit.
Subclasses may override
- getInitialContents
- getNewFileLabel
Subclasses may extend
- handleEvent
- 
Field SummaryFields inherited from interface org.eclipse.jface.dialogs.IMessageProviderERROR, INFORMATION, NONE, WARNING
- 
Constructor SummaryConstructorsConstructorDescriptionWizardNewFileCreationPage(String pageName, IStructuredSelection selection) Creates a new file creation wizard page.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcreateAdvancedControls(Composite parent) Creates the widget for advanced options.voidcreateControl(Composite parent) Creates the top level control for this dialog page under the given parent composite.protected voidcreateFile(IFile fileHandle, InputStream contents, IProgressMonitor monitor) Deprecated.protected IFilecreateFileHandle(IPath filePath) Creates a file resource handle for the file with the given workspace path.protected voidCreates the link target path if a link target has been specified.Creates a new file resource in the selected container and with the selected name.protected ISchedulingRulecreateRule(IResource resource) Deprecated.As of 3.3, scheduling rules are provided by the undoable operation that this page creates and executes.Returns the current full path of the containing resource as entered or selected by the user, or its anticipated initial value.Returns the file extension to use when creating the new file.Returns the current file name as entered by the user, or its anticipated initial value.protected InputStreamReturns a stream containing the initial contents to be given to new file resource instances.protected StringReturns the label to display in the file name specification visual component group.protected voidShows/hides the advanced option widgets.voidhandleEvent(Event event) TheWizardNewFileCreationPageimplementation of thisListenermethod handles all events and enablements for controls on this page.protected voidSets the initial contents of the container name entry field, based upon either a previously-specified initial value or the ability to determine such a value.voidsetAllowExistingResources(boolean value) Sets the flag indicating whether existing resources are permitted to be specified on this page.voidsetContainerFullPath(IPath path) Sets the value of this page's container name field, or stores it for future use if this page's controls do not exist yet.voidsetFileExtension(String value) Set the only file extension allowed for this page's file name field.voidsetFileName(String value) Sets the value of this page's file name field, or stores it for future use if this page's controls do not exist yet.voidsetVisible(boolean visible) TheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state.protected IStatusChecks whether the linked resource target is valid.protected booleanReturns whether this page's controls currently all contain valid values.Methods inherited from class org.eclipse.jface.wizard.WizardPagecanFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toStringMethods inherited from class org.eclipse.jface.dialogs.DialogPageconvertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessageMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPagedispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelpMethods inherited from interface org.eclipse.jface.wizard.IWizardPagegetMinimumPageSize
- 
Constructor Details- 
WizardNewFileCreationPageCreates a new file 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 page
- selection- the current resource selection
 
 
- 
- 
Method Details- 
createAdvancedControlsCreates the widget for advanced options.- Parameters:
- parent- the parent composite
 
- 
createControlDescription 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 interface- IDialogPage
- Parameters:
- parent- the parent composite
 
- 
createFile@Deprecated protected void createFile(IFile fileHandle, InputStream contents, IProgressMonitor monitor) throws CoreException Deprecated.As of 3.3, use or overridecreateNewFile()which uses the undoable operation support. To supply customized file content for a subclass, usegetInitialContents().Creates a file resource given the file handle and contents.- Parameters:
- fileHandle- the file handle to create a file resource with
- contents- the initial contents of the new file resource, or- nullif none (equivalent to an empty stream)
- monitor- the progress monitor to show visual progress with
- Throws:
- CoreException- if the operation fails
- OperationCanceledException- if the operation is canceled
 
- 
createFileHandleCreates a file resource handle for the file with the given workspace path. This method does not create the file resource; this is the responsibility ofcreateFile.- Parameters:
- filePath- the path of the file resource to create a handle for
- Returns:
- the new file resource handle
- See Also:
 
- 
createLinkTargetprotected void createLinkTarget()Creates the link target path if a link target has been specified.
- 
createNewFileCreates a new file 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 on this page currently contain valid values. Note that this page caches the new file once it has been successfully created; subsequent invocations of this method will answer the same file resource without attempting to create it again. This method should be called within a workspace modify operation since it creates resources. - Returns:
- the created file resource, or nullif the file was not created
 
- 
createRuleDeprecated.As of 3.3, scheduling rules are provided by the undoable operation that this page creates and executes.Returns the scheduling rule to use when creating the resource at the given container path. The rule should be the creation rule for the top-most non-existing parent.- Parameters:
- resource- The resource being created
- Returns:
- The scheduling rule for creating the given resource
- Since:
- 3.1
 
- 
getContainerFullPathReturns the current full path of the containing resource as entered or selected by the user, or its anticipated initial value.- Returns:
- the container's full path, anticipated initial value, or
         nullif no path is known
 
- 
getFileNameReturns the current file name as entered by the user, or its anticipated initial value.
 
 The current file name will include the file extension if the preconditions are met.- Returns:
- the file name, its anticipated initial value, or nullif no file name is known
- See Also:
 
- 
getFileExtensionReturns the file extension to use when creating the new file.- Returns:
- the file extension or null.
- Since:
- 3.3
- See Also:
 
- 
getInitialContentsReturns a stream containing the initial contents to be given to new file resource instances. Subclasses may wish to override. This default implementation provides no initial contents.- Returns:
- initial contents to be given to new file resource instances
 
- 
getNewFileLabelReturns the label to display in the file name specification visual component group.Subclasses may reimplement. - Returns:
- the label to display in the file name specification visual component group
 
- 
handleAdvancedButtonSelectprotected void handleAdvancedButtonSelect()Shows/hides the advanced option widgets.
- 
handleEventTheWizardNewFileCreationPageimplementation of thisListenermethod handles all events and enablements for controls on this page. Subclasses may extend.- Specified by:
- handleEventin interface- Listener
- Parameters:
- event- the event which occurred
 
- 
initialPopulateContainerNameFieldprotected void initialPopulateContainerNameField()Sets the initial contents of the container name entry field, based upon either a previously-specified initial value or the ability to determine such a value.
- 
setAllowExistingResourcespublic void setAllowExistingResources(boolean value) Sets the flag indicating whether existing resources are permitted to be specified on this page.- Parameters:
- value-- trueif existing resources are permitted, and- falseotherwise
- Since:
- 3.4
 
- 
setContainerFullPathSets the value of this page's container name field, or stores it for future use if this page's controls do not exist yet.- Parameters:
- path- the full path to the container
 
- 
setFileNameSets the value of this page's file name field, or stores it for future use if this page's controls do not exist yet.- Parameters:
- value- new file name
 
- 
setFileExtensionSet the only file extension allowed for this page's file name field. If this page's controls do not exist yet, store it for future use.
 
 If a file extension is specified, then it will always be appended with a '.' to the text from the file name field for validation when the following conditions are met:
 
 (1) File extension length is greater than 0
 (2) File name field text length is greater than 0
 (3) File name field text does not already end with a '.' and the file extension specified (case sensitive)
 
 The file extension will not be reflected in the actual file name field until the file name field loses focus.- Parameters:
- value- The file extension without the '.' prefix (e.g. 'java', 'xml')
- Since:
- 3.3
 
- 
validateLinkedResourceChecks whether the linked resource target is valid. Sets the error message accordingly and returns the status.- Returns:
- IStatus validation result from the CreateLinkedResourceGroup
 
- 
validatePageprotected boolean validatePage()Returns whether this page's controls currently all contain valid values.- Returns:
- trueif all controls are valid, and- falseif at least one is invalid
 
- 
setVisiblepublic 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 interface- IDialogPage
- Overrides:
- setVisiblein class- DialogPage
- Parameters:
- visible-- trueto make this page visible, and- falseto hide it
 
 
- 
createNewFile()which uses the undoable operation support.