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

Bug 174233

Summary: Allow null anchor point in DebugPopup window
Product: [Eclipse Project] Platform Reporter: Darin Wright <darin.eclipse>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Mike_Wilson
Version: 3.3   
Target Milestone: 3.3 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 152641    
Attachments:
Description Flags
proposed patch none

Description Darin Wright CLA 2007-02-14 16:43:28 EST
3.3

The debug platform provides a popup window for displaying variables, results of evaluations, etc. We are also using this to display references and instances (J2SE6). Until now, our API required an anchor point (initial location) to be provided when invoking the constructor for the popup.

We found a case where we had no anchor point (bug 152641). In this case when "All Instances..." is invoked from the editor outline, we cannot derive a point at which to open the popup (the event carries no information about the location the menu action was chosen from). In this case, we want to use the default initial location code inherited from org.eclipse.jface.dialogs.PopupDialog. 

To do this, we need to allow clients to specify null as an anchor point. The javadoc for the constructor on DebugPopup and InspectPopupDialog would change to say that null is allowed since 3.3, which will use a default initial location.
Comment 1 Darin Wright CLA 2007-02-14 16:44:02 EST
Created attachment 59013 [details]
proposed patch
Comment 2 Darin Wright CLA 2007-02-14 16:53:01 EST
CC'ing PMC for approval. (I tried to send a mail to the pmc list, but first I have to wait to added to the mailing list...)
Comment 3 Jeff McAffer CLA 2007-02-15 08:44:41 EST
+1
Comment 4 Darin Wright CLA 2007-02-15 08:52:24 EST
Released patch.
Comment 5 Darin Wright CLA 2007-02-15 08:52:42 EST
Please verify, Mike (Rennie).
Comment 6 Michael Rennie CLA 2007-02-15 10:01:17 EST
verified.

It seems to me though that there just has to be another way to derive the anchor....is there perhaps some kind of mouse event or util that we can use to get its location? Maybe the same way that it is used for showing popup menus?
Comment 7 Mike Wilson CLA 2007-02-15 10:54:04 EST
You can get the global coordinates for the mouse, but popping anything other than a menu up under the mouse is considered bad style (or at least, "old school" <g>). Other options would be things like:
- centered on the main display
- near some known view
- on top of the active workbench window
- ...
I'm not sure exactly what workflow you're trying to implement here, so I can't really recommend anything deeper.