How to use JDT spell checking in more than one text field? [message #1235126] |
Thu, 23 January 2014 11:19 |
Eclipse User |
|
|
|
Hi all,
I would like to use the spell checking mechanism of JDT UI within some text fields (as opposed to one single text editor).
I use Eclipse 4.3. So far I have installed the JDT plugin with the spell check engine. The spell checking is enabled within the preferences.
While searching I found the following examples for spell checking (not allowed to post links here)
- eclipsesource.com/blogs/2008/10/03/tip-spellchecking-in-eclipse/
- blog.ankursharma.org/2009/08/adding-spellchecking-to-custom-editors_19.html
From the examples, it seems to be easy to add spell checking and other features when using a SourceViewer. Just configure the SourceViewer with the current preferences, that's it. But...
We have a custom org.eclipse.ui.editors.text.TextEditor for our own file types. This editor does not show only one single text field, but splits the input into several text fields and hides the original SourceViewer. The spell checking works out-of-the-box on the original document of the TextEditor's SourceViewer, but no one can see it (due to the splitting and hiding).
So I created a custom component (extends Composite) with its own SourceViewer and configured it as described in the examples (with all defaults, no custom subclasses, etc). Each SourceViewer has its own IDocument instance that only contains a part of the whole file content.
To me it seems that there is no listener (maybe org.eclipse.jface.text.ITextListener) on the source viewer that triggers the spell check.
Where is my mistake?
Thanks a lot in advance.
Johannes
|
|
|
Powered by
FUDForum. Page generated in 0.03494 seconds