Class ViewModelWizard
- java.lang.Object
-
- org.eclipse.jface.wizard.Wizard
-
- org.eclipse.emf.ecp.view.model.presentation.ViewModelWizard
-
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
,org.eclipse.jface.wizard.IWizard
,org.eclipse.ui.INewWizard
,org.eclipse.ui.IWorkbenchWizard
public class ViewModelWizard extends org.eclipse.jface.wizard.Wizard implements org.eclipse.ui.INewWizard
This is a simple wizard for creating a new model file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>
FILE_EXTENSIONS
The supported extensions for created files.static java.lang.String
FORMATTED_FILE_EXTENSIONS
A formatted list of supported file extensions, suitable for display.protected java.util.List<java.lang.String>
initialObjectNames
Caches the names of the types that can be created as the root object.protected org.eclipse.jface.viewers.IStructuredSelection
selection
Remember the selection during initialization for populating the default container.protected VViewFactory
viewFactory
This caches an instance of the model factory.protected VViewPackage
viewPackage
This caches an instance of the model package.protected org.eclipse.ui.IWorkbench
workbench
Remember the workbench during initialization.
-
Constructor Summary
Constructors Constructor Description ViewModelWizard()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addContribution(org.eclipse.core.resources.IFile modelFile)
Contributes the view model via the "..provider.xmi" extension point.void
addPages()
The framework calls this to create the contents of the wizard.protected void
addToBuildProperties(org.eclipse.core.resources.IFile modelFile)
Adds the folder where the view model is created to the project's build.properties file.boolean
canFinish()
void
clearSelectedContainer()
protected java.util.Collection<java.lang.String>
getInitialObjectNames()
Returns the names of the types that can be created as the root object.org.eclipse.jface.wizard.IWizardPage
getNextPage(org.eclipse.jface.wizard.IWizardPage page)
org.eclipse.jface.wizard.IWizardPage
getPreviousPage(org.eclipse.jface.wizard.IWizardPage page)
protected org.eclipse.core.resources.IFile
getSelectedEcore()
org.eclipse.jface.wizard.IWizardPage
getStartingPage()
static IDEViewModelRegistry
getViewModelRegistry()
Return theIDEViewModelRegistry
.void
init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
This just records the information.boolean
performFinish()
Do the work after everything is specified.void
setSelectedContainer(java.lang.Object selectedContainer)
void
setSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
void
setWorkbench(org.eclipse.ui.IWorkbench workbench)
-
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getShell, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jface.wizard.IWizard
createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
-
-
-
-
Field Detail
-
FILE_EXTENSIONS
public static final java.util.List<java.lang.String> FILE_EXTENSIONS
The supported extensions for created files.
-
FORMATTED_FILE_EXTENSIONS
public static final java.lang.String FORMATTED_FILE_EXTENSIONS
A formatted list of supported file extensions, suitable for display.
-
viewPackage
protected VViewPackage viewPackage
This caches an instance of the model package.
-
viewFactory
protected VViewFactory viewFactory
This caches an instance of the model factory.
-
selection
protected org.eclipse.jface.viewers.IStructuredSelection selection
Remember the selection during initialization for populating the default container.
-
workbench
protected org.eclipse.ui.IWorkbench workbench
Remember the workbench during initialization.
-
initialObjectNames
protected java.util.List<java.lang.String> initialObjectNames
Caches the names of the types that can be created as the root object.
-
-
Method Detail
-
setSelectedContainer
public void setSelectedContainer(java.lang.Object selectedContainer)
- Parameters:
selectedContainer
- the selectedContainer to set
-
clearSelectedContainer
public void clearSelectedContainer()
-
setSelection
public void setSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
- Parameters:
selection
- the selection to set
-
init
public void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
This just records the information.- Specified by:
init
in interfaceorg.eclipse.ui.IWorkbenchWizard
-
getInitialObjectNames
protected java.util.Collection<java.lang.String> getInitialObjectNames()
Returns the names of the types that can be created as the root object.
-
addPages
public void addPages()
The framework calls this to create the contents of the wizard.- Specified by:
addPages
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
addPages
in classorg.eclipse.jface.wizard.Wizard
-
getStartingPage
public org.eclipse.jface.wizard.IWizardPage getStartingPage()
- Specified by:
getStartingPage
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
getStartingPage
in classorg.eclipse.jface.wizard.Wizard
-
getNextPage
public org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
- Specified by:
getNextPage
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
getNextPage
in classorg.eclipse.jface.wizard.Wizard
-
getPreviousPage
public org.eclipse.jface.wizard.IWizardPage getPreviousPage(org.eclipse.jface.wizard.IWizardPage page)
- Specified by:
getPreviousPage
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
getPreviousPage
in classorg.eclipse.jface.wizard.Wizard
-
canFinish
public boolean canFinish()
- Specified by:
canFinish
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
canFinish
in classorg.eclipse.jface.wizard.Wizard
-
performFinish
public boolean performFinish()
Do the work after everything is specified.- Specified by:
performFinish
in interfaceorg.eclipse.jface.wizard.IWizard
- Specified by:
performFinish
in classorg.eclipse.jface.wizard.Wizard
-
getSelectedEcore
protected org.eclipse.core.resources.IFile getSelectedEcore()
- Returns:
- the Ecore container
-
addToBuildProperties
protected void addToBuildProperties(org.eclipse.core.resources.IFile modelFile)
Adds the folder where the view model is created to the project's build.properties file.- Parameters:
modelFile
- the view model IFile
-
addContribution
protected void addContribution(org.eclipse.core.resources.IFile modelFile)
Contributes the view model via the "..provider.xmi" extension point. If the project doesn't have a plugin.xml file, one will be created.- Parameters:
modelFile
- the view model IFile
-
getViewModelRegistry
public static IDEViewModelRegistry getViewModelRegistry()
Return theIDEViewModelRegistry
.- Returns:
- the
IDEViewModelRegistry
-
setWorkbench
public void setWorkbench(org.eclipse.ui.IWorkbench workbench)
- Parameters:
workbench
- the workbench to set
-
-