Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Snippets View Contributions Extension
Snippets View Contributions Extension [message #177930] Fri, 25 August 2006 16:56 Go to next message
Stan Rivera is currently offline Stan Rivera
Messages: 36
Registered: July 2009
Member
Greetings! I am in the process of adding a new plug-in to extend the
snippets for the VTP (i.e., for the voice XML editor). Currently, there
is one pre-canned set of snippets for JSP’s, called JSP. I want to add
some “custom” (i.e., only good for an internal speech engine) VXML
snippets. My extensions will be very similar to the “taglib directive”
snippet, where the user will get a pop-up and be able to only add the
value for a couple of attributes. I had a couple of questions:

1)What is the proper extension point I should use, I am developing under
the VTP?
2)I am new to Eclipse development and was hoping there might be some
documentation to help me add these “custom” VXML snippets?

Thanks,

Stan
Re: Snippets View Contributions Extension [message #178033 is a reply to message #177930] Mon, 28 August 2006 10:53 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2128
Registered: July 2009
Senior Member
Stan Rivera wrote:
> Greetings! I am in the process of adding a new plug-in to extend the
> snippets for the VTP (i.e., for the voice XML editor). Currently, there
> is one pre-canned set of snippets for JSP�s, called JSP. I want to add
> some �custom� (i.e., only good for an internal speech engine) VXML
> snippets. My extensions will be very similar to the �taglib directive�
> snippet, where the user will get a pop-up and be able to only add the
> value for a couple of attributes. I had a couple of questions:
>
> 1)What is the proper extension point I should use, I am developing under
> the VTP?

You'd want to make use of the
org.eclipse.wst.common.snippets.SnippetContributions extension point
from the org.eclipse.wst.common.snippets plugin.

> 2)I am new to Eclipse development and was hoping there might be some
> documentation to help me add these �custom� VXML snippets?

The reference documentation for the extension point is within the
WTP SDK, but you can also find it at
http://help.eclipse.org/help32/topic/org.eclipse.wst.doc.isv /reference/extension-points/common/org_eclipse_wst_common_sn ippets_SnippetContributions.html
.. There's a typo where ISnippetsInsertion should really be
ISnippetInsertion.

--
- Nitin


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Snippets View Contributions Extension [message #178041 is a reply to message #178033] Mon, 28 August 2006 12:39 Go to previous messageGo to next message
Stan Rivera is currently offline Stan Rivera
Messages: 36
Registered: July 2009
Member
Nitin,
Thank you very much! Also, have a couple of more questions, as I am very
new to do any type of Eclipse development/plug-ins/extensions:
1) First, I am using WTP1.5 with VTP1.0. Do you recommend I use WTP1.0
instead?
2) I am assuming I create a plug-in project with the basic default
settings. On the second page of the project wizard, there a entry for the
classpath? In extending the SnippetContributions, do you see my needing
to set this for any classes I may need or will the default behavior
provide my needs (based on what I said in my initial description)?
3) The last page of the wizard asks for what plug-in template to start
with, which one should I be starting with, the "Plug-in with a view"?
4) The last sentence in the "Snippets View Contributions Extension" help
reference, it mentions "Supplied Implementation: The supplied
implementation of the Snippets view requires the Graphical Editing
Framework and Structured Source Editing components.". What are the
implications of this?
5) Based on my questions, is there a book or other URL references you can
think of that will be helpful for me? After looking at few bookd, I
bought the book, "Eclipse - Building Commerical-Quality Plug-ins", do you
recommend it?

Thanks for you patience,

Stan
Re: Snippets View Contributions Extension [message #178099 is a reply to message #178041] Tue, 29 August 2006 01:47 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2128
Registered: July 2009
Senior Member
Stan Rivera wrote:
> 1) First, I am using WTP1.5 with VTP1.0. Do you recommend I use WTP1.0
> instead?

Only if VTP 1.0 will absolutely not work with WTP 1.5. WTP 1.5 is
what's current and being maintained going forward.

> 2) I am assuming I create a plug-in project with the basic default
> settings. On the second page of the project wizard, there a entry for
> the classpath? In extending the SnippetContributions, do you see my
> needing to set this for any classes I may need or will the default
> behavior provide my needs (based on what I said in my initial description)?

The default behavior doesn't require you prereq the Snippets plugin,
but if you want to create a different dialog, then yes, you would
have to require the Snippets plug-in for its APIs. I'm not familiar
with that part of the wizard unfortunately.

> 3) The last page of the wizard asks for what plug-in template to start
> with, which one should I be starting with, the "Plug-in with a view"?

