public class FileTemplateModelHandler extends AbstractTemplateModelHandler
ITemplateModelHandler
creates a new model
from a model template file, where the template data is of type FileTemplate
.Modifier | Constructor and Description |
---|---|
protected |
FileTemplateModelHandler() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
appendExtensionToFileName(java.lang.String filename,
java.lang.String fileExtension)
Appends the given file extension to the given file name.
|
protected org.eclipse.emf.ecore.resource.Resource[] |
createResources(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config,
org.eclipse.emf.transaction.TransactionalEditingDomain domain)
Create the resources in memory
|
TemplateConfiguration |
createTemplateConfiguration(ITemplate template)
Creates the template configuration for the given
ITemplate ,
to be populated by the wizard. |
protected org.eclipse.core.resources.IFile[] |
doCreateFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config)
Create the model files.
|
protected org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain()
Return the editing domain to to create the new model resource in.
|
static FileTemplateModelHandler |
getFileTemplateModelHandler() |
protected java.util.Map<java.lang.Object,java.lang.Object> |
getSaveOptions()
Return the resource save options.
|
createFiles, getFinalPerspective, getPreferredPerspectives, postFileCreation, preFileCreation
public static final FileTemplateModelHandler getFileTemplateModelHandler()
protected java.util.Map<java.lang.Object,java.lang.Object> getSaveOptions()
protected org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
protected org.eclipse.emf.ecore.resource.Resource[] createResources(org.eclipse.core.runtime.IProgressMonitor progressMonitor, TemplateConfiguration config, org.eclipse.emf.transaction.TransactionalEditingDomain domain)
progressMonitor
- the progress monitorconfig
- the template configuration datadomain
- the editing domain to create the resources intonull
if the operation failedprotected final org.eclipse.core.resources.IFile[] doCreateFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor, TemplateConfiguration config)
AbstractTemplateModelHandler
doCreateFiles
in class AbstractTemplateModelHandler
progressMonitor
- the progress monitorconfig
- the template configuration datanull
if the operation failedpublic TemplateConfiguration createTemplateConfiguration(ITemplate template)
ITemplateModelHandler
ITemplate
,
to be populated by the wizard.createTemplateConfiguration
in interface ITemplateModelHandler
createTemplateConfiguration
in class AbstractTemplateModelHandler
template
- the template to configureprotected final java.lang.String appendExtensionToFileName(java.lang.String filename, java.lang.String fileExtension)
filename
- fileExtension
-