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
table.toControl(cursorLocation));
				if (p == null)
					return cursorLocation;
				return table.toDisplay(
					p.x + iBounds.width + getAvarageCharWith(table) * CHAR_INDENT, 
					p.y);
			}
		}
	}
	
	private Point[] getIncludedPositions(Rectangle[] rectangles, Rectangle widgetBounds) {
		List result= new ArrayList();
		for (int i= 0; i < rectangles.length; i++) {
			Rectangle rectangle= rectangles[i];
			Rectangle intersect= widgetBounds.intersection(rectangle);
			if (intersect != null && intersect.height == rectangle.height) {
				result.add(new Point(intersect.x, intersect.y + intersect.height));
			}
		}
		return (Point[]) result.toArray(new Point[result.size()]);
	}
	
	private Point findBestLocation(Point[] points, Point relativeCursor) {
		Point result= null;
		double bestDist= Double.MAX_VALUE;
		for (int i= 0; i < points.length; i++) {
			Point point= points[i];
			int a= 0;
			int b= 0;
			if (point.x > relativeCursor.x) {