Naku
Naku

Reputation: 89

Recommendation for SWT/JFace Javascript Editor?

I'm building an app using SWT + JFace and I would like to integrate a Javascript editor (with Syntax Highlighting and Auto-Indent).

I'm looking for something simple like RSyntaxTextArea: just use the widget like as a TextArea and set the syntax to "Javascript".

So far I've come across examples with "JFace Text" but it seems I have to implement the Javascript part myself. Also, I don't want to integrate the whole Eclipse workbench if possible.

Do you know of any component that would do the job?

Upvotes: 0

Views: 768

Answers (2)

Sorceror
Sorceror

Reputation: 4843

I found some interesting project, which might help you with the situation..

It's called The DJ Project (The Sweet library brings some rich components to SWT-based applications) and when you check the Gallery, you can find as last example SWT gui with javascript syntax highlighted text area.

The licence is LGPL, which is one of the best for any purpose..

Upvotes: 2

Sorceror
Sorceror

Reputation: 4843

It's possible to use StyledText widget (so no dependency on JFace) to show syntax highlight (see Into the Deep End of the SWT StyledText Widget), but it's quite lot of work to do.. For additional example see Implements syntax coloring using the StyledText API.

It's also possible to use SWT_AWT bridge and put the RSyntaxTextArea to your application directly..

Upvotes: 2

Related Questions