Bug 270743

Summary: Dialog location should be modifiable
Product: [Eclipse Project] Platform Reporter: Christopher Deckers <chrriis>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse.felipe, steve_northover
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Christopher Deckers CLA 2009-04-01 06:44:38 EDT
Sometimes it is desirable that a dialog appears at a particular location, and I have not found any such API.

There are 2 scenarios:
1. center around a given location.
2. With its top left corner at a particular location, provided we have a way to know the size of the dialog.

I guess the real size of a dialog is only known when the dialog is shown and depends on some settings that may be set before calling the various open() methods.
I thus suggest the possibility to set a location strategy on the dialog:
Dialog.setLocationStrategy(DialogLocationStrategy);
where DialogLocationStrategy is an interface with a method:
Point getLocation(Rectangle defaultBounds);
This method would be invoked by that dialog just befor actually showing, to adjust its location.
Comment 1 Felipe Heidrich CLA 2009-04-03 16:55:53 EDT
Win32 doesn't provide API to set the location for its dialogs.

Steve to determine if it is possible to implement our own set location function using a window hook or some other technique.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:05:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.