🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.together.modeling
2 messages
2 total messages Started by Thilo Arndt Fri, 25 Apr 2008 09:13
filtering model object types in popup menu for custom plugin
#39
Author: Thilo Arndt
Date: Fri, 25 Apr 2008 09:13
9 lines
1951 bytes
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
Re: filtering model object types in popup menu for custom plugin
#40
Author: Thilo Arndt
Date: Mon, 28 Apr 2008 08:03
7 lines
1230 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads