Bug 100688 [JFace] Geometry.setLocation does not behave as documented
Geometry.setLocation incorrectly modifies the size of the rectangle, when it should modify the origin.
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Geometry.java
return new Rectangle(position.x, position.y, size.x, size.y);
    }
    
    /**
	 * Repositions the 'inner' rectangle to lie completely within the bounds of the 'outer'
	 * rectangle if possible. One use for this is to ensure that, when setting a control's bounds,
	 * that they will always lie within its parent's client area (to avoid clipping).
	 * 
	 * @param inner The 'inner' rectangle to be repositioned (should be smaller than the 'outer' rectangle)
	 * @param outer The 'outer' rectangle
	 */
	public static void moveInside(Rectangle inner, Rectangle outer) {
		
		if (inner.x < outer.x) {
			inner.x = outer.x;
		}
		if ((inner.x + inner.width) > (outer.x + outer.width)) {
			inner.x -= (inner.x + inner.width) - (outer.x + outer.width);
		}
		
		if (inner.y < outer.y) {
			inner.y = outer.y;
		}
		if ((inner.y + inner.height) > (outer.y + outer.height)) {
			inner.y -= (inner.y + inner.height) - (outer.y + outer.height);
		}
	}
    
}