Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 37150 Details for
Bug 132367
Provide specialized post commit listener that can open a write transaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
A slight fix to the event broker and editing domain
DiagramEventBrokerFix.patch (text/plain), 4.23 KB, created by
Chris McGee
on 2006-03-28 16:55:26 EST
(
hide
)
Description:
A slight fix to the event broker and editing domain
Filename:
MIME Type:
Creator:
Chris McGee
Created:
2006-03-28 16:55:26 EST
Size:
4.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.runtime.diagram.core >Index: src/org/eclipse/gmf/runtime/diagram/core/DiagramEditingDomainFactory.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.core/src/org/eclipse/gmf/runtime/diagram/core/DiagramEditingDomainFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 DiagramEditingDomainFactory.java >--- src/org/eclipse/gmf/runtime/diagram/core/DiagramEditingDomainFactory.java 23 Mar 2006 22:13:35 -0000 1.3 >+++ src/org/eclipse/gmf/runtime/diagram/core/DiagramEditingDomainFactory.java 28 Mar 2006 21:51:42 -0000 >@@ -17,11 +17,14 @@ > > import org.eclipse.core.commands.operations.IOperationHistory; > import org.eclipse.core.commands.operations.OperationHistoryFactory; >+import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.common.notify.AdapterFactory; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >+import org.eclipse.emf.transaction.NotificationFilter; > import org.eclipse.emf.transaction.ResourceSetChangeEvent; > import org.eclipse.emf.transaction.ResourceSetListener; >+import org.eclipse.emf.transaction.ResourceSetListenerImpl; > import org.eclipse.emf.transaction.RollbackException; > import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalCommandStack; >@@ -57,23 +60,54 @@ > // while handling a post-commit event. > private InternalTransaction originatingTransaction = null; > private DiagramEventBroker deb = null; >+ private ResourceSetListener debWrapper = null; > > public void addResourceSetListener(ResourceSetListener l) { > if (l.getClass() == DiagramEventBroker.class) { > assert deb == null; > deb = (DiagramEventBroker)l; >+ debWrapper = new ResourceSetListenerImpl() { >+ public boolean isAggregatePrecommitListener() { >+ return deb.isAggregatePrecommitListener(); >+ } >+ >+ public boolean isPrecommitOnly() { >+ return true; >+ } >+ >+ public Command transactionAboutToCommit(ResourceSetChangeEvent event) >+ throws RollbackException { >+ return deb.transactionAboutToCommit(event); >+ } >+ >+ public void resourceSetChanged(ResourceSetChangeEvent event) { >+ deb.resourceSetChanged(event); >+ } >+ >+ public NotificationFilter getFilter() { >+ return deb.getFilter(); >+ } >+ >+ public boolean isPostcommitOnly() { >+ return false; >+ } >+ }; >+ >+ super.addResourceSetListener(debWrapper); >+ } else { >+ super.addResourceSetListener(l); > } >- >- super.addResourceSetListener(l); > } > > public void removeResourceSetListener(ResourceSetListener l) { > if (l.getClass() == DiagramEventBroker.class) { > assert deb != null; > deb = null; >+ super.removeResourceSetListener(debWrapper); >+ debWrapper = null; >+ } else { >+ super.removeResourceSetListener(l); > } >- >- super.removeResourceSetListener(l); > } > > public DiagramEditingDomain(AdapterFactory adapterFactory, ResourceSet resourceSet) { >Index: src/org/eclipse/gmf/runtime/diagram/core/listener/DiagramEventBroker.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.core/src/org/eclipse/gmf/runtime/diagram/core/listener/DiagramEventBroker.java,v >retrieving revision 1.11 >diff -u -r1.11 DiagramEventBroker.java >--- src/org/eclipse/gmf/runtime/diagram/core/listener/DiagramEventBroker.java 23 Mar 2006 22:05:22 -0000 1.11 >+++ src/org/eclipse/gmf/runtime/diagram/core/listener/DiagramEventBroker.java 28 Mar 2006 21:51:43 -0000 >@@ -587,13 +587,6 @@ > public boolean isAggregatePrecommitListener() { > return true; > } >- >- public boolean isPrecommitOnly() { >- // We aren't really a precommit only listener, the DiagramEditingDomain >- // has a special case for us to be a special postcommit listener >- // that can make changes while responding to batched events. >- return true; >- } > > /** > * Helper method to add all the listners of the given <code>notifier</code>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 132367
:
36767
| 37150