org.eclipse.stp.core.util
Class SCAArtifactEdit

java.lang.Object
  extended by 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().


Field Summary
 
Fields inherited from interface org.eclipse.stp.core.util.IModelLifecycle
OPTION_FORCE, OPTION_NONE, OPTION_SAVE_ON_CLOSE
 
Constructor Summary
SCAArtifactEdit(IEditModelScribbler aScribbler)
           
 
Method Summary
 void close(int options, IProgressMonitor aMonitor)
           
static SCAArtifactEdit createArtifactEditForRead(IProject aProject, CompositeScribblerDomain aCompositeDomain, ComponentTypeScribblerDomain aComponentTypeDomain)
           
static SCAArtifactEdit createArtifactEditForWrite(IProject aProject, CompositeScribblerDomain aCompositeDomain, ComponentTypeScribblerDomain aComponentTypeDomain)
           
 void discard(IProgressMonitor aMonitor)
           
 ComponentType getComponentType()
           
 Composite getComposite()
           
static IDataModel getDataModelForCreation(java.lang.String type, IProject aProject)
          This API can be used to create an SCAObject of a specific SCAType type.
 EObject getFirstInstanceOfEObjectFromResource(EClass eClass, Resource resource)
           
 EObject getRootSCAObject(URI scaObjectURI)
           
 boolean isReadOnly()
           
 void revert(int options, IProgressMonitor aMonitor)
           
 void save(int options, IProgressMonitor aMonitor)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCAArtifactEdit

public SCAArtifactEdit(IEditModelScribbler aScribbler)
Parameters:
aScribbler -
Method Detail

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 - String
aProject - 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 for
resource - to search for the given object type
Returns:
the first EObject which is an instance of the given EClass