What are the targetIDs of WST editors? [message #136778] |
Tue, 06 September 2005 14:53 |
Eclipse User |
|
|
|
Originally posted by: agilbert.invalidemail.com
Hi,
I'd like to extend the popupMenus of the WST 0.7 editors (mainly html/xml
JSP editors). What are the targetIDs of those editors?
Regards,
Alain Gilbert
|
|
|
Re: What are the targetIDs of WST editors? [message #137211 is a reply to message #136778] |
Thu, 08 September 2005 02:15 |
David Williams Messages: 722 Registered: July 2009 |
Senior Member |
|
|
On Tue, 06 Sep 2005 10:53:31 -0400, Alain Gilbert <agilbert@invalidemail=
..com> wrote:
> What are the targetIDs of those editors?
Wow, finally a question we actually have some documentation for! :)
See
Editor related IDs
in
http://www.eclipse.org/webtools/wst/components/sse/overview. html
In brief,
To contribute, a "target id" of some kind is needed. For Structured Text=
editors, the target id is generated based on the content type in the ed=
itor, type of editor, place to contribute. The target id looks like: >co=
ntent type<.>editor type keyword<.>place to contribute keyword<
[... such as ... ] To contribute to *xml source editor's popup menu*, us=
e target id "org.eclipse.core.runtime.xml.source.EditorContext
|
|
|
Re: What are the targetIDs of WST editors? [message #137331 is a reply to message #137211] |
Thu, 08 September 2005 13:37 |
Eclipse User |
|
|
|
Originally posted by: agilbert.invalidemail.com
> To contribute to *xml source editor's popup menu*, use target id
> "org.eclipse.core.runtime.xml.source.EditorContext
Thanks David,
I had seen this doc recently. It could be completed to include the exact
content types of STEs. The "org.eclipse.core.runtime." prefix was not
obvious to me.
However my plug-in is still not working for JSP files (either in html or xml
format) but does for the platform text editor. The menu item is not being
added to the popup menu.
Follows an excerpt of my plugin.xml file:
<extension point="org.eclipse.ui.popupMenus">
<viewerContribution targetID="#TextEditorContext"
id="com.taleo.tools.plugins.jsf.TextEditorContribution">
<action label="Find Managed Bean"
class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
menubarPath="additions"
id="com.taleo.tools.plugins.jsf.findManagedBean1"/>
</viewerContribution>
<viewerContribution
targetID="org.eclipse.core.runtime.xml.source.EditorContext "
id="com.taleo.tools.plugins.jsf.XmlEditorContribution">
<action label="Find Managed Bean"
class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
menubarPath="additions"
id="com.taleo.tools.plugins.jsf.findManagedBean2"/>
</viewerContribution>
<viewerContribution
targetID="org.eclipse.core.runtime.html.source.EditorContext "
id="com.taleo.tools.plugins.jsf.HtmlEditorContribution">
<action label="Find Managed Bean"
class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
menubarPath="additions"
id="com.taleo.tools.plugins.jsf.findManagedBean3"/>
</viewerContribution>
</extension>
The last 2 viewer contributions are not considered. What am I doing wrong?
Regards,
Alain Gilbert
|
|
|
Re: What are the targetIDs of WST editors? [message #137400 is a reply to message #137331] |
Thu, 08 September 2005 16:58 |
Eclipse User |
|
|
|
Originally posted by: amywu.us.DELETETHISPART.ibm.com
Actually, the document David referred to needs a tiny bit of updating due to
changes made in:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=104233
But as for your problem, Alain, if you are trying to contribute a popup menu
while editing JSP content, you should use the targetID
"org.eclipse.jst.jsp.core.source.EditorContext"
The editor related id lookup is not smart enough to check the embedded
content type within JSP (XML, HTML). Of course, you could open a bug
requesting for this feature. Hope this works!
-amy
"Alain Gilbert" <agilbert@invalidemail.com> wrote in message
news:dfperm$17i$1@news.eclipse.org...
> > To contribute to *xml source editor's popup menu*, use target id
> > "org.eclipse.core.runtime.xml.source.EditorContext
>
> Thanks David,
>
> I had seen this doc recently. It could be completed to include the exact
> content types of STEs. The "org.eclipse.core.runtime." prefix was not
> obvious to me.
>
> However my plug-in is still not working for JSP files (either in html or
xml
> format) but does for the platform text editor. The menu item is not being
> added to the popup menu.
>
> Follows an excerpt of my plugin.xml file:
> <extension point="org.eclipse.ui.popupMenus">
> <viewerContribution targetID="#TextEditorContext"
> id="com.taleo.tools.plugins.jsf.TextEditorContribution">
> <action label="Find Managed Bean"
> class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
> menubarPath="additions"
> id="com.taleo.tools.plugins.jsf.findManagedBean1"/>
> </viewerContribution>
> <viewerContribution
> targetID="org.eclipse.core.runtime.xml.source.EditorContext "
> id="com.taleo.tools.plugins.jsf.XmlEditorContribution">
> <action label="Find Managed Bean"
> class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
> menubarPath="additions"
> id="com.taleo.tools.plugins.jsf.findManagedBean2"/>
> </viewerContribution>
> <viewerContribution
> targetID="org.eclipse.core.runtime.html.source.EditorContext "
> id="com.taleo.tools.plugins.jsf.HtmlEditorContribution">
> <action label="Find Managed Bean"
> class="com.taleo.tools.plugins.jsf.actions.FindManagedBeanType "
> menubarPath="additions"
> id="com.taleo.tools.plugins.jsf.findManagedBean3"/>
> </viewerContribution>
> </extension>
>
> The last 2 viewer contributions are not considered. What am I doing wrong?
>
> Regards,
> Alain Gilbert
>
>
|
|
|
Re: What are the targetIDs of WST editors? [message #137506 is a reply to message #137400] |
Thu, 08 September 2005 18:08 |
Eclipse User |
|
|
|
Originally posted by: agilbert.invalidemail.com
> You should use the targetID
> "org.eclipse.jst.jsp.core.source.EditorContext".
Thanks Amy but unfortunately my popup menu item does not show up with this
targetID either!
Could it be that these ids were defined after the 0.7 release?
|
|
|
Re: What are the targetIDs of WST editors? [message #137577 is a reply to message #137506] |
Fri, 09 September 2005 06:46 |
|
Alain Gilbert wrote:
>>You should use the targetID
>>"org.eclipse.jst.jsp.core.source.EditorContext".
>
> Thanks Amy but unfortunately my popup menu item does not show up with this
> targetID either!
> Could it be that these ids were defined after the 0.7 release?
Looks like there's one last typo. With the changes from bug 104233,
it should be org.eclipse.jst.jsp.core.jspsource.source.EditorContext .
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: What are the targetIDs of WST editors? [message #137752 is a reply to message #137577] |
Fri, 09 September 2005 13:44 |
Eclipse User |
|
|
|
Originally posted by: agilbert.invalidemail.com
> With the changes from bug 104233, it should be
> org.eclipse.jst.jsp.core.jspsource.source.EditorContext .
Thanks to David, Amy & Nitin for their help. Now my plug-in is working.
Hopefully these IDs are safe to use by plugins and will be stable for some
time.
Regards,
Alain Gilbert
|
|
|
|
Powered by
FUDForum. Page generated in 0.03283 seconds