Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JavaScript syntax highlighting
JavaScript syntax highlighting [message #222554] Thu, 02 October 2008 10:17 Go to next message
Eclipse User
Originally posted by: eduardo.oliveira.eldorado.org.br

Hi all!

I'm trying to use the JSSourceViewerConfiguration class as a source viewer
configuration for a SourceViewer. But, the syntax highlight is not working.
I checked the JSEditor source code and tried to do some similar:

IPreferenceStore store = createCombinedPreferenceStore();
SourceViewerConfiguration conf = new JSSourceViewerConfiguration(store);
sourceViewer.configure(conf);

private IPreferenceStore createCombinedPreferenceStore()
{
IPreferenceStore jsEditorPrefs =
JSEditorPlugin.getDefault().getPreferenceStore();
IPreferenceStore sseEditorPrefs =
SSEUIPlugin.getDefault().getPreferenceStore();
IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
return new ChainedPreferenceStore(new IPreferenceStore[]
{
jsEditorPrefs, sseEditorPrefs, baseEditorPrefs
});
}

What is happening?

Thanks!
Re: JavaScript syntax highlighting [message #222596 is a reply to message #222554] Tue, 07 October 2008 16:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2251
Registered: July 2009
Senior Member
Eduardo Oliveira wrote:
> I'm trying to use the JSSourceViewerConfiguration class as a source viewer
> configuration for a SourceViewer. But, the syntax highlight is not working.
> I checked the JSEditor source code and tried to do some similar:
>
> What is happening?

The JSEditor class does further configuration on the source viewer,
in particular adding a JSLineStyleListener to the text widget.
You'll have to do the same.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:[ANN] WTP 3.0.2 is available!
Next Topic:How to turn off JavaScript validation in the JSP editor?
Goto Forum:
  


Current Time: Fri Aug 29 12:19:10 EDT 2014

Powered by FUDForum. Page generated in 0.02032 seconds