public class CreateNewModelProjectJob<T extends IMetaModelDescriptor>
extends org.eclipse.core.resources.WorkspaceJob
CreateNewModelProjectJob capable of creating a new model project with given nature. A new project is
created, and the required nature is added to this project.
This job is set by default the priority to Job.BUILD and the rule to the workspace root.
| Modifier and Type | Field and Description |
|---|---|
protected java.net.URI |
location |
protected T |
metaModelVersionDescriptor |
protected IProjectWorkspacePreference<T> |
metaModelVersionPreference |
protected java.lang.String |
natureId |
protected org.eclipse.core.resources.IProject |
newProject |
protected org.eclipse.core.resources.IProject |
project
Deprecated.
Use
newProject instead. |
| Constructor and Description |
|---|
CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject)
Creates a new instance of model project job
|
CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
java.lang.String natureId)
Creates a new instance of model project job with a required project nature id.
|
CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
T metaModelVersionDescriptor,
IProjectWorkspacePreference<T> metaModelVersionPreference)
Creates a new instance of model project job.
|
CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
T metaModelVersionDescriptor,
java.lang.String natureId,
IProjectWorkspacePreference<T> metaModelVersionPreference)
Deprecated.
|
CreateNewModelProjectJob(java.lang.String jobName,
java.lang.String natureId)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNatures(org.eclipse.core.runtime.IProgressMonitor monitor)
Adds the required natures to the project created by this
CreateNewModelFileJob. |
protected void |
createNewProject(org.eclipse.core.runtime.IProgressMonitor monitor)
Creates the project on disk.
|
org.eclipse.core.resources.IProject[] |
getReferencedProjects() |
org.eclipse.core.runtime.IAdaptable |
getUIInfoAdaptable() |
org.eclipse.core.runtime.IStatus |
runInWorkspace(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
setReferencedProjects(org.eclipse.core.resources.IProject[] referencedProjects)
Sets the referenced project.
|
void |
setUIInfoAdaptable(org.eclipse.core.runtime.IAdaptable uiInfo)
Sets an adaptable to be used by
IOperationHistory.execute(org.eclipse.core.commands.operations.IUndoableOperation, IProgressMonitor, IAdaptable)
At a minimum the adaptable should be able to adapt to org.eclipse.swt.widgets.Shell. Having a shell, such an adaptable can be obtained by WorkspaceUndoUtil.getUIInfoAdapter(shell)If null, a default shell will be created to ask the user for confirmation. |
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, yieldRuleprotected org.eclipse.core.resources.IProject newProject
protected java.net.URI location
protected java.lang.String natureId
protected T extends IMetaModelDescriptor metaModelVersionDescriptor
protected IProjectWorkspacePreference<T extends IMetaModelDescriptor> metaModelVersionPreference
@Deprecated protected org.eclipse.core.resources.IProject project
newProject instead.public CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject)
jobName - the name of the job, must not be nullnewProject - the new project to be created, must not be null@Deprecated
public CreateNewModelProjectJob(java.lang.String jobName,
java.lang.String natureId)
CreateNewModelProjectJob(String, IProject, URI, String) instead.jobName - the name of the job, must not be nullnatureId - the (principal) nature of the project to be created; when set to null no nature will be
addedpublic CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
java.lang.String natureId)
jobNname - the name of the job, must not be nullnewProject - the new project to be created, must not be nulllocation - the location where the project will be created; when set to null the default location
will be usednatureId - the (principal) nature of the project to be created; when set to null no nature will be
addedpublic CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
T metaModelVersionDescriptor,
IProjectWorkspacePreference<T> metaModelVersionPreference)
jobName - the name of the job, must not be nullnewProject - the new project to be created, must not be nulllocation - the location where the project will be created; when set to null the default location
will be usedmetaModelVersionDescriptor - the meta-model version that the project will be used for; when set to null no metamodel
version will be configuredmetaModelVersionPreference - the metamodel version preference of the project; when set to null no metamodel version
will be configured@Deprecated
public CreateNewModelProjectJob(java.lang.String jobName,
org.eclipse.core.resources.IProject newProject,
java.net.URI location,
T metaModelVersionDescriptor,
java.lang.String natureId,
IProjectWorkspacePreference<T> metaModelVersionPreference)
CreateNewModelProjectJob(String, IProject, URI, IMetaModelDescriptor, IProjectWorkspacePreference)
instead.jobName - the name of the job, must not be nullnewProject - the new project to be created, must not be nulllocation - the location where the project will be created; when set to null the default location
will be usedmetaModelVersionDescriptor - the meta-model version that this project will be used for; when set to null no metamodel
version will be configurednatureId - the (principal) nature of the project to be created; when set to null no nature will be
addedmetaModelVersionPreference - the metamodel version preference of this project; when set to null no metamodel version
will be configuredpublic void setUIInfoAdaptable(org.eclipse.core.runtime.IAdaptable uiInfo)
IOperationHistory.execute(org.eclipse.core.commands.operations.IUndoableOperation, IProgressMonitor, IAdaptable)
WorkspaceUndoUtil.getUIInfoAdapter(shell)uiInfo - the uiInfo adaptable to setpublic org.eclipse.core.runtime.IAdaptable getUIInfoAdaptable()
public org.eclipse.core.resources.IProject[] getReferencedProjects()
public void setReferencedProjects(org.eclipse.core.resources.IProject[] referencedProjects)
referencedProjects - the referencedProjects to setpublic 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.WorkspaceJoborg.eclipse.core.runtime.CoreExceptionprotected void createNewProject(org.eclipse.core.runtime.IProgressMonitor monitor)
throws org.eclipse.core.runtime.CoreException
monitor - org.eclipse.core.runtime.CoreExceptionprotected void addNatures(org.eclipse.core.runtime.IProgressMonitor monitor)
throws org.eclipse.core.runtime.CoreException
CreateNewModelFileJob.monitor - org.eclipse.core.runtime.CoreException