org.eclipse.stp.core.util
Class SCAArtifactEdit
java.lang.Object
org.eclipse.stp.core.util.SCAArtifactEdit
- All Implemented Interfaces:
- IModelLifecycle
public class SCAArtifactEdit
- extends java.lang.Object
- implements IModelLifecycle
This is the model access utility class. Clients should use this class to
create any model element or get handle to it.
For creating new model elements, clients can use createEObjectDataModel API.
They will create a new scribbler and pass it on to the API which will return
a DataModel. Client will fill in the required properties and execute the
default operation by callng scribbler.execute().
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCAArtifactEdit
public SCAArtifactEdit(IEditModelScribbler aScribbler)
- Parameters:
aScribbler
-
createArtifactEditForRead
public static SCAArtifactEdit createArtifactEditForRead(IProject aProject,
CompositeScribblerDomain aCompositeDomain,
ComponentTypeScribblerDomain aComponentTypeDomain)
- Parameters:
aProject
- aCompositeDomain
- aComponentTypeDomain
-
- Returns:
- SCAArtifactEdit
createArtifactEditForWrite
public static SCAArtifactEdit createArtifactEditForWrite(IProject aProject,
CompositeScribblerDomain aCompositeDomain,
ComponentTypeScribblerDomain aComponentTypeDomain)
- Parameters:
aProject
- aCompositeDomain
- aComponentTypeDomain
-
- Returns:
- SCAArtifactEdit
save
public void save(int options,
IProgressMonitor aMonitor)
throws ModelLifecycleException
- Specified by:
save
in interface IModelLifecycle
- Throws:
ModelLifecycleException
close
public void close(int options,
IProgressMonitor aMonitor)
throws ModelLifecycleException
- Specified by:
close
in interface IModelLifecycle
- Throws:
ModelLifecycleException
discard
public void discard(IProgressMonitor aMonitor)
throws ModelLifecycleException
- Specified by:
discard
in interface IModelLifecycle
- Throws:
ModelLifecycleException
revert
public void revert(int options,
IProgressMonitor aMonitor)
throws ModelLifecycleException
- Specified by:
revert
in interface IModelLifecycle
- Throws:
ModelLifecycleException
isReadOnly
public boolean isReadOnly()
- Returns:
- boolean
getDataModelForCreation
public static IDataModel getDataModelForCreation(java.lang.String type,
IProject aProject)
- This API can be used to create an SCAObject of a specific
SCAType
type. Clients can call
getDataModelForCreation() API passing in a type string and aProject. This
will return the appropriate IDataModel which needs to be further
populated.
- Parameters:
type
- StringaProject
- IProject
- Returns:
- IDataModel
getComponentType
public ComponentType getComponentType()
getComposite
public Composite getComposite()
getRootSCAObject
public EObject getRootSCAObject(URI scaObjectURI)
getFirstInstanceOfEObjectFromResource
public EObject getFirstInstanceOfEObjectFromResource(EClass eClass,
Resource resource)
- Parameters:
eClass
- for the object type we are looking forresource
- to search for the given object type
- Returns:
- the first
EObject
which is an instance of the given
EClass