public class NewModelFromTemplatePage extends AbstractNewModelPage
Modifier and Type | Class and Description |
---|---|
protected class |
NewModelFromTemplatePage.MergedCategory
Group of categories with the same label and parent.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<ITemplate,TemplateConfiguration> |
configsCache
Template configuration cache
|
protected java.util.Map<ITemplate,TemplateConfigurationPageGroupNavigator> |
groupNavigatorCache
Template configuration page group navigator cache
|
protected static java.lang.String |
LAST_CATEGORY |
protected static java.lang.String |
LAST_TEMPLATE |
browseButton, containerControl, DESCRIPTION_MINIMUM_WIDTH, fileNameControl, helpID, IMAGE_MAX_HEIGHT, IMAGE_MAX_WIDTH, resourceContainer, selection
Constructor and Description |
---|
NewModelFromTemplatePage(java.lang.String pageName,
org.eclipse.jface.viewers.IStructuredSelection selection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowUseOfTemplate(ITemplate template)
Return whether the use of the given template is allowed.
|
boolean |
canFlipToNextPage() |
void |
createControl(org.eclipse.swt.widgets.Composite parent)
Creates the controls including buttons tree and table controls that
appear in the dialog box.
|
protected TemplateConfigurationPageGroupNavigator |
createGroupNavigator(java.lang.String templateId)
Create corresponding template configuration page group navigator for
given template id.
|
protected boolean |
finishPage(org.eclipse.core.runtime.IProgressMonitor monitor) |
protected java.lang.String |
getInitialCategorySelectionID()
Get the category ID to be selected.
|
protected java.lang.String |
getInitialTemplateSelectionID()
Get the template ID to be selected.
|
protected java.lang.String |
getModelFileExtension()
Lazily instantiates the EXTENSION field to avoid premature plugin
loading.
|
protected com.ibm.xtools.common.ui.wizards.internal.NewModelWizardRegistry |
getNewModelWizardRegistry()
Returns NewModelWizardRegistry
|
org.eclipse.jface.wizard.IWizardPage |
getNextPage() |
protected ITemplate |
getSelectedTemplate()
Return the selected template.
|
protected TemplateConfiguration |
getTemplateConfiguration()
Return the template configuration for the selected template.
|
TemplateConfigurationPageGroupNavigator |
getTemplateConfigurationPageGroupNavigator()
Return the template configuration page group navigator for the selected template.
|
protected void |
initCategoriesViewer(org.eclipse.jface.viewers.TreeViewer categories)
Initializes the categories tree viewer.
|
protected void |
initTemplatesViewer(org.eclipse.jface.viewers.TableViewer templates)
Initializes the templates table viewer.
|
protected boolean |
isCategoryDisplayable(ICategory category)
Return
true if the category should be displayed
in the categories viewer, false otherwise. |
protected boolean |
isTemplateDisplayable(ITemplate template)
Return
true if the template should be displayed
in the templates viewer, false otherwise. |
protected boolean |
preFinishPage() |
protected void |
readPageSettings()
Read the wizard page settings for the default category and template.
|
protected void |
savePageSettings()
Save the wizard page settings for the default category and template.
|
protected boolean |
validatePage()
A page is considered validated if both the filename and container are OK.
|
protected boolean |
validateTemplate()
Validate the selected template.
|
createContainerControlGroup, createFileNameLabel, createProject, getContainerPath, getContainerText, getContainingProjectName, getDefaultDirectoryName, getFileName, handleBrowse, initialPopulateContainerNameField, isProjectWizard, makeAndAppendFilename, makeFilename, removeProject, setHelpID, setVisible, updateContainer, validateContainer, validateFilename
getContainer, getDialogSettings, getImage, getName, 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 java.lang.String LAST_CATEGORY
protected static final java.lang.String LAST_TEMPLATE
protected java.util.Map<ITemplate,TemplateConfiguration> configsCache
protected final java.util.Map<ITemplate,TemplateConfigurationPageGroupNavigator> groupNavigatorCache
public NewModelFromTemplatePage(java.lang.String pageName, org.eclipse.jface.viewers.IStructuredSelection selection)
pageName
- selection
- protected void readPageSettings()
protected void savePageSettings()
public void createControl(org.eclipse.swt.widgets.Composite parent)
createControl
in interface org.eclipse.jface.dialogs.IDialogPage
createControl
in class AbstractNewModelPage
parent
- the parent composite to be treated as the controls' parentprotected com.ibm.xtools.common.ui.wizards.internal.NewModelWizardRegistry getNewModelWizardRegistry()
protected void initCategoriesViewer(org.eclipse.jface.viewers.TreeViewer categories)
categories
- the categories tree viewerprotected void initTemplatesViewer(org.eclipse.jface.viewers.TableViewer templates)
templates
- the templates table viewerprotected boolean isCategoryDisplayable(ICategory category)
true
if the category should be displayed
in the categories viewer, false
otherwise.category
- the category to displaytrue
if the category should be displayed
in the categories viewer, false
otherwiseprotected boolean isTemplateDisplayable(ITemplate template)
true
if the template should be displayed
in the templates viewer, false
otherwise.template
- the template to displaytrue
if the template should be displayed
in the templates viewer, false
otherwiseprotected java.lang.String getInitialCategorySelectionID()
null
to select the first category.protected java.lang.String getInitialTemplateSelectionID()
null
to select the first template.
Note: If the template is not found under the initial category, then the first template will be selected.
protected boolean validateTemplate()
protected boolean validatePage()
validatePage
in class AbstractNewModelPage
protected ITemplate getSelectedTemplate()
public TemplateConfigurationPageGroupNavigator getTemplateConfigurationPageGroupNavigator()
protected TemplateConfigurationPageGroupNavigator createGroupNavigator(java.lang.String templateId)
templateId
- given template idprotected TemplateConfiguration getTemplateConfiguration()
protected boolean preFinishPage()
preFinishPage
in class AbstractNewModelPage
protected boolean finishPage(org.eclipse.core.runtime.IProgressMonitor monitor)
finishPage
in class AbstractNewModelPage
protected java.lang.String getModelFileExtension()
AbstractNewModelPage
getModelFileExtension
in class AbstractNewModelPage
public boolean canFlipToNextPage()
canFlipToNextPage
in interface org.eclipse.jface.wizard.IWizardPage
canFlipToNextPage
in class org.eclipse.jface.wizard.WizardPage
public org.eclipse.jface.wizard.IWizardPage getNextPage()
getNextPage
in interface org.eclipse.jface.wizard.IWizardPage
getNextPage
in class org.eclipse.jface.wizard.WizardPage
protected boolean allowUseOfTemplate(ITemplate template)
If the given template is null
return false
.
template
- the template in questiontrue
if the use of the given template
is allowed, false
otherwise