Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » AbstractPropertySection and wrapping
AbstractPropertySection and wrapping [message #654841] Thu, 17 February 2011 11:43 Go to next message
Martin Tauber is currently offline Martin TauberFriend
Messages: 122
Registered: July 2009
Senior Member
Hi everybody,

I'm trying to create a property sheet using eclipse forms. The property
sheet should print documentation for objects selected. The documentation
could be quite long and should wrap automatically. Well and here is the
problem it does not. I've tried a lot of stuff but nothing seams to
work. I am already wondering if it is possible or not. Here is some code
I wrote:

public void createControls(Composite parent,
final TabbedPropertySheetPage atabbedPropertySheetPage) {
super.createControls(parent, atabbedPropertySheetPage);



toolkit = new TabbedPropertySheetWidgetFactory();
form = toolkit.createForm(parent);
form.setText("Documentation");

TableWrapLayout descriptionLayout = new TableWrapLayout();
descriptionLayout.numColumns=1;
form.getBody().setLayout(descriptionLayout);


TableWrapData twd = new TableWrapData();
twd.colspan=1;
twd.grabVertical=true;
twd.grabHorizontal=true;

String t = "dhfjsfhk hfdskj fhjksd fhdsjkf hjkhjkhfdsjhk
hfjdshhjkhdfs hfdsjhfdj fhdjfh sdhfjdhjfdskhjfdsh hfdjskhf dsjkjhfdjsk h
hfdskjhfdjsh hjkfsdh fdhjkshfdskjhfdsj hjfdskhf dshjfksdhf sdjk";

FormText text = toolkit.createFormText(form.getBody(), false);
text.setText(t, false, false);
text.setLayoutData(twd);
}

No mater what widget I take the long text t is not wrapped :(

Regards
Martin
Re: AbstractPropertySection and wrapping [message #655279 is a reply to message #654841] Fri, 18 February 2011 22:55 Go to previous messageGo to next message
Chris Goldthorpe is currently offline Chris GoldthorpeFriend
Messages: 815
Registered: July 2009
Senior Member
I jut tried inserting most of your your sample code into a plug-in with a view and it worked fine. I think the problem is that the parent does not have width preference and get's it's width from the Form, which in turn gets it's width from the FormText.

If the parent composite had it's width specified then that width would get propagated down to it's descendents, however I'm guessing that in your example the parent has no width preference so it allows it's children to be their preferred size.
Re: AbstractPropertySection and wrapping [message #655493 is a reply to message #655279] Mon, 21 February 2011 12:22 Go to previous messageGo to next message
Martin Tauber is currently offline Martin TauberFriend
Messages: 122
Registered: July 2009
Senior Member
Well, my understanding is that I don't have an influence on the parent,
since this is the section of a propertyTab. I also read somewhere, that
the TableWrapLayout doesn't work as expected (wrapping the control) if
one of the Parents has the GridLayout, So I was already wondering if a
property section would have that layout avoiding that my wrapping works
fine ... :(

Am 18.02.11 23:55, schrieb Chris Goldthorpe:
> I jut tried inserting most of your your sample code into a plug-in with
> a view and it worked fine. I think the problem is that the parent does
> not have width preference and get's it's width from the Form, which in
> turn gets it's width from the FormText.
>
> If the parent composite had it's width specified then that width would
> get propagated down to it's descendents, however I'm guessing that in
> your example the parent has no width preference so it allows it's
> children to be their preferred size.
Re: AbstractPropertySection and wrapping [message #655608 is a reply to message #655493] Mon, 21 February 2011 22:21 Go to previous message
Chris Goldthorpe is currently offline Chris GoldthorpeFriend
Messages: 815
Registered: July 2009
Senior Member
Can you give instructions on how to create a test case that illustrates the problem? There are definitely situations where TableWrapLayout and GridLayout do not work well together.
Previous Topic:Customizing Help System Navigation pane, Search toolbar font, Content toolbar font, color
Next Topic:How to host Eclipse help on a server
Goto Forum:
  


Current Time: Fri Oct 04 22:13:47 GMT 2024

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

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

Back to the top