Example usage for com.google.gwt.dom.client Style setBottom

List of usage examples for com.google.gwt.dom.client Style setBottom

Introduction

In this page you can find the example usage for com.google.gwt.dom.client Style setBottom.

Prototype

public void setBottom(double value, Unit unit) 

Source Link

Usage

From source file:burrito.client.widgets.form.EditForm.java

License:Apache License

public void makeButtonsStick(boolean stick) {
    getElement().getStyle().setPropertyPx("minHeight", getOffsetHeight());
    Style style = buttonWrapper.getElement().getStyle();
    buttonWrapper.addStyleName("k5-EditForm-fixedButtons");
    if (stick) {/* ww w.  j  av  a  2  s.  co  m*/
        style.setPosition(Position.FIXED);
        style.setBottom(0, Unit.PX);
        style.setLeft(getAbsoluteLeft(), Unit.PX);
        style.setWidth(getOffsetWidth(), Unit.PX);
    } else {
        style.clearPosition();
        style.clearBottom();
        style.clearLeft();
        style.clearWidth();
    }

}

From source file:com.google.walkaround.wave.client.Walkaround.java

License:Open Source License

/** Reveals the log div, and executes a task when done. */
// The async API for this method is intended to support two things: a cool
// spew animation, and also the potential to runAsync the whole LogPanel code.
private static void attachLogPanel() {
    Logs.get().addHandler(domLogger);//  w w w.j a  v  a 2s  .co  m
    final Panel logHolder = RootPanel.get("logHolder");
    logHolder.setVisible(true);

    // Need one layout and paint cycle after revealing it to start animation.
    // Use high priority to avoid potential starvation by other tasks if a
    // problem is occurring.
    SchedulerInstance.getHighPriorityTimer().scheduleDelayed(new Task() {
        @Override
        public void execute() {
            logHolder.add(domLogger);
            Style waveStyle = Document.get().getElementById(WAVEPANEL_PLACEHOLDER).getStyle();
            Style logStyle = logHolder.getElement().getStyle();
            logStyle.setHeight(250, Unit.PX);
            waveStyle.setBottom(250, Unit.PX);
        }
    }, 50);
}

From source file:com.moesol.gwt.maps.client.TiledImageLayer.java

License:Open Source License

private void positionOneImage(ViewBox vb, TileCoords tileCoords) {
    if (tileCoords == null) {
        return;/*from  w w w .j  av  a  2 s . c  o  m*/
    }
    ImageDiv image = (ImageDiv) m_tileImageMgr.findOrCreateImage(vb, tileCoords);
    setImageZIndex(image, m_layerSet.getZIndex());
    int x = tileCoords.getOffsetX();
    int y = tileCoords.getOffsetY();
    int width = tileCoords.getTileWidth();
    int height = tileCoords.getTileHeight();
    BoxBounds b = m_divWorker.computePercentBounds(x, y, width, height);

    Style imageStyle = image.getElement().getStyle();
    imageStyle.setLeft(b.left, Unit.PCT);
    imageStyle.setRight(100 - b.right, Unit.PCT);
    imageStyle.setTop(b.top, Unit.PCT);
    imageStyle.setBottom(100 - b.bottom, Unit.PCT);
}

From source file:com.smartgwt.mobile.client.widgets.Canvas.java

License:Open Source License

