Example usage for org.eclipse.jface.util Geometry createDiffRectangle

List of usage examples for org.eclipse.jface.util Geometry createDiffRectangle

Introduction

In this page you can find the example usage for org.eclipse.jface.util Geometry createDiffRectangle.

Prototype

public static Rectangle createDiffRectangle(int left, int right, int top, int bottom) 

Source Link

Document

Returns a rectangle which, when added to another rectangle, will expand each side by the given number of units.

Usage

From source file:org.eclipse.jface.snippets.layout.Snippet013GridLayoutFactory.java

License:Open Source License

public static Shell createShell3() {
    Shell shell = new Shell(Display.getCurrent(), SWT.SHELL_TRIM);

    // Populate the shell
    Text text = new Text(shell, SWT.WRAP | SWT.BORDER);
    text.setText(//from  w ww  .  j a v a 2s .  c o m
            "This shell has asymmetric margins. The left, right, top, and bottom margins should be 0, 10, 40, and 80 pixels respectively");

    Rectangle margins = Geometry.createDiffRectangle(0, 10, 40, 80);

    GridLayoutFactory.fillDefaults().extendedMargins(margins).generateLayout(shell);

    return shell;
}