|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEditModel
IEditModel manages a set of Resources as an atomic unit, with context
established through the use of one or more
IScribblerDomain
s which
declare interesting resources.
IEditModels create
IEditModelScribbler
s, which
can be used by editors to manage IUndoContexts within the IEditModel command
stack, to be notified of changes in interesting resources, and to save,
revert or close the resources as an atomic unit.
A project may have one or more IEditModels associated with it. Each
IEditModel will track resources that its IEditModelScribblers are interested
in; including resources that are in use by multiple IEditModelScribblers
concurrently. The set of resources that the IEditModelScribbler is interested
in is specified when the IEditModelScribbler is created.
createScribbler(IScribblerDomain[], boolean)
.
The intended guidance for IEditModels is that each IEditModel will track a set of resources associated with a particular editor or set of editors. For instance, an editor for modifying an Enterprise Java Bean Deployment Descriptor and an editor for modifying mapping data from the EJBs to the database schema could share the same IEditModel (within the same project), but each editor would have its own IEditModelScribbler. The IEditingDomains of each IEditModelScribbler would be different, but would reference some of the same resources (e.g. ejb-jar.xml). The single IEditModel would then notify each IEditModelScribbler (one for the EJB DD editor, one for the EJB Mapping Editor) whenever one of the resources for either IEditModelScribbler had been modified (again, the resources are indicated by the IEditingDomains contained by the IEditModelScribblers). The same project could then define another IEditModel to track resources associated with "Technology XYZ" for one or more (other) editors.
The IEditModel manages a single command stack (IOperationHistory) for all of the IEditModelScribblers that are created from it. Each of the IEditModelScribblers define an IUndoContext which is used when executing operations. One or more IEditModelScribblers may share the same or equivalent sets of IEditingDomains, in which case operations may be undone or redone across the matching IEditModelScribblers.
IEditModelScribbler
,
IScribblerDomain
Method Summary | |
---|---|
void |
addListener(IEditModelListener aListener)
Track changes to the IEditModel including the addition or removal of Resources and the loading or unloading of Resources. |
IEditModelScribbler |
createScribbler(IScribblerDomain[] theDomains,
boolean makeReadOnly)
The IEditModel creates IEditModelScribbler s which then exposes
artifact lifecylce methods like save() ,
close() , or revert() . |
java.lang.String |
getEditModelLabel()
The editModelLabel functions as a label so that clients can coordinate access to a specific Edit Model across editors, operations, and views. |
IOperationHistory |
getOperationHistory()
Return the command stack in use by this IEditModel. |
boolean |
isDisposed()
Once an IEditModel has been disposed, it may no longer be
used; a new IEditModel must be loaded. |
boolean |
isInterrestedInResource(Resource aResource)
Expected to use the IEditingDomain.isContained() API underneath; |
void |
removeListener(IEditModelListener aListener)
Remove an existing IEditModelListener . |
void |
setErrorHandler(IEditModelErrorHandler errorHandler)
Respond to an errors that may occur during the IEditModelLifecycle. |
Method Detail |
---|
void addListener(IEditModelListener aListener) throws EditModelException
aListener
-
EditModelException
EditModelEvent
void removeListener(IEditModelListener aListener)
IEditModelListener
.
aListener
- void setErrorHandler(IEditModelErrorHandler errorHandler)
errorHandler
- IEditModelScribbler createScribbler(IScribblerDomain[] theDomains, boolean makeReadOnly) throws EditModelException
IEditModelScribbler
s which then exposes
artifact lifecylce methods like save()
,
close()
, or revert()
.
Several IEditModelScribblers may be created at the same time with either
mutually exclusive or intersecting IScribblerDomain
s. The
IEditModel will track changes to all resources announced by the
IScribblerDomain
s, and notify the IEditModelScribbler
s
when changes occur to resources they are interested in.
theDomains
- makeReadOnly
- Indicates that the IEditModelScribbler will not be able to save
or persist changes.
EditModelException
IEditModelScribbler
,
For more information on creating these objects.
boolean isDisposed()
IEditModel
has been disposed, it may no longer be
used; a new IEditModel
must be loaded.
boolean isInterrestedInResource(Resource aResource)
aResource
-
IOperationHistory getOperationHistory() throws EditModelException
EditModelException
org.eclipse.core.commands.operations.IUndoContext
,
IScribblerDomain
,
IEditModelScribbler
java.lang.String getEditModelLabel()
The editModelLabel does not imply any varied function, but merely serves as a unique identifier for a specific Edit Model. In general, these ids are meant to be coordinate across a particular set of related resources. For instance, an EJB DD Editor might share the same underlying editModelLabel that an EJB Mapping Editor would use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |