Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » targetId for editor contribution to the xml editor
targetId for editor contribution to the xml editor [message #149431] Sun, 27 November 2005 20:10 Go to next message
Eclipse UserFriend
Originally posted by: schutzerj.hotmail.com

Can anybody tell by what targetId I shall use to add an editor contribution
to the XML editor. I have tried to use the id of the xml editor but then I
cannot get access to the source editor.

Can anybody please help?

Regards,
Joakim Andersson
Re: targetId for editor contribution to the xml editor [message #149434 is a reply to message #149431] Sun, 27 November 2005 22:06 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Joakim Andersson wrote:
> Can anybody tell by what targetId I shall use to add an editor contribution
> to the XML editor. I have tried to use the id of the xml editor but then I
> cannot get access to the source editor.
>
> Can anybody please help?

Although we still need to comprehensively list all of the available
IDs for 1.0, the current SSE Overview [1] page's "Editor related
IDs" section identifies
org.eclipse.core.runtime.xml.source.EditorContext as the ID for the
source page's context menu. More information about the editors and
the editing framework will ultimately end up there.

1: http://eclipse.org/webtools/wst/components/sse/overview.html

--
- Nitin


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: targetId for editor contribution to the xml editor [message #149500 is a reply to message #149434] Mon, 28 November 2005 08:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joakim.bindows.net

Thanks for the quick answer. However I saw this answer in a previous post
but I don't want to add the action to the context menu but rather to the
Edit menu of the workbench and I tried using
org.eclipse.core.runtime.xml.source in the same way as it's done in
plugin.xml for org.eclipse.wst.xml.ui but this didn't work.

/Joakim

"Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
news:dmdalh$uuj$1@news.eclipse.org...
> Joakim Andersson wrote:
>> Can anybody tell by what targetId I shall use to add an editor
>> contribution to the XML editor. I have tried to use the id of the xml
>> editor but then I cannot get access to the source editor.
>>
>> Can anybody please help?
>
> Although we still need to comprehensively list all of the available IDs
> for 1.0, the current SSE Overview [1] page's "Editor related IDs" section
> identifies org.eclipse.core.runtime.xml.source.EditorContext as the ID for
> the source page's context menu. More information about the editors and
> the editing framework will ultimately end up there.
>
> 1: http://eclipse.org/webtools/wst/components/sse/overview.html
>
> --
> - Nitin
Re: targetId for editor contribution to the xml editor [message #150390 is a reply to message #149500] Thu, 01 December 2005 21:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amywu.us.DELETETHISPART.ibm.com

You should do something like the following:
<extension point="org.eclipse.ui.editorActions">
<editorContribution
id="org.eclipse.core.runtime.xml.source.editorActions"
targetID="org.eclipse.core.runtime.xml.source">
<action
id="youractionid"
label="youractionlabel"
definitionId="youractiondefinitionid"
tooltip="youractiontooltip"
class="youractiondelegate"
menubarPath="edit/additions">
</action>
</editorContribution>
</extension>

The targetID should be "org.eclipse.core.runtime.xml.source" and make sure
you specify a menubarPath.

"Joakim Andersson" <joakim@bindows.net> wrote in message
news:dmednh$tc9$1@news.eclipse.org...
> Thanks for the quick answer. However I saw this answer in a previous post
> but I don't want to add the action to the context menu but rather to the
> Edit menu of the workbench and I tried using
> org.eclipse.core.runtime.xml.source in the same way as it's done in
> plugin.xml for org.eclipse.wst.xml.ui but this didn't work.
>
> /Joakim
>
> "Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
> news:dmdalh$uuj$1@news.eclipse.org...
> > Joakim Andersson wrote:
> >> Can anybody tell by what targetId I shall use to add an editor
> >> contribution to the XML editor. I have tried to use the id of the xml
> >> editor but then I cannot get access to the source editor.
> >>
> >> Can anybody please help?
> >
> > Although we still need to comprehensively list all of the available IDs
> > for 1.0, the current SSE Overview [1] page's "Editor related IDs"
section
> > identifies org.eclipse.core.runtime.xml.source.EditorContext as the ID
for
> > the source page's context menu. More information about the editors and
> > the editing framework will ultimately end up there.
> >
> > 1: http://eclipse.org/webtools/wst/components/sse/overview.html
> >
> > --
> > - Nitin
>
>
Re: targetId for editor contribution to the xml editor [message #150604 is a reply to message #150390] Sat, 03 December 2005 18:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schutzerj.hotmail.com

Thank but I already tried this and it doesn't work so maybe I should enter
this as a bug.

If you look at the following sample, you can see that it works for the css
editor but not for the xml editor (the real application of course bigger but
you can see the problem from this small sample).

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.editorActions">
<editorContribution
id="test"
targetID="org.eclipse.core.runtime.xml.source">
<action
class="TestAction"
id="testAction"
label="Test Action"
menubarPath="edit/additions"
style="push"/>
</editorContribution>
<editorContribution
id="test"
targetID="org.eclipse.wst.css.core.csssource.source">
<action
class="TestAction"
id="testAction"
label="Test Action"
menubarPath="edit/additions"
style="push"/>
</editorContribution>
</extension>

</plugin>

/Joakim


"Amy Wu" <amywu@us.DELETETHISPART.ibm.com> wrote in message
news:dmnqms$lq8$1@news.eclipse.org...
> You should do something like the following:
> <extension point="org.eclipse.ui.editorActions">
> <editorContribution
> id="org.eclipse.core.runtime.xml.source.editorActions"
> targetID="org.eclipse.core.runtime.xml.source">
> <action
> id="youractionid"
> label="youractionlabel"
> definitionId="youractiondefinitionid"
> tooltip="youractiontooltip"
> class="youractiondelegate"
> menubarPath="edit/additions">
> </action>
> </editorContribution>
> </extension>
>
> The targetID should be "org.eclipse.core.runtime.xml.source" and make sure
> you specify a menubarPath.
>
> "Joakim Andersson" <joakim@bindows.net> wrote in message
> news:dmednh$tc9$1@news.eclipse.org...
>> Thanks for the quick answer. However I saw this answer in a previous post
>> but I don't want to add the action to the context menu but rather to the
>> Edit menu of the workbench and I tried using
>> org.eclipse.core.runtime.xml.source in the same way as it's done in
>> plugin.xml for org.eclipse.wst.xml.ui but this didn't work.
>>
>> /Joakim
>>
>> "Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
>> news:dmdalh$uuj$1@news.eclipse.org...
>> > Joakim Andersson wrote:
>> >> Can anybody tell by what targetId I shall use to add an editor
>> >> contribution to the XML editor. I have tried to use the id of the xml
>> >> editor but then I cannot get access to the source editor.
>> >>
>> >> Can anybody please help?
>> >
>> > Although we still need to comprehensively list all of the available IDs
>> > for 1.0, the current SSE Overview [1] page's "Editor related IDs"
> section
>> > identifies org.eclipse.core.runtime.xml.source.EditorContext as the ID
> for
>> > the source page's context menu. More information about the editors and
>> > the editing framework will ultimately end up there.
>> >
>> > 1: http://eclipse.org/webtools/wst/components/sse/overview.html
>> >
>> > --
>> > - Nitin
>>
>>
>
>
Re: targetId for editor contribution to the xml editor [message #150782 is a reply to message #150604] Mon, 05 December 2005 16:47 Go to previous message
Eclipse UserFriend
Originally posted by: amywu.us.DELETETHISPART.ibm.com

Ah, I see the problem now. The problem has to do with the xml editor being
a multipage editor versus just a source editor.
Yes, please open a bug on this, though I'm not sure how easy it will be to
fix this. This may be an Eclipse base limitation.
And in the meantime, you can use the the targetID,
org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditor Part
That's the editor id of the xml editor. This will add your action to the
XML editor (and it will be on for both the design and source page)
However, as you can see by the name, it's not really public API and may be
subject to change.

"Joakim Andersson" <schutzerj@hotmail.com> wrote in message
news:dmspn3$oa6$1@news.eclipse.org...
> Thank but I already tried this and it doesn't work so maybe I should enter
> this as a bug.
>
> If you look at the following sample, you can see that it works for the css
> editor but not for the xml editor (the real application of course bigger
but
> you can see the problem from this small sample).
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>
> <plugin>
> <extension
> point="org.eclipse.ui.editorActions">
> <editorContribution
> id="test"
> targetID="org.eclipse.core.runtime.xml.source">
> <action
> class="TestAction"
> id="testAction"
> label="Test Action"
> menubarPath="edit/additions"
> style="push"/>
> </editorContribution>
> <editorContribution
> id="test"
> targetID="org.eclipse.wst.css.core.csssource.source">
> <action
> class="TestAction"
> id="testAction"
> label="Test Action"
> menubarPath="edit/additions"
> style="push"/>
> </editorContribution>
> </extension>
>
> </plugin>
>
> /Joakim
>
>
> "Amy Wu" <amywu@us.DELETETHISPART.ibm.com> wrote in message
> news:dmnqms$lq8$1@news.eclipse.org...
> > You should do something like the following:
> > <extension point="org.eclipse.ui.editorActions">
> > <editorContribution
> > id="org.eclipse.core.runtime.xml.source.editorActions"
> > targetID="org.eclipse.core.runtime.xml.source">
> > <action
> > id="youractionid"
> > label="youractionlabel"
> > definitionId="youractiondefinitionid"
> > tooltip="youractiontooltip"
> > class="youractiondelegate"
> > menubarPath="edit/additions">
> > </action>
> > </editorContribution>
> > </extension>
> >
> > The targetID should be "org.eclipse.core.runtime.xml.source" and make
sure
> > you specify a menubarPath.
> >
> > "Joakim Andersson" <joakim@bindows.net> wrote in message
> > news:dmednh$tc9$1@news.eclipse.org...
> >> Thanks for the quick answer. However I saw this answer in a previous
post
> >> but I don't want to add the action to the context menu but rather to
the
> >> Edit menu of the workbench and I tried using
> >> org.eclipse.core.runtime.xml.source in the same way as it's done in
> >> plugin.xml for org.eclipse.wst.xml.ui but this didn't work.
> >>
> >> /Joakim
> >>
> >> "Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
> >> news:dmdalh$uuj$1@news.eclipse.org...
> >> > Joakim Andersson wrote:
> >> >> Can anybody tell by what targetId I shall use to add an editor
> >> >> contribution to the XML editor. I have tried to use the id of the
xml
> >> >> editor but then I cannot get access to the source editor.
> >> >>
> >> >> Can anybody please help?
> >> >
> >> > Although we still need to comprehensively list all of the available
IDs
> >> > for 1.0, the current SSE Overview [1] page's "Editor related IDs"
> > section
> >> > identifies org.eclipse.core.runtime.xml.source.EditorContext as the
ID
> > for
> >> > the source page's context menu. More information about the editors
and
> >> > the editing framework will ultimately end up there.
> >> >
> >> > 1: http://eclipse.org/webtools/wst/components/sse/overview.html
> >> >
> >> > --
> >> > - Nitin
> >>
> >>
> >
> >
>
>
Previous Topic:Trying to control editor pop \up based on file..
Next Topic:Implement "Add Import" for jsp
Goto Forum:
  


Current Time: Thu Apr 25 09:15:41 GMT 2024

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

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

Back to the top