Example usage for com.google.gwt.user.client Window getClientHeight

List of usage examples for com.google.gwt.user.client Window getClientHeight

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window getClientHeight.

Prototype

public static int getClientHeight() 

Source Link

Usage

From source file:com.gwos.client.ui.desktop.IconsArea.java

License:Apache License

private void setAreaSize() {
    rootPanel.setSize(Window.getClientWidth(), Window.getClientHeight() - Constants.TASK_BAR_HEIGHT_OFFSET);
    Window.addResizeHandler(new ResizeHandler() {
        public void onResize(ResizeEvent event) {
            rootPanel.setSize(event.getWidth(), event.getHeight() - Constants.TASK_BAR_HEIGHT_OFFSET);
        }/*from w  w w. j av a  2  s  .  c om*/
    });
}

From source file:com.gwtcx.extgwt.client.desktop.view.AbstractFormView.java

License:Open Source License

protected void resize() {

    int width = Window.getClientWidth();
    int height = Window.getClientHeight();

    Log.debug("resize() - width: " + width + " height: " + height);

    getPanel().setSize(width + "px", height + "px");
    getPanel().onResize();//from www.  j a va2  s  . c o  m
}

From source file:com.gwtcx.extgwt.client.desktop.view.AbstractSettingsView.java

License:Open Source License

public void resize() {
    panel.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    panel.onResize();
}

From source file:com.gwtcx.extgwt.client.desktop.view.AbstractTabbedFormView.java

License:Open Source License

protected void resize() {

    int width = Window.getClientWidth();
    int height = Window.getClientHeight();

    Log.debug("resize() - width: " + width + " height: " + height);

    getPanel().setSize(width + "px", height + "px");
    getForm().setSize(width + "px", height + "px");
    getTabPanel().setWidth(width + "px");

    getPanel().onResize();/*from  w  w  w.j a  va2s .c  o m*/
}

From source file:com.gwtcx.extgwt.client.desktop.view.contact.AbstractContactTabbedFormView.java

License:Open Source License

protected void resize() {

    int width = Window.getClientWidth();
    int height = Window.getClientHeight();

    VerticalLayoutContainer layout = null;

    Log.debug("resize() - width: " + width + " height: " + height);

    getPanel().setSize(width + "px", height + "px");
    getForm().setSize(width + "px", height + "px");
    getTabPanel().setWidth(width + "px");

    if (getTabTemplate() == null) {
        Log.error("You must call setTabTemplate() in the constructor of your derived class");
        return;//from  w w w .  j  a va  2 s  . c  o m
    }

    for (int row = 0; row < getNumberOfTabs(); row++) {

        layout = entityTabs[row].getLayoutContainer();

        if (layout != null
                && layout instanceof com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer) {

            layout.setSize(width + "px", height + "px");

            Log.debug("layout.setSize()");
        }
    }

    getPanel().onResize();
}

From source file:com.gwtm.ui.client.widgets.OverlayPanel.java

License:Apache License

private void doPosition(Style s) {

    if (isCentered) {

        setBottom(null);//from  w w  w . j av  a2  s.  com
        setRight(null);
        setTop("50%");
        setLeft("50%");
        int height = getWidget().getOffsetHeight();
        int width = getWidget().getOffsetWidth();
        int centralPointW = Window.getClientWidth() / 2;
        int centralPointH = Window.getClientHeight() / 2;
        int newLeft = centralPointW - (width / 2);
        int newTop = centralPointH - (height / 2);

        getWidget().getElement().getStyle().setLeft(newLeft, Unit.PX);
        getWidget().getElement().getStyle().setTop(newTop, Unit.PX);
        // XLog.info("height: " + height + ", getOffsetHeight(): " +
        // getOffsetHeight());

        //         int top_ = height >= getOffsetHeight() ? 0 : (height / 2);
        //         int left_ = width >= getOffsetWidth() ? 0 : (width / 2);
        //
        //         s.setProperty("marginTop", "-" + top_ + "px");
        //         s.setProperty("marginLeft", "-" + left_ + "px");

    } else {

        if (top == null) {
            s.clearProperty("top");
        } else {
            s.setProperty("top", top);
        }

        if (right == null) {
            s.clearProperty("right");
        } else {
            s.setProperty("right", right);
        }

        if (bottom == null) {
            s.clearProperty("bottom");
        } else {
            s.setProperty("bottom", bottom);
        }

        if (left == null) {
            s.clearProperty("left");
        } else {
            s.setProperty("left", left);
        }

    }

}

From source file:com.gwtmobile.ui.client.page.Page.java

License:Apache License

private static void hideAddressBar() {
    int barHeight = Utils.isIOS() ? 60 : Utils.isAndroid() ? 1 : 0;
    if (barHeight > 0) {
        RootLayoutPanel.get().setHeight(Window.getClientHeight() + barHeight + "px");
    }/*  www  .  j a va  2 s. c  o m*/
}

From source file:com.gwtmodel.table.view.util.ModalDialog.java

License:Apache License

public void show(final WSize w, final SolidPos sPos) {

    // TODO: showRelativeTo seems not working properly
    // if (w.getW() != null) {
    // dBox.showRelativeTo(w.getW());
    // } else//from  w  w  w .j av  a 2  s  .  com
    dBox.setPopupPositionAndShow(new PopupPanel.PositionCallback() {

        @Override
        public void setPosition(int offsetWidth, int offsetHeight) {
            assert w != null : LogT.getT().cannotBeNull();
            int maxwi = Window.getClientWidth();
            int maxhei = Window.getClientHeight();
            int t = w.getTop() + w.getHeight();
            int l = w.getLeft();

            int left = MaxI.min(maxwi - offsetWidth, l);
            int top = MaxI.min(maxhei - offsetHeight, t);
            if (sPos.getStartl() != -1)
                top = sPos.getStartl();
            if (sPos.getStartcol() != -1)
                left = sPos.getStartcol();
            if (sPos.getMaxstartl() != -1 && top > sPos.getMaxstartl())
                top = sPos.getMaxstartl();
            if (sPos.getMaxstartcol() != -1 && left > sPos.getMaxstartcol())
                left = sPos.getMaxstartcol();

            if (top < 0)
                top = 0;
            dBox.setPopupPosition(left, top);
        }
    });
}

From source file:com.gwtplatform.mvp.client.view.CenterPopupPositioner.java

License:Apache License

/**
 * By default this method centers the popup vertically.
 * You can override this method to change the vertical position of the popup.
 * @param popupHeight//  w  w  w  . ja v a2 s .c o m
 * @return the top position of the popup.
 */
protected int getTop(int popupHeight) {
    return ((Window.getClientHeight() - popupHeight) / 2) + Window.getScrollTop();
}

From source file:com.gwtplatform.mvp.client.view.RelativeToWidgetPopupPositioner.java

License:Apache License

@Override
protected int getTop(int popupHeight) {
    int top = widget.getAbsoluteTop();

    int windowTop = Window.getScrollTop();
    int windowBottom = Window.getScrollTop() + Window.getClientHeight();

    int distanceFromWindowTop = top - windowTop;

    int distanceToWindowBottom = windowBottom - (top + widget.getOffsetHeight());

    if (distanceToWindowBottom < popupHeight && distanceFromWindowTop >= popupHeight) {
        top -= popupHeight;/* w  w w  .j a  va  2 s.c o  m*/
    } else {
        top += widget.getOffsetHeight();
    }
    return top;
}