Bug 265237 - [Preferences] PreferenceDialog doesn't update the min size of its ScrolledComposite when page layout changes
Summary: [Preferences] PreferenceDialog doesn't update the min size of its ScrolledCom...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2009-02-17 19:14 EST by George Comninos CLA
Modified: 2012-10-24 13:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Comninos CLA 2009-02-17 19:14:32 EST
Build ID: M20080911-1700

Steps To Reproduce:
1. Build a preference page that dynamically adds controls/UI based on a popup or something (so the UI in the page grows or shrinks)
2. Change options in the popup so page size changes

Result: the scroll bars only appear based on the content when the page was first created, other items get clipped. PreferenceDialog should be informed when a Page's layout() method is called and call scrolled.setMinSize() based on the new currentPage.computeSize() (Just like it does in showPage() initially).


More information:
This is a problem for us in Flex Builder, we have UI that is getting clipped.
Comment 1 Oleg Besedin CLA 2009-02-24 14:18:05 EST
It seems that JDT does this for their preference page: Java -> Compiler -> Errors/Warnings. The scroll bars appear in this dialog when a section is expaded.

This is done by:

1) JavaTemplatePreferencePage overrides createContents() and wraps contents into a ScrolledPageContent (derivative of ScrolledComposite).

2) The code that processes expasion of dialog sections finds this ScrolledPageContent in its chain of parents and calls reflow(true) on it forcing it to recalculate the page size.

This shows a possible way to achieve this today, but, of course, in a very awkward way.

It seems that implementing this functionality on PreferenceDialog / PreferencePage will require API addition, something along the lines of PreferencePage#updateLayout() and PreferenceDialog#updateLayout(). The updateLayout() method then will be called by the preference pages when they add/remove controls.

As a note, the JDT code in SharedScrolledComposite#reflow() has some peculiar pieces dealing with updating page sizes and scroll increments.
Comment 2 Boris Bokowski CLA 2009-02-24 14:27:31 EST
Feels like you (George) should either use a workaround similar to JDT's, or even better, contribute a patch along the lines of what Oleg suggested. http://wiki.eclipse.org/Platform_UI/How_to_Contribute