Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » JS editor adaptions(What is the best strategy to adapt existing javascript editor functionality?)
JS editor adaptions [message #661367] Thu, 24 March 2011 08:06 Go to next message
Eclipse UserFriend
Hello,

I have to implement an Eclipse plugin that will offer all functionality of the regular javascript editor (highlighting, code completion, hover, etc, etc), but it needs to support an adapted version of the javascript language (CSS TV Profile 1.0), with some old functionality stripped and new functionality added. What is the best way to do this:

1) build an editor from scratch?
2) reuse existing js editor code?

Can you give me some pointers please? Example code?

Thanks in advance!
Re: JS editor adaptions [message #661422 is a reply to message #661367] Thu, 24 March 2011 11:28 Go to previous messageGo to next message
Eclipse UserFriend
In my first post I mixed up javascript and CSS.
In reality I need to create 2 editors, for javascript and css, both with modified language syntax.

I have been reading about the subject...
I get the impression that a possible way forward is to use the StructuredTextEditor and work with org.eclipse.wst.sse.ui.editorConfiguration.

Is that true?
Re: JS editor adaptions [message #661634 is a reply to message #661422] Fri, 25 March 2011 11:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dwight,

It looks like the syntax for CSS TV is the same as CSS2, so that makes things a lot easier.

You can use the extension point "org.eclipse.wst.sse.core.cssprofile" in order to add this new profile. The profile is what specifies your selectors, pseudo-classes/elements, and properties. You can follow the example of the other existing profiles and you'll likely be able to use cssprofile-css2.xml as a basis for your implementation. The existing css profiles can be found in the org.eclipse.wst.css.core plug-in. Hopefully that'll get you started on the CSS portion.

[Updated on: Fri, 25 March 2011 11:58] by Moderator

Re: JS editor adaptions [message #662315 is a reply to message #661634] Wed, 30 March 2011 04:55 Go to previous message
Eclipse UserFriend
Hi Nick!

thanks, in the mean time I discovered this link:

http://www.eclipse.org/forums/index.php?t=msg&th=166649& amp;start=0&

And indeed it is possible to define a new profile and add it to your plugin.xml in the <extension> tag:

<profile
name="%cssprofile_csstv1_0.name"
uri="cssprofile/cssprofile- csstv1_0.xml"
id="org.eclipse.wst.css.core.cssprofile. csstv1_0">
</profile>

The link also gives a way to change profiles programmatically.

Problem solved.
thanks.
Previous Topic:Unable to start JBOSS 5 from eclise IDE [Galileo]
Next Topic:How to capture perspective changes?
Goto Forum:
  


Current Time: Tue Jul 22 18:58:09 EDT 2025

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

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

Back to the top