Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313461 - DirectoryDialog Shell Cannot be Centered
Summary: DirectoryDialog Shell Cannot be Centered
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 00:26 EDT by Missing name CLA
Modified: 2010-05-19 11:30 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 Missing name CLA 2010-05-19 00:26:35 EDT
Build Identifier: 

The DirectoryDialog produces a Window whose placement on the screen seems to be quasi-random. There seems to be no way to get a reference to the underlying Window so that it can be centered on the screen. This leads to a poor user experience.

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2010-05-19 11:30:36 EDT
The position is determined by the OS.

Adding setLocation only for one dialog (DirectoryDialog) doesn't make sense, we need to add to all others. We would need to know if setLocation() is possible for all dialogs on all platforms.
Moreover, setLocation() alone is useless. If you want to center the dialog, you would also need getSize(). So, for the API to be consistent we would need to add to all dialogs:

setLocation()
getLocation()
setSize()
getSize()
setBounds()
getBounds()


Which I know is not possible on all platforms. On windows, for example, you can only get the size of the dialog after you open it (or not at all, ain't sure).

I'm closing this request as won't fix. Sorry.

Let the OS determine the location of the dialog for you, that is what all application using DirectoryDialog (on windows) are doing.