Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » MasterDetailsBlock resizes when expanding section
MasterDetailsBlock resizes when expanding section [message #464592] Mon, 12 March 2007 10:31 Go to next message
Christoph is currently offline ChristophFriend
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
Re: MasterDetailsBlock resizes when expanding section [message #466505 is a reply to message #464592] Fri, 20 April 2007 09:09 Go to previous message
Filippo Carone is currently offline Filippo CaroneFriend
Messages: 2
Registered: July 2009
Junior Member
Christoph wrote:
> 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.
>


I'm running into a similar issue. When you toggle the section the method
Section.internalSetExpanded() gets called, which in turn calls
Section.reflow(). This reflow() method redraws all the components inside
the parent ScrolledForm.

I tried to avoid the redraw of parts which shouldn't be involved adding
an expansion listener:

public void expansionStateChanging(ExpansionEvent e)
{
body.setRedraw(false);
body.setLayoutDeferred(true);
}

public void expansionStateChanged(ExpansionEvent e)
{
body.setRedraw(true);
body.setLayoutDeferred(false);
}

But the body redraw property is set to true inside the reflow(). This
shouldn't happen, since the section shouldn't arbitrarily set properties
of Composites inside the form.

Cheers,
Filippo
Previous Topic:conditional wizard
Next Topic:displaying feature info in Help->About->FeatureDetails
Goto Forum:
  


Current Time: Fri Apr 19 09:05:39 GMT 2024

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

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

Back to the top