public class SelectSubclassAndTemplateWizard
extends org.eclipse.jface.wizard.Wizard
EClass
on the first page and a model element on the second page. Thereby, the
second page only shows model elements that are an instance of the selected EClass.
If there is only one possible EClass, the class selection page is skipped and the template selection is shown
directly.
If there is only one template left after selecting the EClass, the template selection page is skipped and the
remaining Template
counts as selected.
Constructor and Description |
---|
SelectSubclassAndTemplateWizard(String windowTitle,
Set<org.eclipse.emf.ecore.EClass> subClasses,
Set<Template> templates,
EMFFormsLocalizationService localizationService)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addPages() |
boolean |
canFinish() |
protected Set<Template> |
getAvailableTemplates(org.eclipse.emf.ecore.EClass eClass)
Get all available templates for the given
EClass . |
org.eclipse.jface.wizard.IWizardPage |
getNextPage(org.eclipse.jface.wizard.IWizardPage page) |
Optional<Template> |
getSelectedTemplate()
Returns the template selected by the user.
|
boolean |
performFinish() |
protected void |
setSubClass(org.eclipse.emf.ecore.EClass subClass)
Update the selected sub class.
|
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
public SelectSubclassAndTemplateWizard(String windowTitle, Set<org.eclipse.emf.ecore.EClass> subClasses, Set<Template> templates, EMFFormsLocalizationService localizationService)
windowTitle
- The title of the wizardsubClasses
- The EClasses to choose fromtemplates
- The available templates for all given EClasseslocalizationService
- The EMFFormsLocalizationService
public boolean performFinish()
performFinish
in interface org.eclipse.jface.wizard.IWizard
performFinish
in class org.eclipse.jface.wizard.Wizard
public boolean canFinish()
canFinish
in interface org.eclipse.jface.wizard.IWizard
canFinish
in class org.eclipse.jface.wizard.Wizard
public Optional<Template> getSelectedTemplate()
Template
, or the empty Optional if none was selectedpublic void addPages()
addPages
in interface org.eclipse.jface.wizard.IWizard
addPages
in class org.eclipse.jface.wizard.Wizard
public org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
getNextPage
in interface org.eclipse.jface.wizard.IWizard
getNextPage
in class org.eclipse.jface.wizard.Wizard
protected void setSubClass(org.eclipse.emf.ecore.EClass subClass)
SubClassSelectionPage
.subClass
- The selected sub classprotected Set<Template> getAvailableTemplates(org.eclipse.emf.ecore.EClass eClass)
EClass
. Thereby, only templates whose instance exactly match
the given EClass are returned. This does not include templates for sub classes of the given
EClass.eClass
- The EClass
Copyright © 2019. All rights reserved.