Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Is the StyledText class Customizable of the editor plugin ?((it's about the default editor plugin of eclipse: org.eclipse.ui.editors))
Is the StyledText class Customizable of the editor plugin ? [message #734686] Sun, 09 October 2011 09:52
Phil R is currently offline Phil RFriend
Messages: 99
Registered: September 2011
Hi all,

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

Previous Topic:OS X + Swing + OSGi
Next Topic:swt widget called from Menu
Goto Forum:

Current Time: Tue Jun 28 23:10:30 GMT 2022

Powered by FUDForum. Page generated in 0.01629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top