Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Eclipse StyledText wrapping
Eclipse StyledText wrapping [message #1404805] Tue, 05 August 2014 21:21 Go to next message
Laura X is currently offline Laura XFriend
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 !
Re: Eclipse StyledText wrapping [message #1405132 is a reply to message #1404805] Wed, 06 August 2014 16:58 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Moving this to the SWT forum group.
Previous Topic:loading flash plugin with webkit browser
Next Topic:Databinding with Converter for Combobox entries
Goto Forum:
  


Current Time: Wed Apr 24 17:43:16 GMT 2024

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

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

Back to the top