org.eclipse.stp.core.infrastructure.emf
Interface IEditModelFactory


public interface IEditModelFactory

IEditModelFactory creates instances of IEditModels and IEditModelScribblers. Clients may access the default implementation of the factory via eINSTANCE.

Clients are recommended to build most of the customization logic (such as determining the interesting resources, and the appropriate label for their edit models through the methods made available in IEditModelScribbler. Then clients may rely on createScribblerForRead(IProject, IScribblerDomain) and createScribblerForWrite(IProject, IScribblerDomain).


Field Summary
static IEditModelFactory eINSTANCE
          The public singleton instance of the IEditModelFactory.
 
Method Summary
 IEditModelScribbler createScribbler(IProject aProject, java.lang.String editModelLabel, IScribblerDomain[] domains, boolean toMakeReadonly)
          Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}.
 IEditModelScribbler createScribblerForRead(IProject aProject, IScribblerDomain domain)
          Create a scribbler using the project and the given domain.
 IEditModelScribbler createScribblerForRead(IProject aProject, java.lang.String editModelLabel, IScribblerDomain[] domains)
          Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}.
 IEditModelScribbler createScribblerForWrite(IProject aProject, IScribblerDomain domain)
          Create a scribbler using the project and the given domain.
 IEditModelScribbler createScribblerForWrite(IProject aProject, java.lang.String editModelLabel, IScribblerDomain[] domains)
          Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}.
 IEditModel getEditModel(IProject aProject, java.lang.String editModelLabel)
          Return the IEditModel for the given project with the given label.
 

Field Detail

eINSTANCE

static final IEditModelFactory eINSTANCE
The public singleton instance of the IEditModelFactory.

Method Detail

getEditModel

IEditModel getEditModel(IProject aProject,
                        java.lang.String editModelLabel)
Return the IEditModel for the given project with the given label. The editModelLabel parameter allows clients to coordinate access to a particular edit model across editors, operations, and views. The label should be something that is scoped to a particular collection of resources, and even targeted to a specific kind of resources (for instance, the EJB resources for a specific module contained by the given project).

Parameters:
aProject - The scope of the IEditModel; general IEditModels are scoped to a project
editModelLabel - The customized, client-chosen label for the edit model.
Returns:
A created (or cached) IEditModel

createScribbler

IEditModelScribbler createScribbler(IProject aProject,
                                    java.lang.String editModelLabel,
                                    IScribblerDomain[] domains,
                                    boolean toMakeReadonly)
                                    throws EditModelException
Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}. Clients can also decide whether the returned scribbler should be made available for write operations.

Parameters:
aProject - Used with editModelLabel to identify the relevant IEditModel.
editModelLabel - Used with aProject to identify the relevant IEditModel.
domains - An array of IScribblerDomains that identify the interesting resources.
toMakeReadonly - True indicates the returned scribbler should not allow save() operations.
Returns:
An instance of IEditModelScribbler to be used to access any of the files described by the array of IScribblerDomains.
Throws:
EditModelException - If the project is inAccessible() or if another problem occurs while locating the edit model or creating the scribbler.

createScribblerForRead

IEditModelScribbler createScribblerForRead(IProject aProject,
                                           IScribblerDomain domain)
                                           throws EditModelException
Create a scribbler using the project and the given domain. The appropriate IEditModel will be located using IScribblerDomain.getEditModelLabel(). The scribbler returned will not allow write operations.

Parameters:
aProject - Used with IScribblerDomain.getEditModelLabel() to identify the relevant IEditModel.
domain - An IScribblerDomain that will identify the interesting resources.
Returns:
An instance of IEditModelScribbler to be used to access any of the files described domain.
Throws:
EditModelException - If the project is inAccessible() or if another problem occurs while locating the edit model or creating the scribbler.

createScribblerForWrite

IEditModelScribbler createScribblerForWrite(IProject aProject,
                                            IScribblerDomain domain)
                                            throws EditModelException
Create a scribbler using the project and the given domain. The appropriate IEditModel will be located using IScribblerDomain.getEditModelLabel(). The scribbler returned will allow write operations.

Parameters:
aProject - Used with IScribblerDomain.getEditModelLabel() to identify the relevant IEditModel.
domain - An IScribblerDomain that will identify the interesting resources.
Returns:
An instance of IEditModelScribbler to be used to access any of the files described domain.
Throws:
EditModelException - If the project is inAccessible() or if another problem occurs while locating the edit model or creating the scribbler.

createScribblerForRead

IEditModelScribbler createScribblerForRead(IProject aProject,
                                           java.lang.String editModelLabel,
                                           IScribblerDomain[] domains)
                                           throws EditModelException
Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}. The scribbler returned will not allow write operations.

Parameters:
aProject - Used with editModelLabel to identify the relevant IEditModel.
editModelLabel - Used with aProject to identify the relevant IEditModel.
domains - An array of IScribblerDomains that identify the interesting resources.
Returns:
An instance of IEditModelScribbler to be used to access any of the files described by the array of IScribblerDomains.
Throws:
EditModelException - If the project is inAccessible() or if another problem occurs while locating the edit model or creating the scribbler.

createScribblerForWrite

IEditModelScribbler createScribblerForWrite(IProject aProject,
                                            java.lang.String editModelLabel,
                                            IScribblerDomain[] domains)
                                            throws EditModelException
Clients may create a scribbler using an array of IScribblerDomains for a specific edit model (identified by {aProject, editModelLabel}. The scribbler returned will allow write operations.

Parameters:
aProject - Used with editModelLabel to identify the relevant IEditModel.
editModelLabel - Used with aProject to identify the relevant IEditModel.
domains - An array of IScribblerDomains that identify the interesting resources.
Returns:
An instance of IEditModelScribbler to be used to access any of the files described by the array of IScribblerDomains.
Throws:
EditModelException - If the project is inAccessible() or if another problem occurs while locating the edit model or creating the scribbler.