public class ModelSaveIndicator extends java.lang.Object implements IModelSaveIndicator
This implementation works on a model level to avoid performance overhead.
ResourceSaveIndicator
,
SaveIndicatorUtil
Constructor and Description |
---|
ModelSaveIndicator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isDirty(IModelDescriptor modelDescriptor)
Determines if the given
model is dirty. |
void |
setSaved(IModelDescriptor modelDescriptor)
Clears dirty state of given
model and remembers it as having just been saved. |
public boolean isDirty(IModelDescriptor modelDescriptor)
model
is dirty. A model
is considered
dirty if it has resource
s whose content has been modified but not been saved yet.isDirty
in interface IModelSaveIndicator
modelDescriptor
- The model
to be investigated.true
if specified model
has dirty resource
s, or
false
otherwise.IModelSaveIndicator.setSaved(IModelDescriptor)
public void setSaved(IModelDescriptor modelDescriptor)
model
and remembers it as having just been saved. This
method needs to be called by all clients which perform a save operation of some model
right after the save operation has been completed. Clients can then call #isSaved(EditingDomain, URI)
to
determine if subsequently raised resource change event
s are just a consequence of
the preceding save operation or if the underlying file
s' content has been changed otherwise (e.g.,
via a text editor or some other tool affecting the resource
in its serialized form).setSaved
in interface IModelSaveIndicator
modelDescriptor
- The model
to be handled.IModelSaveIndicator.isDirty(IModelDescriptor)