public abstract class AbstractTemplateModelHandler extends java.lang.Object implements ITemplateModelHandler
ITemplateModelHandler interface. This
implementation splits the ITemplateModelHandler.createFiles(IProgressMonitor, TemplateConfiguration)
method into three steps; preFileCreation, doFileCreation, postFileCreation.
The default implementation of postFileCreation, opens the first newly created model in an eclipse editor.
| Constructor and Description |
|---|
AbstractTemplateModelHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config)
Creates model files using the data from the given template configuration.
|
TemplateConfiguration |
createTemplateConfiguration(ITemplate template)
Creates the template configuration for the given
ITemplate,
to be populated by the wizard. |
protected abstract org.eclipse.core.resources.IFile[] |
doCreateFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config)
Create the model files.
|
protected java.lang.String |
getFinalPerspective(TemplateConfiguration config)
Return the id which identifies a perspective to activate.
|
protected java.lang.String |
getPreferredPerspectives(TemplateConfiguration config)
Return a comma-separated list of perspective IDs.
|
protected boolean |
postFileCreation(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
org.eclipse.core.resources.IFile[] files)
Complete post file creation tasks.
|
protected boolean |
preFileCreation(org.eclipse.core.runtime.IProgressMonitor monitor,
TemplateConfiguration config)
T
Complete pre file creation tasks.
|
public TemplateConfiguration createTemplateConfiguration(ITemplate template)
ITemplateModelHandlerITemplate,
to be populated by the wizard.createTemplateConfiguration in interface ITemplateModelHandlertemplate - the template to configurepublic final boolean createFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config)
ITemplateModelHandlercreateFiles in interface ITemplateModelHandlerprogressMonitor - the progress monitorconfig - the template configuration datatrue if model(s) are created successfully, false otherwiseprotected boolean preFileCreation(org.eclipse.core.runtime.IProgressMonitor monitor,
TemplateConfiguration config)
monitor - the progress monitorconfig - the template configuration datatrue if pre file creation completed successfully,
false otherwiseprotected java.lang.String getFinalPerspective(TemplateConfiguration config)
config - the template configuration dataprotected java.lang.String getPreferredPerspectives(TemplateConfiguration config)
config - the template configuration dataprotected abstract org.eclipse.core.resources.IFile[] doCreateFiles(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
TemplateConfiguration config)
progressMonitor - the progress monitorconfig - the template configuration datanull if the operation failedprotected boolean postFileCreation(org.eclipse.core.runtime.IProgressMonitor progressMonitor,
org.eclipse.core.resources.IFile[] files)
The default implementation opens the first newly created model in an eclipse editor.
progressMonitor - the progress monitorfiles - the newly created filestrue if post file creation completed successfully,
false otherwise