Bug 62703 refactoring & source quick menus location should be confined to workbench [quick menu]
I20040518 M9 testpass 1. Use eclipse without it covering the entire screen, but merely the lower left 2. Open JavaEditor.java 3. Put the editor caret somewhere on AbstractSelectionChangedListener::install 4. Without changing the selection, scroll to the very end of the end of the file 5. Press Alt+Shift+T/S to bring up the quick menu -> expected: the menu shows up somewhere in the eclipse workbench -> actual: the menu shows up on the very top of the screen, over other applications.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/QuickMenuAction.java
/**
	 * Hook to compute the menu location if the focus widget is
	 * a tree widget.
	 * 
	 * @param tree the tree widget that has the focus
	 * 
	 * @return a display relative position of the menu to pop up
	 */
	protected Point computeMenuLocation(Tree tree) {
		TreeItem[] items= tree.getSelection();
		switch (items.length) {
			case 0:
				return null;
			case 1:
				Rectangle bounds= items[0].getBounds();
				return tree.toDisplay(
					Math.max(0, bounds.x + getAvarageCharWith(tree) * CHAR_INDENT), 
					bounds.y + bounds.height);
			default:
				Rectangle[] rectangles= new Rectangle[items.length];
				for (int i= 0; i < rectangles.length; i++) {
					rectangles[i]= items[i].getBounds();
				}
				Point cursorLocation= tree.getDisplay().getCursorLocation();
				Point p= findBestLocation(getIncludedPositions(rectangles, tree.getClientArea()), 
					tree.toControl(cursorLocation));
				if (p == null)
					return cursorLocation;
				return tree.toDisplay(p.x + getAvarageCharWith(tree) * CHAR_INDENT, p.y);