## org.eclipse.emf.transaction.util
Interface ValidateEditSupport

All Known Implementing Classes:
  ValidateEditSupport.Default

    public 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.

Clients may implement this interface or extend the default implementation.

Since:
  1.2
See Also:
  `Transaction.OPTION_VALIDATE_EDIT`, `Transaction.OPTION_VALIDATE_EDIT_CONTEXT`, `ValidateEditSupport.Default`

Nested Class Summary

`static class`

`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.
`void` `finalizeForRollback()` Notifies me that rollback has occurred and I should clean up.
`void` `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).
`IStatus` `validateEdit(Transaction transaction, Object context)` Performs validate-edit for a transaction.

Method Detail

### validateEdit

    IStatus validateEdit(Transaction transaction,
                         Object context)

  Performs validate-edit for a transaction.

  Parameters:
    `transaction` - the root-level transaction that is attempting to commit
    `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

    void 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).

  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.

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.