|Is the StyledText class Customizable of the editor plugin ? [message #734686]
||Sun, 09 October 2011 09:52
| Phil R
Registered: September 2011
I need to customize the StyledText Class in this method: void modifyContent(Event event, boolean updateCaret)
I'm using it in a editor plugin. I have my own SourceViewer which extends TextViewer and in that TextViewer is the StyledText class declared.
I need to correct the caret offsets in the StyledText class because I have converted "=>" to a particular character "\u2192" (=rightwards arrow) in the DocumentAdapter which the SourceViewer is using to switch text from the "view" to the core system and vice versa. It works but the caret will be 1 place further then what the really position is of new characters. It is confusing that the caret is not on the correct spot.
The TextViewer is a huge class so I'm hoping there is a solution where I don't have to touch it?
EDIT: sorry got it fixed I just found that there is a method createTextWidget to override.
may I ask you what you think of my solution?
PS: the idea to use the DocumentAdapter for converting this text should stay. The reason is that this would cause trouble in the core system which only know "=>" and I can't use unicodes, too long story to tell. (frameworks/file storages/...)
[Updated on: Sun, 09 October 2011 10:06]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01629 seconds