@SGWTInternal
protected static void _hideAddressBarNow() {
    // In iOS 7, the scrollTo() hack to hide the address bar does not work anymore.
    // http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review
    // We still run some code in _maybeHideAddressBar() on iPad, however, to work around
    // the issue that 20px is cut off from the top or bottom in landscape mode.
    // Also, on iPhone running in a UIWebView, we need to move up the RootLayoutPanel's
    // bottom coord.
    final Style rootLayoutPanelElementStyle = RootLayoutPanel.get().getElement().getStyle();
    if (IMPL.isIOSMin7_0()) {
        if (!Canvas.isUIWebView()) {
            // Work around an issue with iOS 7 Mobile Safari on an iPad in landscape mode.
            // http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue
            // http://stackoverflow.com/questions/18855642/ios-7-css-html-height-100-692px
            if (Canvas.isIPad()) {
                if (Page.getOrientation() == PageOrientation.LANDSCAPE) {
                    rootLayoutPanelElementStyle.setHeight(Window.getClientHeight() - 20, Style.Unit.PX);
                } else {
                    rootLayoutPanelElementStyle.setHeight(100, Style.Unit.PCT);
                }/*from  w  w  w .ja v a  2  s .  c o  m*/

                // On iPhone running iOS 7.1 using the 'minimal-ui' viewport parameter, the top 20 CSS pixels
                // in landscape mode should not be used because tapping within this area causes the browser
                // chrome to be revealed: http://www.mobilexweb.com/blog/ios-7-1-safari-minimal-ui-bugs
            } else if (Canvas.isIPhone() && IMPL.isIOSMin7_1()) {
                if (Page.getOrientation() == PageOrientation.LANDSCAPE) {
                    rootLayoutPanelElementStyle.clearHeight();
                    rootLayoutPanelElementStyle.setTop(20, Style.Unit.PX);
                } else {
                    rootLayoutPanelElementStyle.setHeight(100, Style.Unit.PCT);
                    rootLayoutPanelElementStyle.setTop(0, Style.Unit.PX);
                }
            }

            // Since, when running in a UIWebView, the device-width/device-height
            // includes the height of the status bar, set the bottom of the RootLayoutPanel's
            // element to 20px (the standard height of the status bar).
        } else if (Canvas.isUIWebView()) {
            rootLayoutPanelElementStyle.clearHeight();
            rootLayoutPanelElementStyle.setBottom(20.0, Style.Unit.PX);
        }

        Window.scrollTo(0, 0);
    } else if (isIPhone() && !isStandAlone() && !isUIWebView()) {
        rootLayoutPanelElementStyle.setHeight(Window.getClientHeight() + 100 - 40, Style.Unit.PX);
        Window.scrollTo(0, 0);
    } else {
        rootLayoutPanelElementStyle.setHeight(Window.getClientHeight(), Style.Unit.PX);
    }
}

From source file:com.vaadin.client.metadata.ConnectorBundleLoader.java

License:Apache License

private void notice(String productName) {
    if (notice == null) {
        notice = new HTML();
        notice.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                notice.removeFromParent();
            }/*from w  ww  . j  a v a2s.co  m*/
        });
        notice.addTouchStartHandler(new TouchStartHandler() {
            public void onTouchStart(TouchStartEvent event) {
                notice.removeFromParent();
            }
        });
    }
    String msg = notice.getText().trim();
    msg += msg.isEmpty() ? "Using Evaluation License of: " : ", ";
    notice.setText(msg + productName);
    RootPanel.get().add(notice);

    notice.getElement().setClassName("");
    Style s = notice.getElement().getStyle();

    s.setPosition(Position.FIXED);
    s.setTextAlign(TextAlign.CENTER);
    s.setRight(0, Unit.PX);
    s.setLeft(0, Unit.PX);
    s.setBottom(0, Unit.PX);
    s.setProperty("padding", "0.5em 1em");

    s.setProperty("font-family", "sans-serif");
    s.setFontSize(12, Unit.PX);
    s.setLineHeight(1.1, Unit.EM);

    s.setColor("white");
    s.setBackgroundColor("black");
    s.setOpacity(0.7);

    s.setZIndex(2147483646);
    s.setProperty("top", "auto");
    s.setProperty("width", "auto");
    s.setDisplay(Display.BLOCK);
    s.setWhiteSpace(WhiteSpace.NORMAL);
    s.setVisibility(Visibility.VISIBLE);
    s.setMargin(0, Unit.PX);
}

From source file:fr.putnami.pwt.core.widget.client.Affix.java

License:Open Source License

