Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

filtering model object types in popup menu for custom plugin

0 views
Skip to first unread message

Thilo Arndt

unread,
Apr 25, 2008, 5:13:29 AM4/25/08
to

Hi,

I have created a plugin which enhances the Together functionality in a way that I can replicate enumeration literals from a legacy system into an UML 2.0 Enumeration. In order to call the function I declared an extension point for org.eclipse.ui.popupMenus. As indicated in the documentation I use org.eclipse.emf.ecore.EObject as objectClass and adaptable=true. This works and I can cast class com.borland.tg.emfapi.uml20.kernel.Enumeration to the selected element.
Now I want to filter the popup menu item so that it only appears when an Enumeration is selected in the model navigator or on a diagram. I have searched the Together plugins and found out that Together filters using the objectClass com.tssap.selena.model.ui.IElementWrapper and <filter name="metaclass" value="Enumeration>. The problem is that the selected element cannot be cast to the class Enumeration. At least not directly. All I get is a class com.tssap.selena.c.a.b.b.b.d which is rather cryptic.
Is there a proper method to filter the selected object and retrieve object as an Enumeration?

Kind regards
Thilo

Thilo Arndt

unread,
Apr 28, 2008, 4:03:15 AM4/28/08
to

Solved it myself.

I queried the interfaces provided by the various object types. When I use "org.eclipse.emf.ecore.EObject" as objectClass, an additional visibility entry can be used to check the objectClass against "com.borland.tg.emfapi.uml20.kernel.Enumeration".

rgds
Thilo

0 new messages