Runtime

org.eclipse.gmf.runtime.emf.core
Class GMFEditingDomainFactory.TransactionalSyncExecHelper

java.lang.Object
  extended by org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory.TransactionalSyncExecHelper
All Implemented Interfaces:
FileModificationValidator.ISyncExecHelper
Enclosing class:
GMFEditingDomainFactory

public static class GMFEditingDomainFactory.TransactionalSyncExecHelper
extends java.lang.Object
implements FileModificationValidator.ISyncExecHelper

A helper that knows about the specific editing domain. During the approval process, calls to validateEdit() will require the domain in order to execute in a thread safe manner.


Constructor Summary
GMFEditingDomainFactory.TransactionalSyncExecHelper()
           
 
Method Summary
 IStatus approveFileModification(IFile[] files, org.eclipse.emf.transaction.TransactionalEditingDomain transactionalDomain)
          Sets the thread specific transactional domain before the approval process since subsequent calls to validateEdit() requires it and clears it afterward.
 java.lang.Runnable safeRunnable(java.lang.Runnable runnable)
          Delegates to the specified domain to obtain a thread safe wrapper for the specified runnable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMFEditingDomainFactory.TransactionalSyncExecHelper

public GMFEditingDomainFactory.TransactionalSyncExecHelper()
Method Detail

approveFileModification

public IStatus approveFileModification(IFile[] files,
                                       org.eclipse.emf.transaction.TransactionalEditingDomain transactionalDomain)
Sets the thread specific transactional domain before the approval process since subsequent calls to validateEdit() requires it and clears it afterward.

Parameters:
files - The files to be validated.
transactionalDomain - The current editing domain.
Returns:
The resulting status.

safeRunnable

public java.lang.Runnable safeRunnable(java.lang.Runnable runnable)
Delegates to the specified domain to obtain a thread safe wrapper for the specified runnable

Specified by:
safeRunnable in interface FileModificationValidator.ISyncExecHelper
Parameters:
runnable - a runnable to execute in the context of the active transaction, on any thread
Returns:
the privileged runnable if the transaction is on the current thread, otherwise just return itself.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.