|Selectively adding actions to Outline popup menu [message #762327]
||Wed, 07 December 2011 22:10
| Daniel Tuohy
Registered: July 2009
We are using XText 2.0.1 and are interested in adding items to the Content Outline's popup menu only for certain nodes in the tree. For the Helio build of XText, this is described in this article, but the classes mentioned no longer exist in XText and there do not appear to be equivalent instructions in the indigo version.
I did find a bugzilla that seems to explain why it went away, and a deprecation comment that suggests this sort of thing was still possible, but I haven't been able to get it to work.
Here is the entry in my plugin.xml:
label="Open Type Hierarchy" style="push">
<adapt type="com.foo.mydsl.TypeDeclaration" />
<adapt type="com.foo.mydsl.Type" />
Unfortunately, I can't get the adapter to work for my custom implementation of AbstractOutlineNode. I can see that eclipse is calling getAdapter(Class adapterType), but the only values for adapterType are:
None of these seems useful (I certainly don't have instances of these to hand return). Should I be seeing calls for the adapter for EClass?
Alternatively, is there any other way to get the behavior that I want? The instanceof expression seemed useful (instead of adapt), but I have no idea what to test for. I tried testing for my custom AbstractOutlineNode, but it does not appear to work. In fact, the only test that works is for java.lang.Object. What object is being evaluated here? Is there any way to debug this?
Thanks for your time,
Powered by FUDForum
. Page generated in 0.01911 seconds