org.eclipse.emf.transaction.util
Interface ValidateEditSupport

Interface for the Transaction.OPTION_VALIDATE_EDIT transaction option
to check, when a transaction commits, that all of the resources that it has
modified are actually editable or (by some means supplied by the platform)
can be made to be editable. The root-level transaction should assign this
to the TransactionChangeRecorder when it starts and remove it when
it closes.

ValidateEditSupport.Default
A default implementation of the ValidateEditSupport interface,
that uses the editing domain's read-only resource map to determine
whether a resource can be edited and depends on notifications of the
Resource.isModified() property changing to track which resources
need to be validated (note that this implies that the resource is
tracking modifications).

Method Summary

void

finalizeForCommit()
Notifies me that the transaction has successfully committed and I should
clean up.

handleResourceChange(Resource resource,
Notification notification)
Processes a notification from a resource that may
either indicate that the resource should be added to the validate
list (i.e., its persisted state is changed) or it should be removed
from the validate list (e.g., because it has been unloaded).

validateEdit

context - usually a org.eclipse.swt.widgets.Shell
providing a UI context for interaction with the user to make resources
modifiable, or null if no such context is available and
the system should attempt to automatically validate

Returns:

a status indicating OK if validate-edit succeeded,
otherwise some reason why it failed and the transaction should roll
back

handleResourceChange

Processes a notification from a resource that may
either indicate that the resource should be added to the validate
list (i.e., its persisted state is changed) or it should be removed
from the validate list (e.g., because it has been unloaded).

Parameters:

resource - a resource to add or remove to/from the validate list

notification - a notification

finalizeForRollback

void finalizeForRollback()

Notifies me that rollback has occurred and I should clean up. This may
involving touching, in some way, the resources that I validated.

finalizeForCommit

void finalizeForCommit()

Notifies me that the transaction has successfully committed and I should
clean up. This may involve touching, in some way, the resources that I
validated.