Custom TextEditor, key events and custom encoding [message #509960] |
Mon, 25 January 2010 16:57  |
Eclipse User |
|
|
|
I'm currently writing a text editor plugin for a custom language (there is already a working Netbeans version). Syntax highlighting, partitioning etc. is all working well now.
The editor is for a theorem proof assistant (Isabelle) and thus the user should have the ability to enter math symbols very easily. This leads to two problems I'm facing right now:
- I need an IAutoEditStrategy (do I?) that replaces e.g. -> with → (Unicode right arrow). The user should be able to prohibit this transformation by pressing ESC before entering it. But I can't find a way to get that information. There doesn't seem to be a way to listen to key events inside an editor, or I just can't find it.
- Isabelle only understands ASCII. That means every unicode character must be replaced by an ASCII representation (e.g. → to "\<rightarrow>"). I also can't find an interface suitable of doing that. I tried to register a new Charset to Java via CharsetProvider, but without luck.
I would be very happy if someone could point me in the right directions. Thank you.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Custom TextEditor, key events and custom encoding [message #512239 is a reply to message #509960] |
Thu, 04 February 2010 08:34  |
Eclipse User |
|
|
|
I looked at the JavaDoc.
There are at least three different methods for saving:
commitFileBuffer
createFileFromDocument
createFileStoreFromDocument
For read operations I think the ITextFileBuffer is created from FileBuffers.getTextFileBufferManager() when connect is called.
And if that is not working the parent document provider (StorageDocumentProvider per default) is used.
So for saving I could change all three methods, but for reading I still can't find a way to extend this class without reimplementing large parts of it. Is there a alternative to TextFileDocumentProvider with an easier interface?
I'm sorry, but the main problem is that Eclipse has such a huge codebase, and I just don't know where to look at exactly.
|
|
|
Powered by
FUDForum. Page generated in 0.10910 seconds