Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339448

Summary: query dialog should resize when sections are expanded
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact: Frank Becker <eclipse>
Severity: enhancement    
Priority: P3 CC: robert.elves, sam.davis
Version: unspecified   
Target Milestone: 3.6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch V1
none
mylyn/context/zip
none
patch V2
none
mylyn/context/zip
none
small fix
none
patch V3
none
mylyn/context/zip none

Description Steffen Pingel CLA 2011-03-09 19:19:29 EST
When a section is expanded on the query page and the size of the dialog is not sufficient to show all controls without a scroll bar the dialog should be resized so that entire page is visible without a scroll bar.
Comment 1 Steffen Pingel CLA 2011-03-09 19:19:46 EST
Frank, before we start working on this let's look at generalizing the query page.
Comment 2 Frank Becker CLA 2011-03-09 23:50:14 EST
(In reply to comment #1)
> Frank, before we start working on this let's look at generalizing the query
> page.

QK, but I first finish my work for bug# 168204 ([patch] support bugzilla's usermatchmode for matching names to email addresses).
Comment 3 Frank Becker CLA 2011-03-12 15:44:20 EST
Created attachment 191056 [details]
patch V1

committed patch
Comment 4 Frank Becker CLA 2011-03-12 15:44:24 EST
Created attachment 191057 [details]
mylyn/context/zip
Comment 5 Frank Becker CLA 2011-03-12 15:46:48 EST
Steffen,

if you do not want the change for SearchPage please reopen this bug.
Comment 6 Steffen Pingel CLA 2011-03-12 16:02:32 EST
Please revert the change to SectionComposite. We need to come up with a better strategy that only packs or resizes the dialog when it is necessary.
Comment 7 Steffen Pingel CLA 2011-03-12 16:04:47 EST
Please also remove this chunk of code in the BugzillaSearchPage:

		Display.getDefault().asyncExec(new Runnable() {
			public void run() {
				scrolledComposite.reflow(true);
				scrolledComposite.getShell().pack(true);
			}
		});

I am not sure that pack is the right strategy at all since it can actually shrink the dialog which we should never do.
Comment 8 Frank Becker CLA 2011-03-12 16:33:41 EST
patch V1 is now reverted!

(In reply to comment #7)
> 
> I am not sure that pack is the right strategy at all since it can actually
> shrink the dialog which we should never do.

I use pack() because I found this in TaskUIPreferencePage.createAdvancedSection in expansionStateChanged

Thoughts for how to solve this without pack()?
Comment 9 Frank Becker CLA 2011-03-20 15:18:09 EDT
Created attachment 191580 [details]
patch V2

Here the next version (now in HEAD)

Steffen,

please verify!
Comment 10 Frank Becker CLA 2011-03-20 15:18:12 EDT
Created attachment 191581 [details]
mylyn/context/zip
Comment 11 Steffen Pingel CLA 2011-04-13 18:12:57 EDT
Created attachment 193201 [details]
small fix
Comment 12 Steffen Pingel CLA 2011-04-13 18:15:39 EDT
This looks pretty good to me. Frank, could you take a look at Window.getConstrainedShellBounds()? My sense is that we should pass the new size through that method to make sure the window never exceeds monitor bounds.
Comment 13 Frank Becker CLA 2011-04-18 15:53:22 EDT
(In reply to comment #12)
> This looks pretty good to me. Frank, could you take a look at
> Window.getConstrainedShellBounds()? My sense is that we should pass the new size
> through that method to make sure the window never exceeds monitor bounds.

Window.getConstrainedShellBounds() is protected and we need a way to access this from SectionComposite.

Thoughts?
Comment 14 Steffen Pingel CLA 2011-05-04 18:07:30 EDT
Args, that's unfortunate. We may need to create a copy of that method in a utility class in the commons then.
Comment 15 Frank Becker CLA 2011-05-08 14:17:07 EDT
Created attachment 195023 [details]
patch V3

(In reply to comment #14)
> Args, that's unfortunate. We may need to create a copy of that method in a
> utility class in the commons then.

Class  org.eclipse.mylyn.internal.commons.ui.WindowUtil hold the need method.
Comment 16 Frank Becker CLA 2011-05-08 14:17:10 EDT
Created attachment 195024 [details]
mylyn/context/zip
Comment 17 Frank Becker CLA 2011-05-08 14:20:09 EDT
patch V3 is now in HEAD.