I'm not exactly sure you'll need any of that, as that template
allows your plugin to create its own view and that's not a necessary
step for adding contents to the Snippets view. It's certainly
useful from a learning perspective about the platform in general,
but I'd start reading through the Platform Plug-In Developer Guide
at
http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/guide/arch.htm
(also in your local Eclipse SDK's built-in Help system). The
org.eclipse.jst.jsp.ui plug-in's plugin.xml file is also a decent
example of how to contribute a snippet that asks the user for input.
Don't be afraid to get your feet wet.

> 4) The last sentence in the "Snippets View Contributions Extension" help
> reference, it mentions "Supplied Implementation: The supplied
> implementation of the Snippets view requires the Graphical Editing
> Framework and Structured Source Editing components.". What are the
> implications of this?

None, as they're both part of or required by WTP (and even just the
WST builds). If WTP is installed and functioning, you've got all
the pieces you'll need.

--
- Nitin


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Snippets View Contributions Extension [message #178161 is a reply to message #178099] Tue, 29 August 2006 11:31 Go to previous messageGo to next message
Stan Rivera is currently offline Stan Rivera
Messages: 36
Registered: July 2009
Member
Thanks for your comments, I appreciate that. Believe it or not, I have
been getting my feet wet, I had actually been reading the Platform Plug-in
Developer guide and the Plug-in Development Environment guides. I will
most definitely continue to read to get continue extending my
understanding, so if I appear a little lost, I am, but please bare with
me. Here's a couple of more questions to that surely will reveal my
confusion:

1) I realize I am trying to extend the snippets functionality, but in
doing so, am I extending the snippets plug-in itself or am I extending an
editor plug-in of the VTP using the SnippetContributions? If I am
extending a plug-in in the VTP, which one should I be extending for
VoiceXML i.e., which plug.xml should I be updating. If I am not extending
a plug-in of the VTP, which plug-in am I extending, i.e., org.eclipse.?.?.?
2) Should I be creating a plug-in project at all for what I am trying to
do?

I tried to start off simple and have tried putting this extension in
several plugins, org.eclipse.vtp.editor.vxml.core,
org.eclipse.vtp.editor.vxml.ui and org.eclipse.vtp.editor. I know this is
not complete as I still need to specify the <item>'s, but I was trying to
start off simple, just trying to see the new catalog in the snippets view.
Am I way off in how I'm trying to do this?

<extension
point="org.eclipse.wst.common.snippets.SnippetContributions ">
<category
label="VXML (Objects)"
smallicon="/icons/ctool16/VoiceXMLFile.gif"
id="org.eclipse.vtp.editor.vxml.category0"
contenttypes="org.eclipse.vtp.editor.vxml.core.vxmlsource">
</category>
</extension>

Thanks in advance for your patience.

Stan
Re: Snippets View Contributions Extension [message #178548 is a reply to message #178161] Tue, 05 September 2006 13:24 Go to previous messageGo to next message
Stan Rivera is currently offline Stan Rivera
Messages: 36
Registered: July 2009
Member
I have figured out my problem and can now extend the snippets view for
VXML. My problem was that I had malformed XML defined in my <extension>
for the org.eclipse.wst.common.snippets.SnippetContributions. However,
one reason I didn't see that it was malformed XML was because WTP1.5 does
not appear to be validating the XML in the plugin.xml. I don't know if
it's only for this extension per se, but I know for sure it's not. I
happened to try this <extension> point in my WTP1.0 version and walah, I
happened to notice the error in the editor. I fixed the editor complaint
in WTP1.0, and the error went away. I cut and pasted the new XML in
WTP1.5's editor and re-launched eclipse with this project update and
again, walah, my VXML snippet stuff showed up in the snippets view. Do I
need to open up a bug for this?

Thanks,
Stan
Re: Snippets View Contributions Extension [message #181590 is a reply to message #178548] Thu, 12 October 2006 15:08 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2128
Registered: July 2009
Senior Member
Stan Rivera wrote:
> I have figured out my problem and can now extend the snippets view for
> VXML. My problem was that I had malformed XML defined in my <extension>
> for the org.eclipse.wst.common.snippets.SnippetContributions. However,
> one reason I didn't see that it was malformed XML was because WTP1.5
> does not appear to be validating the XML in the plugin.xml. I don't
> know if it's only for this extension per se, but I know for sure it's
> not. I happened to try this <extension> point in my WTP1.0 version and
> walah, I happened to notice the error in the editor. I fixed the editor
> complaint in WTP1.0, and the error went away. I cut and pasted the new
> XML in WTP1.5's editor and re-launched eclipse with this project update
> and again, walah, my VXML snippet stuff showed up in the snippets view.
> Do I need to open up a bug for this?

I doubt it, the PDE validates the plugin.xml itself. Do you have
the PDE Compiler preferences set to flag inappropriate content?

--
- Nitin


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:Trying to use XML Editor on our custom xml types
Next Topic:The selection is not within a valid module
Goto Forum:
  


Current Time: Wed Apr 16 09:28:28 EDT 2014

Powered by FUDForum. Page generated in 0.05938 seconds