|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.transaction.util.ValidateEditSupport.Default
public 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). It does not do any user prompting.
In anticipation of rollback, this implementation resets any resources that were modified back to unmodified state (as it only validates those that were previously unmodified).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.util.ValidateEditSupport |
---|
ValidateEditSupport.Default |
Constructor Summary | |
---|---|
ValidateEditSupport.Default()
Initializes me. |
Method Summary | |
---|---|
protected IStatus |
doValidateEdit(Transaction transaction,
Collection<? extends Resource> resources,
Object context)
Performs the actual edit validation. |
void |
finalizeForCommit()
The default implementation simply forgets the resources to validate. |
void |
finalizeForRollback()
Rolls back the modified state of the resources that were validated to let them once again be un-modified, then forgets them. |
protected Set<Resource> |
getResourcesToValidate()
Obtains the set of resources that we have determined need to be validated for edit, because they have changed from being unmodified to modified. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidateEditSupport.Default()
Method Detail |
---|
protected final Set<Resource> getResourcesToValidate()
public IStatus validateEdit(Transaction transaction, Object context)
ValidateEditSupport
validateEdit
in interface ValidateEditSupport
transaction
- the root-level transaction that is attempting to commitcontext
- 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
protected IStatus doValidateEdit(Transaction transaction, Collection<? extends Resource> resources, Object context)
transaction
- the transaction that is attempting to commitresources
- the resources to validate-editcontext
- the validate-edit context, or null
if none
public void finalizeForRollback()
finalizeForRollback
in interface ValidateEditSupport
public void finalizeForCommit()
finalizeForCommit
in interface ValidateEditSupport
public void handleResourceChange(Resource resource, Notification notification)
ValidateEditSupport
handleResourceChange
in interface ValidateEditSupport
resource
- a resource to add or remove to/from the validate listnotification
- a notification
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |