targetId for editor contribution to the xml editor [message #149431] |
Sun, 27 November 2005 15:10  |
Eclipse User |
|
|
|
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 #150782 is a reply to message #150604] |
Mon, 05 December 2005 11:47  |
Eclipse User |
|
|
|
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
> >>
> >>
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04758 seconds