Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Combining SashForm and ExpandBar
Combining SashForm and ExpandBar [message #329644] Mon, 30 June 2008 15:59 Go to next message
Eclipse UserFriend
Hi Folks,

Is it possible to combine SashForm with ExpandBar so I can adjust the heights of an expanded item?

So, I've been playing with Snippet223 and can get the ExpandBar working great but I'd like to be able to adjust the relative hights of the expanded items so thought a SashForm would be ideal. I can't get anything to work though and will often get the "wrong parent" error when experimenting.

Any ideas?

Cheers,
Toby
Re: Combining SashForm and ExpandBar [message #329646 is a reply to message #329644] Mon, 30 June 2008 16:37 Go to previous message
Eclipse UserFriend
I think I answered my own question! I was playing with a Sash rather than SashForm and can add it to the composite that the ExpandItem will display, then adjust the height based on the event's capture's Y co-ordinate.

It doesn't drag past the bottom of the compisite but is prob ok.

final ExpandItem expandable = new ExpandItem(bar, SWT.NONE, 0);
expandable.setControl(composite);  			

Sash sash = new Sash(composite, SWT.HORIZONTAL);
sash.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
sash.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseUp(MouseEvent e) {
       expandable.setHeight(expandable.getHeight() + e.y);
    }
});
Previous Topic:Ant editor outline view support for ant-contrib?
Next Topic:Running Selected Ant target
Goto Forum:
  


Current Time: Fri May 02 01:36:50 EDT 2025

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

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

Back to the top