views:

22

answers:

2

I'm developing a custom text editor for a programming language in Eclipse. Is it possible to put a widget (a button, for instance) inside a custom text editor?

+2  A: 

For all SWT related questions, always have a look at the official Snippet page first. Often it is really helpful. This is one of these cases: Snippet217 shows how to embed arbitrary controls in a StyledText, which seems to be what you aim for.

the.duckman
That's perfect, thank you :)
Allan
A: 

It doesn't directly awnser your question but I would recommend using http://www.eclipse.org/Xtext/ (Xtext). By defining a grammar for your programming language, Xtext generates a whole IDE for your language including an editor with syntax highlighting and auto-completion, an outline and hooks for builders etc.

It really is amazing, the first time I used it my jaw just dropped.

BernardMarx