Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT .cpp source file editor Popup menu help needed
CDT .cpp source file editor Popup menu help needed [message #77056] Thu, 24 July 2003 22:09 Go to next message
Mike Boyersmith is currently offline Mike BoyersmithFriend
Messages: 34
Registered: July 2009
Member
Hello I want to add a right click context menu items to the CDT C++ source
file editor.

I created an extension point like (I simplified it to protect company
information)

<extension point="org.eclipse.ui.popupMenus">
<!--popup menus for my addin-->
<viewerContribution id="com.xxx.Addin.CDTPopupActions"
targetID="#CompilationUnitEditorContext">
<action id="MyActionOnCppFile" label="Label DoSomething"
menubarPath="group.show" icon="path\morepath\mygif.gif" tooltip="a tooltip"
class="com.xxx.addin.interaction.MenuOnCDTEditor"/>
</viewerContribution>
</extension>



But its not showing up, when I open a cpp file and then right click on the
file.

I'm confused by a lot of the syntax

- is ViewerContribution id simply a unique ID I give to my menu item?
- Where do I find out details about what "#CompilationUnitEditorContext"
means and other defines, is this correct for CDT?
- Anything else I need to do, beyond adding this to my fragment, and
flushing out supporting the Java Interface?
- See anything glaringly wrong here?

Thanks for assistance here.
Re: CDT .cpp source file editor Popup menu help needed [message #77237 is a reply to message #77056] Mon, 28 July 2003 14:15 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
I think that for CDT , you want targetID="CEditorContext".

That's the only thing I see wrong with your fragment, (as long as your class
MenuOnCDTEditor implements IEditorActionDelegate).

-Andrew



"Mike" <mboyersmith@rational.com> wrote in message
news:bfplc9$1l3$1@eclipse.org...
> Hello I want to add a right click context menu items to the CDT C++ source
> file editor.
>
> I created an extension point like (I simplified it to protect company
> information)
>
> <extension point="org.eclipse.ui.popupMenus">
> <!--popup menus for my addin-->
> <viewerContribution id="com.xxx.Addin.CDTPopupActions"
> targetID="#CompilationUnitEditorContext">
> <action id="MyActionOnCppFile" label="Label DoSomething"
> menubarPath="group.show" icon="path\morepath\mygif.gif" tooltip="a
tooltip"
> class="com.xxx.addin.interaction.MenuOnCDTEditor"/>
> </viewerContribution>
> </extension>
>
>
>
> But its not showing up, when I open a cpp file and then right click on the
> file.
>
> I'm confused by a lot of the syntax
>
> - is ViewerContribution id simply a unique ID I give to my menu item?
> - Where do I find out details about what "#CompilationUnitEditorContext"
> means and other defines, is this correct for CDT?
> - Anything else I need to do, beyond adding this to my fragment, and
> flushing out supporting the Java Interface?
> - See anything glaringly wrong here?
>
> Thanks for assistance here.
>
>
>
>
>
>
Re: CDT .cpp source file editor Popup menu help needed [message #77858 is a reply to message #77237] Mon, 04 August 2003 22:58 Go to previous message
Mike Boyersmith is currently offline Mike BoyersmithFriend
Messages: 34
Registered: July 2009
Member
Thanks Andrew,

that did it, appreciate the help here :D



"Andrew Niefer" <aniefer@ca.ibm.com> wrote in message
news:bg3b0f$cot$1@eclipse.org...
> I think that for CDT , you want targetID="CEditorContext".
>
> That's the only thing I see wrong with your fragment, (as long as your
class
> MenuOnCDTEditor implements IEditorActionDelegate).
>
> -Andrew
>
>
>
> "Mike" <mboyersmith@rational.com> wrote in message
> news:bfplc9$1l3$1@eclipse.org...
> > Hello I want to add a right click context menu items to the CDT C++
source
> > file editor.
> >
> > I created an extension point like (I simplified it to protect company
> > information)
> >
> > <extension point="org.eclipse.ui.popupMenus">
> > <!--popup menus for my addin-->
> > <viewerContribution id="com.xxx.Addin.CDTPopupActions"
> > targetID="#CompilationUnitEditorContext">
> > <action id="MyActionOnCppFile" label="Label DoSomething"
> > menubarPath="group.show" icon="path\morepath\mygif.gif" tooltip="a
> tooltip"
> > class="com.xxx.addin.interaction.MenuOnCDTEditor"/>
> > </viewerContribution>
> > </extension>
> >
> >
> >
> > But its not showing up, when I open a cpp file and then right click on
the
> > file.
> >
> > I'm confused by a lot of the syntax
> >
> > - is ViewerContribution id simply a unique ID I give to my menu item?
> > - Where do I find out details about what
"#CompilationUnitEditorContext"
> > means and other defines, is this correct for CDT?
> > - Anything else I need to do, beyond adding this to my fragment, and
> > flushing out supporting the Java Interface?
> > - See anything glaringly wrong here?
> >
> > Thanks for assistance here.
> >
> >
> >
> >
> >
> >
>
>
Previous Topic:Control on loading a program
Next Topic:CDT for 3.0?
Goto Forum:
  


Current Time: Thu Dec 26 14:44:20 GMT 2024

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

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

Back to the top