Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Extending XML Editor popup menu.
Extending XML Editor popup menu. [message #142661] Thu, 06 October 2005 22:47 Go to next message
John Buttitto is currently offline John ButtittoFriend
Messages: 20
Registered: July 2009
Junior Member
I am trying to extend the popup menus on the default XML editor. I want
to add a entry to the popup menu that allows me to transfer the selected
text from the editor to an alternate view.

If anyone has an example of how to add a popup menu entry to the default
XML it would be appreciated.
Re: Extending XML Editor popup menu. [message #143449 is a reply to message #142661] Thu, 13 October 2005 14:55 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4490
Registered: July 2009
Senior Member

John Buttitto wrote:
> I am trying to extend the popup menus on the default XML editor. I want
> to add a entry to the popup menu that allows me to transfer the selected
> text from the editor to an alternate view.
>
> If anyone has an example of how to add a popup menu entry to the default
> XML it would be appreciated.

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm
contains information on how to register the action. The menu ID
used when editing XML is
"org.eclipse.core.runtime.xml.source.EditorContext" and your
delegate's selectionChanged(IAction action,
ISelection selection) method that should be given the
ITextSelection when your action delegate is invoked.

The
org.eclipse.wst.common.snippets.internal.actions.AddToSnippe tsEditorActionDelegate
class does something very similiar.

--
- Nitin


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Extending XML Editor popup menu. [message #143964 is a reply to message #143449] Sat, 15 October 2005 05:26 Go to previous message
John Buttitto is currently offline John ButtittoFriend
Messages: 20
Registered: July 2009
Junior Member
Nitin Dahyabhai wrote:
> John Buttitto wrote:
>
>> I am trying to extend the popup menus on the default XML editor. I
>> want to add a entry to the popup menu that allows me to transfer the
>> selected text from the editor to an alternate view.
>>
>> If anyone has an example of how to add a popup menu entry to the
>> default XML it would be appreciated.
>
>
> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm
> contains information on how to register the action. The menu ID used
> when editing XML is "org.eclipse.core.runtime.xml.source.EditorContext"
> and your delegate's selectionChanged(IAction action, ISelection
> selection) method that should be given the ITextSelection when your
> action delegate is invoked.
>
> The
> org.eclipse.wst.common.snippets.internal.actions.AddToSnippe tsEditorActionDelegate
> class does something very similiar.
>

I tried the following...
<viewerContribution
id="org.eclipse.xxxx.debug.vxmledit"
targetID="org.eclipse.core.runtime.xml.source.EditorContext ">
<action id="com.xxxx.ide.eclipse.voice.caller1"
label="%PopupMenus.action"
icon="resources/images/com/xxxx/ide/TranslatorFile.jpg"
menubarPath="additions"
class="com.xxxx.ide.eclipse.debug.action.TTSActionDelegate" >
</action>
</viewerContribution>

Your right this delegate is perfect for what I want to do. Thanks..
Problem is I still can not figure out how to properly change the menu.

I tried variations on this theme but it seems to not work. Since it is
an editor I assume I am dealing with a viewerContribution. If you have
any suggestions I would appreciate it.

Thanks
Previous Topic:WebSphere 6 and WTP 0.7
Next Topic:Horrendous performance 0.7.1 - will it get better
Goto Forum:
  


Current Time: Mon Sep 23 02:01:19 GMT 2024

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

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

Back to the top