Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] EMF binding/selection committed

Karen Moore wrote:
> Markus,
> I'm trying to implement an EMFBindingAction for
> MultiRelationshipMapping.mappedBy.  The problem I hit is when the
> EMFSWTBinding is created it calls
> ISelectionDispatcher.getCurrentSelection(EClass).  The selection it is
> looking for is a OneToManyMapping, but the EClass is a
> MultiRelationshipMapping which is a superType of OneToManyMapping.   
> Any ideas on how we should handle this case?
> 
> thanks,
> Karen

Hi,

try this:

### Eclipse Workspace Patch 1.0
#P org.eclipse.dali.ui.selection
Index:
source/org/eclipse/dali/ui/selection/internal/notification/SelectionNotification.java
===================================================================
RCS file:
/cvsroot/technology/org.eclipse.dali/plugins/org.eclipse.dali.ui.selection/source/org/eclipse/dali/ui/selection/internal/notification/SelectionNotification.java,v
retrieving revision 1.3
diff -u -r1.3 SelectionNotification.java
---
source/org/eclipse/dali/ui/selection/internal/notification/SelectionNotification.java
26 Mar 2006 19:04:11 -0000	1.3
+++
source/org/eclipse/dali/ui/selection/internal/notification/SelectionNotification.java
29 Mar 2006 18:50:20 -0000
@@ -97,7 +97,7 @@
 		} else {
 			for(Iterator itr = getIndirectSelections().iterator(); itr.hasNext();) {
 				EObject eObj = (EObject) itr.next();
-				if(eObj.eClass().equals(anEClass)) {
+				if(eObj.eClass().equals(anEClass) ||
anEClass.isSuperTypeOf(eObj.eClass())) {
 					return eObj;
 				}
 			}

But consider this more as a quick hack. Its not really tested and it
might break something else. For the moment it feels right though. If
this isn't working, I will look into it tomorrow.

-- 
Regards,
Markus Kuppe

Versant GmbH, European Headquarters
Wiesenkamp 22b, 22359 Hamburg, Germany
+49(40)60990-215, http://www.versant.com


Back to the top