Example usage for com.google.gwt.user.client.ui DockLayoutPanel getWidgetDirection

List of usage examples for com.google.gwt.user.client.ui DockLayoutPanel getWidgetDirection

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DockLayoutPanel getWidgetDirection.

Prototype

public Direction getWidgetDirection(Widget child) 

Source Link

Document

Gets the layout direction of the given child widget.

Usage

From source file:cc.alcina.framework.gwt.client.util.WidgetUtils.java

License:Apache License

private static boolean isDirectionalLayoutPanel(Widget panel, boolean horizontal) {
    if (panel instanceof DockLayoutPanel) {
        DockLayoutPanel dlp = (DockLayoutPanel) panel;
        Iterator<Widget> itr = dlp.iterator();
        for (Widget widget : dlp) {
            Direction dir = dlp.getWidgetDirection(widget);
            if (horizontal && (dir == Direction.NORTH || dir == Direction.SOUTH)) {
                return false;
            }/*from  www. j  a  va 2  s . com*/
            if (!horizontal && (dir == Direction.WEST || dir == Direction.EAST)) {
                return false;
            }
        }
        return true;
    }
    return false;
}