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.allen_sauer.gwt.log.client.DivLogger.java

License:Apache License

private void ensureInitialized() {
    scrollPanel.checkMinSize();
    logDockPanel.resize(Window.getClientWidth(), Window.getClientHeight());
}

From source file:com.appspot.codsallarts.client.Application.java

License:Apache License

@Override
protected void onLoad() {
    super.onLoad();
    onWindowResized(Window.getClientWidth(), Window.getClientHeight());
}

From source file:com.apress.progwt.client.widget.datepicker.HDatePicker.java

License:Apache License

protected void showCalendar() {
    calendarPopup.show();/*ww  w.j a  va 2  s.c  o  m*/
    if (align == HorizontalPanel.ALIGN_RIGHT) {

        // getAbsoluteLeft() is broken in FF for things in our
        // gadgetDisplayer
        // seems to be a known problem, but no good fix. Even FireBug
        // says that the
        // left position is 450px, which is totally wrong.
        //
        // found native method below on forum, but it returns the same
        // thing
        //
        // int left = this.getAbsoluteLeft() - WIDTH;
        int left = Window.getClientWidth() - WIDTH;

        // make sure it doesn't go too low
        int top = this.getAbsoluteTop() + this.getOffsetHeight() + 4;
        top = (Window.getClientHeight() - top > 400) ? top : Window.getClientHeight() - 400;

        calendarPopup.setPopupPosition(left, top);
        Log.debug("SHOW RIGHT " + (this.getAbsoluteLeft() - WIDTH) + " "
                + (this.getAbsoluteTop() + this.getOffsetHeight() + 4));

        // Logger.log("SHOW RIGHT "+getAbsoluteLeft(getElement())+"
        // FIX "+getAbsoluteLeftFix(getElement()));

        calendarPopup.setHeight(120 + "px");
        calendarPopup.setWidth(165 + "px");
        calendarPopup.setStyleName("date_popupPanel");
    } else {
        calendarPopup.setPopupPosition(this.getAbsoluteLeft(),
                this.getAbsoluteTop() + this.getOffsetHeight() + 4);
        calendarPopup.setHeight(120 + "px");
        calendarPopup.setWidth(165 + "px");
        calendarPopup.setStyleName("date_popupPanel");
    }
}

From source file:com.arcbees.chosen.client.AbstractMobileChosenImpl.java

License:Apache License

@Override
protected void resultsHide() {
    super.resultsHide();

    if (getDropdown().hasClass(getCss().isOpen()) && getOptions().isMobileAnimation()) {
        final int windowHeight = Window.getClientHeight();
        int speed = getOptions().getMobileAnimationSpeed();

        getDropdown().css("top", "0").css("left", "0").css("right", "0")
                .animate("top: 1000px, left: 0, right: 0", speed * 2, new Function() {
                    public void f() {
                        getDropdown().css("bottom", "").css(isRTL() ? "left" : "right", "")
                                .css("top", windowHeight + 20 + "px")
                                .css(isRTL() ? "right" : "left", "-9000px");
                    }/*w ww . jav  a 2s .c o  m*/
                });
    } else {
        getDropdown().css("bottom", "").css(isRTL() ? "left" : "right", "");
    }

    getDropdown().removeClass(getCss().isOpen());
    getSearchField().blur();
}

From source file:com.arcbees.chosen.client.AbstractMobileChosenImpl.java

License:Apache License

@Override
void positionDropdownResult() {
    super.positionDropdownResult();

    if (getOptions().isMobileAnimation() && !getDropdown().hasClass(getCss().isOpen())) {
        int windowHeight = Window.getClientHeight();
        int speed = getOptions().getMobileAnimationSpeed();
        getDropdown().css("top", windowHeight + "px").css("bottom", "0").css(isRTL() ? "left" : "right", "0")
                .animate("top: 0px", speed * 2);
    } else {//from  w w  w . j av a  2  s. c o m
        getDropdown().css("bottom", "0").css(isRTL() ? "left" : "right", "0");
    }

    getDropdown().addClass(getCss().isOpen());
}

From source file:com.arcbees.chosen.client.ChosenImpl.java

License:Apache License

private int positionRelativeToWindow() {
    int ddHeight = dropdown.outerHeight();
    int spaceBelow = Window.getClientHeight() - container.offset().top - container.outerHeight();
    return spaceBelow < ddHeight ? positionAbove() : positionBelow();
}

From source file:com.arcbees.gquery.appear.client.Appear.java

License:Apache License

private static boolean isScrolledIntoView(Element e, AppearImpl impl) {
    int docViewTop = Window.getScrollTop();
    int docViewBottom = docViewTop + Window.getClientHeight();
    int docViewLeft = Window.getScrollLeft();
    int docViewRight = docViewLeft + Window.getClientWidth();

    AppearOffset offset = impl.getOptions().getOffset();
    int elemTop = e.getAbsoluteTop() + offset.getTop();
    int elemLeft = e.getAbsoluteLeft() + offset.getLeft();
    int elemBottom = elemTop + e.getOffsetHeight() - offset.getBottom();
    int elemRight = elemLeft + e.getOffsetWidth() - offset.getRight();

    boolean isVerticalVisible = elemTop >= docViewTop && elemBottom <= docViewBottom
            || elemTop <= docViewBottom && elemBottom > docViewBottom
            || elemBottom >= docViewTop && elemTop < docViewTop;

    boolean isHorizontalVisible = elemLeft >= docViewLeft && elemRight <= docViewRight
            || elemLeft <= docViewRight && elemRight > docViewRight
            || elemRight >= docViewLeft && elemLeft < docViewLeft;

    return isVerticalVisible && isHorizontalVisible;
}

From source file:com.arcbees.gquery.tooltip.client.TooltipImpl.java

License:Apache License

private TooltipPlacement ensureTooltipIsVisible(TooltipPlacement originalTooltipPlacement, OffsetInfo oi,
        long actualHeight, long actualWidth) {
    long bound;/* w  w  w.  j a va2 s. com*/

    switch (originalTooltipPlacement) {
    case TOP:
        bound = oi.top - actualHeight;

        if (bound < 0) {
            return TooltipPlacement.BOTTOM;
        }

        break;
    case BOTTOM:
        bound = oi.top + oi.height + actualHeight;

        if (bound > Window.getClientHeight()) {
            return TooltipPlacement.TOP;
        }

        break;
    case LEFT:
        bound = oi.left - actualWidth;

        if (bound < 0) {
            return TooltipPlacement.RIGHT;
        }

        break;
    case RIGHT:
        bound = oi.left + oi.width;

        if (bound > Window.getClientWidth()) {
            return TooltipPlacement.LEFT;
        }

        break;
    default:
        throw new RuntimeException("unknown or null TooltipPlacement");
    }

    return originalTooltipPlacement;
}

From source file:com.arcbees.website.client.application.error.NotFoundView.java

License:Apache License

private GQuery updateHeight() {
    return $(error).height(Window.getClientHeight() - $("footer").height());
}

From source file:com.audata.client.admin.NewHierarchy.java

License:Open Source License

/**
 * Overide parent show() to integrate effects
 *///from  w  w  w .j a v  a  2  s  . co  m
public void show() {
    this.setVisible(false);
    super.show();
    Effect.appear(this);
    int left = (Window.getClientWidth() / 2) - 150;
    int top = (Window.getClientHeight() / 2) - 50;
    this.setPopupPosition(left, top);
}