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

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

Introduction

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

Prototype

public static int getOppositeSide(int swtDirectionConstant) 

Source Link

Document

Returns the opposite of the given direction.

Usage

From source file:org.eclipse.ui.internal.FastViewPane.java

License:Open Source License

/**
 * Updates the position of the resize sash.
 */// w  w w.j a  v a2  s  .  com
private void updateFastViewSashBounds() {
    Rectangle bounds = getBounds();

    int oppositeSide = Geometry.getOppositeSide(side);
    Rectangle newBounds = Geometry.getExtrudedEdge(bounds, -getSashSize(), oppositeSide);

    Rectangle oldBounds = sash.getBounds();

    if (!newBounds.equals(oldBounds)) {
        sash.setBounds(newBounds);
    }
}