Example usage for com.vaadin.shared.ui AlignmentInfo AlignmentInfo

List of usage examples for com.vaadin.shared.ui AlignmentInfo AlignmentInfo

Introduction

In this page you can find the example usage for com.vaadin.shared.ui AlignmentInfo AlignmentInfo.

Prototype

public AlignmentInfo(int bitMask) 

Source Link

Usage

From source file:com.haulmont.cuba.web.widgets.client.addons.popupbutton.VPopupButton.java

License:Apache License

public void setDirection(int direction) {
    this.direction = new AlignmentInfo(direction);
}

From source file:org.vaadin.overlay.widgetset.client.CustomOverlayConnector.java

License:Apache License

@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
    super.onStateChanged(stateChangeEvent);
    if (stateChangeEvent.hasPropertyChanged("x")) {
        getWidget().x = getState().x;//from  w  w  w .ja  va2s  .  c om
    }
    if (stateChangeEvent.hasPropertyChanged("y")) {
        getWidget().y = getState().y;
    }
    if (stateChangeEvent.hasPropertyChanged("alignBitMask")) {
        getWidget().align = new AlignmentInfo(getState().alignBitMask);
    }
    if (stateChangeEvent.hasPropertyChanged("overlayAlignBitMask")) {
        getWidget().overlayAlign = new AlignmentInfo(getState().overlayAlignBitMask);
    }
    if (stateChangeEvent.hasPropertyChanged("component")) {
        Connector connector = getState().component;
        if (connector != null) {
            Widget w = ((ComponentConnector) connector).getWidget();
            if (w instanceof CustomOverlayWidget) {
                w = ((CustomOverlayWidget) w).getOverlayWidget();
            }
            getWidget().refCompEl = w.getElement();
        }

        List<ComponentConnector> connectors = getChildComponents();
        if (connectors != null && connectors.size() > 0 && connectors.get(0) != null) {
            Widget p = connectors.get(0).getWidget();
            Widget w = getWidget().overlay.getWidget();
            if (p != w && w != null) {
                getWidget().overlay.clear();
            }
            getWidget().overlay.setWidget(p);
            getWidget().overlay.show();
        } else {
            getWidget().overlay.hide();
        }
    }
    getWidget().deferredUpdatePosition();
}