MasterDetailsBlock resizes when expanding section [message #464592] |
Mon, 12 March 2007 10:31 |
Christoph Messages: 55 Registered: July 2009 |
Member |
|
|
Hi,
i have a masterdetailsblock and on one detailspage i have an expandable
section. Everytime i expand and collapse the section the weigths of the
master and of the details block changes with the result that the
master-part gets bigger and a scrollbar apears at the bottom of the block.
I donŽt see how i can avoid this.
Here is how i create the section:
final Section ec = toolkit.createSection(parent, Section.TWISTIE |
Section.FOCUS_TITLE | Section.COMPACT);
ec.setText(Messages.getString("geplan.ui.label.editor.bt.section1 "));
ec.setTitleBarForeground(toolkit.getColors().getColor("labelColor "));
ec.setToggleColor(toolkit.getColors().getColor("labelColor"));
ec.setLayout(new GridLayout(1, false));
gridData_5 = new GridData(SWT.FILL, SWT.TOP, true, false, 4, 1);
gridData_5.horizontalIndent=-9;
gridData_5.verticalIndent=7;
gridData_5.widthHint = 5216;
gridData_5.minimumWidth=516;
ec.setLayoutData(gridData_5);
final Composite exComposite=new Composite(ec,SWT.NONE);
exComposite.setLayout(new GridLayout(2,false));
gridData_9 = new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1);
exComposite.setLayoutData(gridData_9);
// i skip the content of the section here, there are basically three
labels and // three text-widgets.
ec.setClient(exComposite);
ec.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
super.expansionStateChanged(e);
// Try to set the weighs to the old value, which has no
effect
block.getSashForm().setWeights(new int[]{1, 2});
fieldAbfragename.setFocus();
}
});
Can anybody explain to me why my form gets resized?
Thanks for any help.
Christoph
|
|
|
|
Powered by
FUDForum. Page generated in 0.02055 seconds