Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Disable scrolling in MasterDetailsBlock
Disable scrolling in MasterDetailsBlock [message #326038] Thu, 06 March 2008 07:39 Go to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
I am trying to create a master-detail form using the MasterDetailsBlock.
The problem I am encountering is that the IManagedForm uses ScrolledForm
rather than Form. The result is that my master block, which consists of a
large tree viewer, causes the entire master-detail block to scroll when it
gets large. This causes the detail page, which is much smaller, to be
completely outside the view port when I select items far down in the Tree
that I want to display details for... which kinds of defeats the point of
the details block.

What I would prefer is that the ScrolledForm maintain an FILL_BOTH type of
behaviour in its container (a ViewPart), but allow the tree in the master
to scroll. However, I can't seem to configure the ScrolledForm to not
scroll in the vertical. When I set setExpandVertical(false), for example,
things improve, but when I click on the expanded state of a Section in the
detail part, it resizes the tree and everything goes loopy.

To summarize, I'd like the tree view in the master part of my
MasterDetailsBlock to be able to resize to its container, but I want it to
scroll, not the whole MasterDetailsBlock if it gets too big for the view
port.


Thanks,

Cameron
Re: Disable scrolling in MasterDetailsBlock [message #548509 is a reply to message #326038] Thu, 22 July 2010 08:32 Go to previous message
Michael  is currently offline Michael Friend
Messages: 1
Registered: June 2010
Junior Member
I have also run into this issue.

What I eventually discovered is that this seemed to only happen when creating the MasterDetailsBlock inside of a ScrolledPageBook (or any PageBook for that matter). When a changed the ScrolledPageBook to a CTabFolder, everything started working as expected. The table now has the scrollbars and the MasterDetailsBlock does not.

I still don't quite know why this is. Perhaps someone else has some more insight.

UPDATE:

In playing with the CTabFolder, I soon discovered this only solved the problem in the initial display of the form. A reflow(true) on your scrolledForm will eventually cause the table to expand without scrollbars, and the scrollbars will instead appear on the form itself. This reflow can occur automatically, for example, when setting the text of the form.

I then stumbled upon the solution. You must provide a width and height hint in the layout data assigned to the table (or tree) that you wish to be properly scrolled. The values you set as the hints will effectively be the minimum size of the table before the scrolled form starts displaying scrollbars.
        GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.widthHint = 500;
        gd.heightHint = 120;
        table.setLayoutData(gd);

After setting the hint on my grid data, I went back to using a ScrolledPageBook with no issues.

[Updated on: Thu, 22 July 2010 18:35]

Report message to a moderator

Previous Topic:Build problem
Next Topic:Plug-ins installed but not available
Goto Forum:
  


Current Time: Tue Apr 23 09:14:03 GMT 2024

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

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

Back to the top