Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Problems with Frame toolkit
Problems with Frame toolkit [message #520773] Mon, 15 March 2010 09:53
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi,
I'm writing a (somewhat complex) interface using Frames.
Current problem is I seem unable to control size of various elements
(probably a layout problem).

I have a master/details form; the details is as follows (I send the
whole createContents() because I'm unsure about what's relevant;
comments below):

public class SceneDetailsPage implements IDetailsPage {
....
public void createContents(Composite parent) {
FormToolkit toolkit = managedForm.getToolkit();
parent.setLayout(new FillLayout());
//
Section sctnBook = toolkit.createSection(parent,
ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
sctnBook.setText("Scene");
//
Composite composite = toolkit.createComposite(sctnBook, SWT.NONE);
toolkit.paintBordersFor(composite);
sctnBook.setClient(composite);
composite.setLayout(new GridLayout(1, false));

Section sctnOverview = toolkit.createSection(composite,
Section.TWISTIE | Section.TITLE_BAR);
sctnOverview.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, true, 1, 1));
toolkit.paintBordersFor(sctnOverview);
sctnOverview.setText("Overview");

Composite composite_1 = toolkit.createComposite(sctnOverview,
SWT.NONE);
toolkit.paintBordersFor(composite_1);
sctnOverview.setClient(composite_1);
composite_1.setLayout(new GridLayout(2, false));

Label lblTitle = toolkit.createLabel(composite_1, "Title:",
SWT.NONE);
lblTitle.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER,
false, false, 1, 1));

txtTitle = toolkit.createText(composite_1, "Title", SWT.NONE);
txtTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false, 1, 1));

txtDesc = toolkit.createText(composite_1, "Desc", SWT.WRAP |
SWT.V_SCROLL | SWT.MULTI);
txtDesc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
true, 2, 1));

Label lblWords = toolkit.createLabel(composite_1, "Words:",
SWT.NONE);
lblWords.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER,
false, false, 1, 1));

txtWords = toolkit.createText(composite_1, "Words", SWT.NONE);
txtWords.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false, 1, 1));
sctnOverview.setExpanded(true);

Section sctnContent = toolkit.createSection(composite,
Section.TWISTIE | Section.TITLE_BAR);
sctnContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, true, 1, 1));
toolkit.paintBordersFor(sctnContent);
sctnContent.setText("Content");

txtContent = toolkit.createText(sctnContent, "Content",
SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
sctnContent.setClient(txtContent);
sctnContent.setExpanded(true);

initDataBindings();
}
...
}

The problem is when the size of "Content" grows so does the size of the
Text widget (txtContent) up to the point the previous section (sctnBook)
disappears completely (unless I use the twistie to hide sctnContent),
then a scrollbar appears at the top level (the vertical size of
txtContent is still growing!).
After further adding text a *second* scrollbar opens *in* txtContent and
it stops growing when I keep adding text.
This is plain ugly.
Expected behavior would be to have just a single scrollbar in txtContent
and no (excessive) shrinkage of sctnBook.

What am I doing wrong?
I tried several configurations, including wrapping in a scrollbox, but
that does not seem to help.

Thanks in Advance.
Mauro
Previous Topic:Chaining content assist's in an editor
Next Topic:Rendering HTML Table in Eclipse FormText Control
Goto Forum:
  


Current Time: Tue Apr 16 19:14:45 GMT 2024

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

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

Back to the top