Eclipse StyledText wrapping [message #1404805] |
Tue, 05 August 2014 21:21 |
Laura X Messages: 2 Registered: August 2014 |
Junior Member |
|
|
Hello everyone,
I have an Eclipse RCP application with a multipage editor with 2 pages: one is a text editor and the other one a graphical editor constructed on top of GEF. The GEF objects are org.eclipse.draw2d.Label and the text is added in one org.eclipse.swt.graphics.TextLayout. This is what we call "view mode". When an object is clicked, the application switches to "edit mode", a StyledText control is created right above the label and the end user could edit. When he clicks outside the editing area or presses ESC, the edit mode is exited and the previous view mode with GEF objects is restored, all the changes are commited to view mode. So there must be a 1-1 correspondence in between edit and view mode, the text edited in the StyledText must be have the same alignment & all with the text in the label.
My problem is that the StyledText control has additional wrapping mechanisms. In view mode, the wrapping is performed only after the width. The StyledText in edit mode seems to perform a more logical wrapping, for example the text is not split at parantheisis but full expressions are kept as much as possible together. I think it also takes into account the tab list. Reason for not having the same "image" view-edit mode. The StyledText keeps an array of TextLayouts instead of one as we do in view mode. To translate the StyledText wrapping is almost impossible, error prone, the control uses different internal mechanisms for which a corespondence must be implemented in the Label.
Any other idea? To disable somehow this additional mechannisms of the StyledText and have just a basic wrapping after width and special characters. Or maybe to use a different GEF object that would ensure a 1-1 corespondence with the StyledText control.
Thanks for any help, suggestion !
|
|
|
|
Powered by
FUDForum. Page generated in 0.02961 seconds