Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Custom editor embedded in an html file
Custom editor embedded in an html file [message #206417] Fri, 04 January 2008 15:27 Go to next message
Andreas Ã?h is currently offline Andreas Ã?hFriend
Messages: 4
Registered: July 2009
Junior Member
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.

Thanks.
Andreas
Re: Custom editor embedded in an html file [message #206432 is a reply to message #206417] Sat, 05 January 2008 14:56 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

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
Re: Custom editor embedded in an html file [message #206490 is a reply to message #206432] Tue, 08 January 2008 12:58 Go to previous message
Andreas Ã?h is currently offline Andreas Ã?hFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Nitin and thanks for the reply.
I think I'm missing something (like the wtp) cause I can't find the
archives/plugins/extensions you're talking about. Though I'm having
problems downloading it from the update manager, for the last two days it
complains about the site is down (http 503), I'll probobly work it out
somehow.

My target environment is Eclipse 3.2 (no possibility to upgrade to 3.3).
What do I need to be able to accomplish this task (BOM)? Do I need the
source/sdk for wtp do you have any good pointers to documentation how to
setup the environment and even greater explains eclipse's and wtp's
editing framework? I really need to get the basics sorted before I'll
solve this task so any pointers for that as well would be appreciated.
I'll continue digging into this thing in the meantime.

Again, thanks.
Andreas
Previous Topic:Plans for the org.eclipse.jst.j2ee.model.ModelProviderEvent
Next Topic:How to use include files?
Goto Forum:
  


Current Time: Tue Apr 23 15:28:44 GMT 2024

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

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

Back to the top