Class equivalent to ModelElementItem [message #1073300] |
Wed, 24 July 2013 13:42 |
Boel N Messages: 4 Registered: July 2013 |
Junior Member |
|
|
I have been trying to create a context menu whenever a Papyrus model is selected. So far I have been using the class ModelElementItem (org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem), which works fine. I would, however, like to change it since I would prefer not to use an internal class. Does anyone know of a class or an interface that is equivalent to the ModelElementItem that I could use instead?
Thanks in advance!
Regards,
Boel
|
|
|
|
|
Re: Class equivalent to ModelElementItem [message #1321877 is a reply to message #1073596] |
Tue, 29 April 2014 15:04 |
|
Hi,
For next version of Luna, Papyrus will no longer depend on this ModelElementItem in the model explorer. The best way to get the Semantic Element is the EMFHelper#getEObject(Object) as indicated in the previous messages.
quote from mailing list:
Quote:Hi,
The usage of EMF-Facet 0.2 has been integrated into Papyrus.
This usage involves one major change.
In the context of old framewok, to obtain the UML element from the model explorer, it was only needed to adapt it into an EObject.
Now this approach does not run. In fact all elements in the model explorer that are directly displayed with EMF- Facet are EObjects. See org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy
It implies that the test with IAdaptable does not un.
Now , I advise you to use
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
...
obj = EMFHelper.getEObject(obj);
...
Regards
Rémi
Remi Schnekenburger
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.04723 seconds