protected void toggleAffix(Affixed affix) {
    Element e = this.getElement();
    Style style = e.getStyle();

    if (this.affixed != affix) {
        this.clearElementStyle();
        this.affixed = affix;
        StyleUtils.addStyle(e, this.affixed);
    }/*  w  ww  .  j  a  va 2  s .c o m*/

    switch (affix) {
    case AFFIX:
        style.setTop(this.offsetTop, Unit.PX);
        style.setWidth(this.offsetWidth, Unit.PX);
        style.setHeight(this.offsetHeight, Unit.PX);
        style.setZIndex(this.layerIndex);
        e.getParentElement().getStyle().setPaddingTop(this.offsetHeight, Unit.PX);
        break;
    case BOTTOM:
        int docHeigth = Document.get().getScrollHeight();
        int scrollTop = Window.getScrollTop();

        int bottom = this.offsetBottom - (docHeigth - scrollTop - this.clientHeigth);
        if (this.fixBottom != Integer.MIN_VALUE) {
            bottom = Math.max(bottom, this.fixBottom);
        }
        style.setPosition(Position.FIXED);
        style.setBottom(bottom, Unit.PX);
        style.setWidth(this.offsetWidth, Unit.PX);
        style.setHeight(this.offsetHeight, Unit.PX);
        style.setZIndex(this.layerIndex);
        break;
    default:
        break;
    }
}

From source file:geogebra.web.gui.app.docklayout.LayoutImpl.java

License:Apache License

public void fillParent(Element elem) {
    Style style = elem.getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setLeft(0, PX);//from  ww  w  . j a va  2s  . c  o  m
    style.setTop(0, PX);
    style.setRight(0, PX);
    style.setBottom(0, PX);
}

From source file:geogebra.web.gui.app.docklayout.LayoutImpl.java

License:Apache License

public void layout(Layer layer) {
    Style style = layer.container.getStyle();

    if (layer.visible) {
        style.clearDisplay();/*from   ww w .  ja  va  2  s .  c o  m*/
    } else {
        style.setDisplay(Display.NONE);
    }

    style.setProperty("left", layer.setLeft ? (layer.left + layer.leftUnit.getType()) : "");
    style.setProperty("top", layer.setTop ? (layer.top + layer.topUnit.getType()) : "");
    style.setProperty("right", layer.setRight ? (layer.right + layer.rightUnit.getType()) : "");
    style.setProperty("bottom", layer.setBottom ? (layer.bottom + layer.bottomUnit.getType()) : "");
    style.setProperty("width", layer.setWidth ? (layer.width + layer.widthUnit.getType()) : "");
    style.setProperty("height", layer.setHeight ? (layer.height + layer.heightUnit.getType()) : "");

    style = layer.child.getStyle();
    switch (layer.hPos) {
    case BEGIN:
        style.setLeft(0, Unit.PX);
        style.clearRight();
        break;
    case END:
        style.clearLeft();
        style.setRight(0, Unit.PX);
        break;
    case STRETCH:
        style.setLeft(0, Unit.PX);
        style.setRight(0, Unit.PX);
        break;
    }

    switch (layer.vPos) {
    case BEGIN:
        style.setTop(0, Unit.PX);
        style.clearBottom();
        break;
    case END:
        style.clearTop();
        style.setBottom(0, Unit.PX);
        break;
    case STRETCH:
        style.setTop(0, Unit.PX);
        style.setBottom(0, Unit.PX);
        break;
    }
}

From source file:next.i.controller.Utils.java

License:Apache License

static void fillParent(Element elem) {
    Style style = elem.getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setLeft(0, PX);//from   w  w  w. ja va 2 s. c  om
    style.setTop(0, PX);
    style.setRight(0, PX);
    style.setBottom(0, PX);
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);
}

From source file:org.gwtbootstrap3.extras.gallery.client.ui.GalleryImage.java

License:Apache License

@Override
public void add(final Widget child) {
    if (child instanceof Image) {
        if (image != null) {
            image.removeFromParent();//from   w ww. ja  v  a  2s . c o  m
        }

        image = (Image) child;
        setHref(image.getUrl());

        super.add(image);
    } else if (child instanceof HasClickHandlers) {
        ((HasClickHandlers) child).addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                event.stopPropagation();
            }
        });

        Scheduler.get().scheduleDeferred(new Command() {
            @Override
            public void execute() {
                Style style = child.getElement().getStyle();
                style.setPosition(Position.RELATIVE);
                style.setBottom((double) image.getHeight(), Unit.PX);
                style.setLeft(4, Unit.PX);
            }
        });

        super.add(child);
    } else {
        super.add(child);
    }
}