public abstract class AbstractNewModelPage
extends org.eclipse.jface.wizard.WizardPage
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.swt.widgets.Button |
browseButton
The container browse button.
|
protected org.eclipse.swt.widgets.Text |
containerControl
Container text box
|
protected static int |
DESCRIPTION_MINIMUM_WIDTH
Minimum width for description
|
protected org.eclipse.swt.widgets.Text |
fileNameControl
File name text box
|
protected java.lang.String |
helpID |
protected static int |
IMAGE_MAX_HEIGHT
For the image size as icons
|
protected static int |
IMAGE_MAX_WIDTH
For the image size as icons
|
protected org.eclipse.core.resources.IContainer |
resourceContainer |
protected org.eclipse.jface.viewers.IStructuredSelection |
selection
The selection, used by the new model wizard
|
Constructor and Description |
---|
AbstractNewModelPage(java.lang.String pageName,
org.eclipse.jface.viewers.IStructuredSelection selection)
Creates a new file creation wizard page.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createContainerControlGroup(org.eclipse.swt.widgets.Composite parent)
Creates the controls including buttons tree and table controls that
appear in the dialog box.
|
void |
createControl(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.swt.widgets.Label |
createFileNameLabel(org.eclipse.swt.widgets.Composite parent)
Create file name label.
|
static boolean |
createProject(org.eclipse.core.resources.IProject newProject,
java.net.URI newProjectLocation,
org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.jface.wizard.IWizardContainer wizard,
org.eclipse.core.resources.IProject[] refProjects)
Create the new project.
|
protected boolean |
finishPage(org.eclipse.core.runtime.IProgressMonitor monitor) |
protected org.eclipse.core.runtime.IPath |
getContainerPath()
Returns the container path
|
protected java.lang.String |
getContainerText()
Return the container text.
|
protected java.lang.String |
getContainingProjectName()
Return the name of the project which should contain the new resource.
|
protected java.lang.String |
getDefaultDirectoryName() |
protected java.lang.String |
getFileName()
Returns the text inside the filename control in this wizard page.
|
protected abstract java.lang.String |
getModelFileExtension()
Lazily instantiates the EXTENSION field to avoid premature plugin
loading.
|
protected void |
handleBrowse()
Handle the click of Browse button.
|
protected void |
initialPopulateContainerNameField()
The container should be set based on the resource selected by the user.
|
protected boolean |
isProjectWizard() |
protected org.eclipse.core.resources.IFile |
makeAndAppendFilename(int i,
java.lang.String originalFileName)
Makes a IFile filename based on the containerControl's filename.
|
protected java.lang.String |
makeFilename(java.lang.String originalFilename)
Makes a String filename that's valid and that doesn't exist based on the
originalFilename.
|
protected boolean |
preFinishPage() |
static void |
removeProject(boolean deleteContents,
org.eclipse.core.resources.IProject newProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Remove the project we have created.
|
void |
setHelpID(java.lang.String helpID)
Sets the help ID of this page.
|
void |
setVisible(boolean visible) |
protected void |
updateContainer(java.lang.String newContainer)
Update the container.
|
protected boolean |
validateContainer()
Checks the container name in containerControl for validity
|
protected boolean |
validateFilename()
Checks the filename in filenameControl for validity
|
protected boolean |
validatePage()
A page is considered validated if both the filename and container are OK.
|
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage
protected static final int DESCRIPTION_MINIMUM_WIDTH
protected static final int IMAGE_MAX_WIDTH
protected static final int IMAGE_MAX_HEIGHT
protected org.eclipse.swt.widgets.Text containerControl
protected org.eclipse.swt.widgets.Text fileNameControl
protected org.eclipse.swt.widgets.Button browseButton
protected org.eclipse.jface.viewers.IStructuredSelection selection
protected org.eclipse.core.resources.IContainer resourceContainer
protected java.lang.String helpID
public AbstractNewModelPage(java.lang.String pageName, org.eclipse.jface.viewers.IStructuredSelection selection)
pageName
- the name of the pageselection
- the current resource selectionpublic void setHelpID(java.lang.String helpID)
helpID
- the help ID of this pageprotected boolean isProjectWizard()
public void createControl(org.eclipse.swt.widgets.Composite parent)
protected void createContainerControlGroup(org.eclipse.swt.widgets.Composite parent)
parent
- the parent composite to be treated as the controls' parentprotected org.eclipse.swt.widgets.Label createFileNameLabel(org.eclipse.swt.widgets.Composite parent)
parent
- protected void handleBrowse()
public void setVisible(boolean visible)
setVisible
in interface org.eclipse.jface.dialogs.IDialogPage
setVisible
in class org.eclipse.jface.dialogs.DialogPage
protected void updateContainer(java.lang.String newContainer)
newContainer
- a string that contains the name of the new containerprotected java.lang.String getContainingProjectName()
protected java.lang.String getContainerText()
protected boolean validateFilename()
protected boolean validateContainer()
protected org.eclipse.core.resources.IFile makeAndAppendFilename(int i, java.lang.String originalFileName)
i
- the integer to append the filename withoriginalFileName
- the original file nameprotected java.lang.String makeFilename(java.lang.String originalFilename)
originalFilename
- the original filename without extensionprotected void initialPopulateContainerNameField()
protected java.lang.String getFileName()
protected org.eclipse.core.runtime.IPath getContainerPath()
protected boolean validatePage()
protected abstract java.lang.String getModelFileExtension()
protected boolean preFinishPage()
protected boolean finishPage(org.eclipse.core.runtime.IProgressMonitor monitor)
public static boolean createProject(org.eclipse.core.resources.IProject newProject, java.net.URI newProjectLocation, org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.jface.wizard.IWizardContainer wizard, org.eclipse.core.resources.IProject[] refProjects)
newProject
- the new project.newProjectLocation
- the new project location.monitor
- the progress monitor.public static void removeProject(boolean deleteContents, org.eclipse.core.resources.IProject newProject, org.eclipse.core.runtime.IProgressMonitor monitor)
newProject
- the new project to remove.protected java.lang.String getDefaultDirectoryName()