Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Sectioned Table Reflow Scroll problem
Sectioned Table Reflow Scroll problem [message #860383] Sat, 28 April 2012 03:05 Go to next message
Christopher White is currently offline Christopher WhiteFriend
Messages: 1
Registered: April 2012
Junior Member
I'm having some problems with an SWT table within a Form Section. Upon initial execution, my table has a vertical scrollbar within it - but upon collapsing and then re-expanding the form section, the scrollbar now migrates to the form (which is not what i want).

I have some simple code which demonstrates this on pastebin.com/dhBTPBc5 (apparently i can't post links as i'm under 25 posts..?)

I think this is related to BUG 215997 (again i can't post the link, sorry!)

Does anyone know of a workaround for this?

Thanks, Chris
Re: Sectioned Table Reflow Scroll problem [message #868263 is a reply to message #860383] Tue, 01 May 2012 18:24 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Chris,

https://bugs.eclipse.org/bugs/show_bug.cgi?id=215997 looks like what
you're describing. I don't think it's going to get fixed soon without
an external contribution though.

I've tried a few things with your snippet, but have only found a rather
ugly workaround, as the underlying bug is baked into the forms layout
implementation. To try the workaround in your snippet:

add fields:
static Rectangle tableBounds;
static boolean isExpanding;
change the expansion listener to:
section.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanging(ExpansionEvent e) {
super.expansionStateChanging(e);
if (e.getState()) {
isExpanding = true;
}
}
public void expansionStateChanged(ExpansionEvent e) {
form.reflow(true);
isExpanding = false;
}
});
add below shell.open():
tableBounds = table.getBounds();
table.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
// don't record bounds change triggered by the buggy layout
if (!isExpanding) {
tableBounds = table.getBounds();
}
}
});
table.addListener(SWT.Show, new Listener() {
public void handleEvent(Event event) {
// asyncExec strikes again
display.asyncExec(new Runnable() {
public void run() {
if (table.isDisposed()) return;
table.setBounds(tableBounds);
}
});
}
});

HTH,
Grant


On 4/27/2012 11:05 PM, Christopher White wrote:
> I'm having some problems with an SWT table within a Form Section. Upon
> initial execution, my table has a vertical scrollbar within it - but
> upon collapsing and then re-expanding the form section, the scrollbar
> now migrates to the form (which is not what i want).
>
> I have some simple code which demonstrates this on pastebin.com/dhBTPBc5
> (apparently i can't post links as i'm under 25 posts..?)
>
> I think this is related to BUG 215997 (again i can't post the link, sorry!)
>
> Does anyone know of a workaround for this?
>
> Thanks, Chris
Previous Topic:Text widget in Mac Cocoa not recognising line break
Next Topic:How to add DropDown to Table
Goto Forum:
  


Current Time: Wed Apr 24 14:45:28 GMT 2024

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

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

Back to the top