Bug 161902 [JFace] Enhancements to GridLayoutFactory.margins
This enhancement requests the following: 1. Rename the new GridLayoutFactory.margins(int,int,int,int) to GridLayoutFactory.extendedMargins(int,int,int,int) 2. Add a GridLayoutFactory.extendedMargins(Rectangle) method that accepts a difference rectangle. 3. Add static methods to Geometry in order to easily construct difference rectangles. Why? 1. We should not use overloaded methods in GridLayoutFactory unless they really do set the same thing. Since the four-argument margins(...) method and the two-argument margins(...) method set independent values, we should give them different names or clients will expect a call to margins(int, int, int, int) to overwrite a previous call to margins(int, int). 2. All methods on GridLayoutFactory and GridDataFactory should have vector initializers, so that clients can store and reuse standard margin settings in a single variable. 3. Vector initializers are only a convenience if there is a convenient way to construct the vector.
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Geometry.java
* @since 3.0
     */
    public static void setLocation(Rectangle rectangle, Point newSize) {
        rectangle.width = newSize.x;
        rectangle.height = newSize.y;
    }
    /**
     * Returns the x,y position of the given rectangle. For normalized rectangles
     * (rectangles with positive width and height), this is the upper-left
     * corner of the rectangle.
     * 
     * @param toQuery rectangle to query
     * @return a Point containing the x,y position of the rectangle
     * 
     * @since 3.0
     */
    public static Point getLocation(Rectangle toQuery) {
        return new Point(toQuery.x, toQuery.y);
    }
    /**
     * Returns a new rectangle with the given position and dimensions, expressed
     * as points.
     * 
     * @param position the (x,y) position of the rectangle
     * @param size the size of the new rectangle, where (x,y) -> (width, height)
     * @return a new Rectangle with the given position and size
     * 
     * @since 3.0
     */
    public static Rectangle createRectangle(Point position, Point size) {