|
Re: Custom editor embedded in an html file [message #206432 is a reply to message #206417] |
Sat, 05 January 2008 14:56 |
|
Andreas wrote:
> Hi. I've been looking for a while to extend the wst html editor to
> handle my script language in very much the same way that the
> html/javascript editor works. For instance when I'm writing:
> <script type="text/javascript">
> ..
> </script>
>
> I guess that triggers a different partition type in the html document
> which is associated with a different (in this case a javascript) editor
> to handle that partition. I have the editor I want to use, but I just
> can't get it to trigger correct in my html files.
>
> So is it possible to define a new partition type to the html editor (is
> it even the html editor i should touch?) and associate it with a new (or
> existing) editor?
> I rather not get into the source for this kind of operation, some xml
> def. somewhere (or even in the graphical configuration) should be able
> to fix this but all help is appreciated.
The partition type goes through the source viewer configuration,
which in the HTML editor's case will load support for scripting
languages from defined extensions. That they're implemented by
another editor is just the details. For JavaScript, you can examine
the extensions to org.eclipse.wst.sse.ui.editorConfiguration in
org.eclipse.wst.jsdt.web.ui/plugin.xml that are handling the
"default" and JavaScript languages. For other languages/types, the
partition type used will be computed dynamically based on the
attribute value, org.eclipse.wst.html.SCRIPT.language.VALUE from the
language attribute's value or org.eclipse.wst.html.SCRIPT.type.VALUE
from the type attribute's value if it is present. In theory any
client-side scripting language support can be plugged in this way.
That said, this support has to be coded specifically to work with
scripting within a DOM model. The script source is not treated
specially otherwise.
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Powered by
FUDForum. Page generated in 0.03952 seconds