public class CreateNewModelFileJob
extends org.eclipse.core.resources.WorkspaceJob
file
in the workspace. This model file to be created must not be null. The
initial model is based on the given metamodel descriptor
. The initial model will create
a root object using a root object classifier, and a root object
package for the model to be contained.
This job is set by default the priority to Job.BUILD and the rule to the workspace root to be run with the job manager.
Modifier and Type | Field and Description |
---|---|
protected IMetaModelDescriptor |
metaModelDescriptor |
protected org.eclipse.core.resources.IFile |
newFile |
protected org.eclipse.emf.ecore.EClassifier |
rootObjectEClassifier |
protected org.eclipse.emf.ecore.EPackage |
rootObjectEPackage |
Constructor and Description |
---|
CreateNewModelFileJob(java.lang.String jobName,
org.eclipse.core.resources.IFile newFile,
IMetaModelDescriptor metaModelDescriptor,
org.eclipse.emf.ecore.EPackage rootObjectEPackage,
org.eclipse.emf.ecore.EClassifier rootObjectEClassifier)
Creates a new instance of this CreateNewModelFileJob.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.emf.ecore.EObject |
createInitialModel()
Creates the initial model to be added to the new model file.
|
org.eclipse.core.runtime.IStatus |
runInWorkspace(org.eclipse.core.runtime.IProgressMonitor monitor) |
protected void |
saveInitialModel(org.eclipse.emf.ecore.EObject rootObject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Saves the initial model rooted by given root object to a new file in the workspace.
|
addJobChangeListener, belongsTo, cancel, canceling, create, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
protected org.eclipse.core.resources.IFile newFile
protected IMetaModelDescriptor metaModelDescriptor
protected org.eclipse.emf.ecore.EPackage rootObjectEPackage
protected org.eclipse.emf.ecore.EClassifier rootObjectEClassifier
public CreateNewModelFileJob(java.lang.String jobName, org.eclipse.core.resources.IFile newFile, IMetaModelDescriptor metaModelDescriptor, org.eclipse.emf.ecore.EPackage rootObjectEPackage, org.eclipse.emf.ecore.EClassifier rootObjectEClassifier)
jobName
- the name of the jobnewFile
- the model file that will be created, must not be null
metaModelDescriptor
- the descriptor of metamodel the model file should be based on, must
not be null
rootObjectEPackage
- the root object package to be used for creating the initial model to be
contained by the model file, must not be null
rootObjectEClassifier
- the root object classifier of the initial model's root object, must not be
null
public org.eclipse.core.runtime.IStatus runInWorkspace(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
runInWorkspace
in class org.eclipse.core.resources.WorkspaceJob
org.eclipse.core.runtime.CoreException
protected org.eclipse.emf.ecore.EObject createInitialModel()
This implementation creates a new root object using the root object
package and root object classifier provided to this CreateNewModelFileJob
.
protected void saveInitialModel(org.eclipse.emf.ecore.EObject rootObject, org.eclipse.core.runtime.IProgressMonitor monitor)
rootObject
- the root object to be saved in a filemonitor
- a progress monitor monitor, or null
if progress reporting
and cancelation are not desired