Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding actions to JDT CompilationUnit editor context menu
Adding actions to JDT CompilationUnit editor context menu [message #119263] Fri, 29 August 2003 16:33 Go to next message
Eclipse UserFriend
Originally posted by: jre_rowe.hotmail.com

I'm trying to add an action to the JDT CompilationUnit editor context
menu. The "Contributing Actions to the Eclipse Workbench" page specifies
the targetID for the default text editor context menu (#TextEditorContext)
and this works fine. However, I can't seem to find a reference to the
relevent targetID in the JDT plugin.xml files for the CompilationUnit
editor (I've tried a few but none of them seem to work). Any ideas?

Cheers,
Jimlad.
Re: Adding actions to JDT CompilationUnit editor context menu [message #119337 is a reply to message #119263] Fri, 29 August 2003 17:17 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.guide.removeMe.andMeToo.earthlink.net

Jimlad,

Context menu IDs aren't documented in the plugin.xml, they are declared at
runtime by registerContextMenu. You can trace senders of this message or
read Table 18.2, page 447, of our book:

#CompilationUnitEditorContext
#CompilationUnitRulerContext
#CompilationUnitEditorContext
org.eclipse.jdt.ui.CompilationUnitEditor.EditorContext
org.eclipse.jdt.ui.CompilationUnitEditor.RulerContext

Some are duplicated because they changed from 2.0 -> 2.1; both are supported
in 2.1 (I haven't checked 3.0). Since these are called at runtime, it is
easy to modify the registerContextMenu implementation to write out the
parameters to the console. That's how I verified the table since many of
these were undocumented.

While I am engaging in flagrant self-promotion <g>, you may also be
interested in this article: "Extend Eclipse's Java Developer Tools"
( http://www-106.ibm.com/developerworks/opensource/library/os- ecjdt/). You
can see more about it and the other JDT solutions in our book here:
ftp://www6.software.ibm.com/software/developer/library/os-ec jdt/solution-doc
/index.html.

-- Dan

------------------------------------------------------------ ----------------
-------

co-author "The Java Developer's Guide to Eclipse"
http://www.amazon.com/exec/obidos/ASIN/0321159640

"jimlad" <jre_rowe@hotmail.com> wrote in message
news:binv93$3vs$1@eclipse.org...
> I'm trying to add an action to the JDT CompilationUnit editor context
> menu. The "Contributing Actions to the Eclipse Workbench" page specifies
> the targetID for the default text editor context menu (#TextEditorContext)
> and this works fine. However, I can't seem to find a reference to the
> relevent targetID in the JDT plugin.xml files for the CompilationUnit
> editor (I've tried a few but none of them seem to work). Any ideas?
>
> Cheers,
> Jimlad.
>
>
Previous Topic:Problem to access Help from Eclipse
Next Topic:editor tabs
Goto Forum:
  


Current Time: Mon Dec 30 16:30:01 GMT 2024

Powered by FUDForum. Page generated in 0.02836 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top