|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWizardPage
org.csstudio.ui.util.wizards.WizardNewFileCreationPage
public class WizardNewFileCreationPage
Standard main page for a wizard that creates a file resource.
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
Code is based upon
org.eclipse.ui.dialogs.WizardNewFileCreationPage
in plugin
org.eclipse.ui.ide
.
Constructor Summary | |
---|---|
WizardNewFileCreationPage(java.lang.String pageName,
IStructuredSelection selection)
Creates a new file creation wizard page. |
|
WizardNewFileCreationPage(java.lang.String pageName,
IStructuredSelection selection,
boolean canChooseProject)
Creates a new file creation wizard page. |
Method Summary | |
---|---|
void |
createControl(Composite parent)
|
protected void |
createFile(IFile fileHandle,
java.io.InputStream contents)
Creates a file resource given the file handle and contents. |
protected IFile |
createFileHandle(IPath filePath)
Creates a file resource handle for the file with the given workspace path. |
IFile |
createNewFile()
Creates a new file resource in the selected container and with the selected name. |
IPath |
getContainerFullPath()
Returns the current full path of the containing resource as entered or selected by the user, or its anticipated initial value. |
java.lang.String |
getFileExtension()
Return the file extension. |
java.lang.String |
getFileName()
Returns the current file name as entered by the user, or its anticipated initial value. |
protected java.io.InputStream |
getInitialContents()
Returns a stream containing the initial contents to be given to new file resource instances. |
protected java.lang.String |
getNewFileLabel()
Returns the label to display in the file name specification visual component group. |
void |
handleEvent(Event event)
The WizardNewFileCreationPage implementation of this
Listener method handles all events and enablements for
controls on this page. |
protected 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. |
void |
setContainerFullPath(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. |
void |
setFileName(java.lang.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. |
void |
setVisible(boolean visible)
|
protected boolean |
validatePage()
Returns whether this page's controls currently all contain valid values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WizardNewFileCreationPage(java.lang.String pageName, IStructuredSelection selection)
pageName
- the name of the pageselection
- the current resource selectionpublic WizardNewFileCreationPage(java.lang.String pageName, IStructuredSelection selection, boolean canChooseProject)
pageName
- the name of the pageselection
- the current resource selectioncanChooseProject
- flag to allow the selection of the target projectMethod Detail |
---|
public final void createControl(Composite parent)
protected final void createFile(IFile fileHandle, java.io.InputStream contents) throws CoreException
fileHandle
- the file handle to create a file resource withcontents
- the initial contents of the new file resource, or
null
if none (equivalent to an empty stream)
CoreException
- if the operation failsprotected final IFile createFileHandle(IPath filePath)
createFile
.
filePath
- the path of the file resource to create a handle for
createFile(IFile, java.io.InputStream)
public final IFile createNewFile()
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.
null
if the file was
not createdpublic final IPath getContainerFullPath()
null
if no path is knownpublic java.lang.String getFileName()
null
if no file name is knownprotected java.io.InputStream getInitialContents()
protected java.lang.String getNewFileLabel()
Subclasses may reimplement.
public void handleEvent(Event event)
WizardNewFileCreationPage
implementation of this
Listener
method handles all events and enablements for
controls on this page. Subclasses may extend.
event
- The event to handle.protected final void initialPopulateContainerNameField()
public final void setContainerFullPath(IPath path)
path
- the full path to the containerpublic final void setFileName(java.lang.String value)
value
- new file nameprotected final boolean validatePage()
true
if all controls are valid, and
false
if at least one is invalidpublic final void setVisible(boolean visible)
public java.lang.String getFileExtension()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |