Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Wrapping StyledText on a form with TableWrapLayout
Wrapping StyledText on a form with TableWrapLayout [message #465937] Fri, 23 December 2005 15:24 Go to next message
Hans is currently offline HansFriend
Messages: 36
Registered: July 2009
Member
I have tried to add a StyledText with SWT.WRAP style to a ScrolledForm
which has TableWrapLayout. However, it seems that the layout algorithm
simply ignores the wrap flag and stretches the StyledText horizontally
without wrapping at all. The same configuration works ok if I use Text
instead of StyledText.

Is this a known problem, and are there any work-arounds?

Thanks,
Hans
Re: Wrapping StyledText on a form with TableWrapLayout [message #465946 is a reply to message #465937] Sat, 24 December 2005 16:47 Go to previous message
Hans is currently offline HansFriend
Messages: 36
Registered: July 2009
Member
I can partly respond, and report a bug in the class
org.eclipse.ui.internal.forms.widgetsFormUtil.java:

The method isWrapControl below is called during the computation of the
minimum width of the form's content, and it does not work correctly for
StyledText controls, because StyledText is derived from Composite. As a
result, the SWT.WRAP flag of the StyledText is being ignored.


static boolean isWrapControl(Control c) {
if (c instanceof Composite) {
return ((Composite) c).getLayout() instanceof ILayoutExtension;
}
return (c.getStyle() & SWT.WRAP) != 0;
}


There are work-arounds, but they are ugly and the issue should be fixed
by the Eclipse folks.

Hans


Hans wrote:
> I have tried to add a StyledText with SWT.WRAP style to a ScrolledForm
> which has TableWrapLayout. However, it seems that the layout algorithm
> simply ignores the wrap flag and stretches the StyledText horizontally
> without wrapping at all. The same configuration works ok if I use Text
> instead of StyledText.
>
> Is this a known problem, and are there any work-arounds?
>
> Thanks,
> Hans
Previous Topic:Custom Text Wdget with Decorator
Next Topic:Stand-alone Menus
Goto Forum:
  


Current Time: Fri Sep 21 21:05:39 GMT 2018

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

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

Back to the top