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

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

Introduction

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

Prototype

public void clearPosition() 

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) {//from w  w  w. j a  va  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.alkacon.acacia.client.ui.AttributeValueView.java

License:Open Source License

/**
 * Removes the drag helper styles from the given element.<p>
 * //from   www .j  av  a 2 s .c  o  m
 * @param helper the helper element
 */
private void removeDragHelperStyles(Element helper) {

    Style style = helper.getStyle();
    style.clearTop();
    style.clearLeft();
    style.clearPosition();
    style.clearWidth();
    helper.removeClassName(formCss().dragHelper());
}

From source file:com.dianaui.universal.core.client.ui.DateTimePicker.java

License:Apache License

@Override
public void setVisible(final boolean visible) {
    Style style = container.getElement().getStyle();

    if (visible) {
        style.setDisplay(Style.Display.BLOCK);
        style.setZIndex(9999);/*ww w  .jav  a  2 s  .c o m*/
        style.setPosition(Style.Position.ABSOLUTE);
        style.setProperty("right", "auto");
    } else {
        super.setVisible(false);

        style.clearDisplay();
        style.clearZIndex();
        style.clearPosition();
        style.clearTop();
        style.clearLeft();
    }
}

From source file:com.smartgwt.mobile.client.widgets.layout.NavigationBar.java

License:Open Source License

@SGWTInternal
public void _unfixPosition() {
    assert Canvas._getFixNavigationBarPositionDuringKeyboardFocus();
    isPositionFixed = false;/*from   w ww .  j a v  a2  s.co  m*/
    if (mockScrollTimer != null) {
        mockScrollTimer.cancel();
        mockScrollTimer = null;
    }
    if (unfixPositionTimer != null) {
        unfixPositionTimer.cancel();
        unfixPositionTimer = null;
    }
    final Element elem = getElement();
    final Style elemStyle = elem.getStyle();
    elemStyle.clearPosition();
    elemStyle.clearProperty(DOMConstants.INSTANCE.getTransitionShorthandPropertyName());
    elemStyle.clearProperty(DOMConstants.INSTANCE.getTransformPropertyName());
}

From source file:com.vaadin.client.ui.ui.UIConnector.java

License:Apache License

protected void onChildSizeChange() {
    ComponentConnector child = getContent();
    if (child == null) {
        return;//from  w  w  w .  j a  va  2  s.  c om
    }
    Style childStyle = child.getWidget().getElement().getStyle();
    /*
     * Must set absolute position if the child has relative height and
     * there's a chance of horizontal scrolling as some browsers will
     * otherwise not take the scrollbar into account when calculating the
     * height. Assuming v-ui does not have an undefined width for now, see
     * #8460.
     */
    if (child.isRelativeHeight() && !BrowserInfo.get().isIE9()) {
        childStyle.setPosition(Position.ABSOLUTE);
    } else {
        childStyle.clearPosition();
    }
}

From source file:com.vaadin.client.ui.VGridLayout.java

License:Apache License

@Override
public boolean remove(Widget w) {
    boolean removed = super.remove(w);
    if (removed) {
        Cell cell = widgetToCell.remove(w);
        if (cell != null) {
            cell.slot.setCaption(null);/*w  ww  .j  a v a2  s .  c o  m*/
            cell.slot.getWrapperElement().removeFromParent();
            cell.slot = null;
            Style style = w.getElement().getStyle();
            style.clearTop();
            style.clearLeft();
            style.clearPosition();

            if (cells.length < cell.col && cells.length != 0 && cells[0].length < cell.row
                    && cells[cell.col][cell.row] == cell) {
                cells[cell.col][cell.row] = null;
            }
        }
    }
    return removed;
}

From source file:com.vaadin.client.ui.window.WindowConnector.java

License:Apache License

@Override
public void layout() {
    LayoutManager lm = getLayoutManager();
    VWindow window = getWidget();//from  w  ww.ja  v  a  2 s. com
    ComponentConnector content = getContent();
    boolean hasContent = (content != null);
    Element contentElement = window.contentPanel.getElement();

    Style contentStyle = window.contents.getStyle();

    int headerHeight = lm.getOuterHeight(window.header);
    contentStyle.setPaddingTop(headerHeight, Unit.PX);
    contentStyle.setMarginTop(-headerHeight, Unit.PX);

    int footerHeight = lm.getOuterHeight(window.footer);
    contentStyle.setPaddingBottom(footerHeight, Unit.PX);
    contentStyle.setMarginBottom(-footerHeight, Unit.PX);

    int minWidth = lm.getOuterWidth(window.header) - lm.getInnerWidth(window.header);
    int minHeight = footerHeight + headerHeight;

    getWidget().getElement().getStyle().setPropertyPx("minWidth", minWidth);
    getWidget().getElement().getStyle().setPropertyPx("minHeight", minHeight);

    /*
     * Must set absolute position if the child has relative height and
     * there's a chance of horizontal scrolling as some browsers will
     * otherwise not take the scrollbar into account when calculating the
     * height.
     */
    if (hasContent) {
        Element layoutElement = content.getWidget().getElement();
        Style childStyle = layoutElement.getStyle();

        // IE8 needs some hackery to measure its content correctly
        WidgetUtil.forceIE8Redraw(layoutElement);

        if (content.isRelativeHeight() && !BrowserInfo.get().isIE9()) {
            childStyle.setPosition(Position.ABSOLUTE);

            Style wrapperStyle = contentElement.getStyle();
            if (window.getElement().getStyle().getWidth().length() == 0 && !content.isRelativeWidth()) {
                /*
                 * Need to lock width to make undefined width work even with
                 * absolute positioning
                 */
                int contentWidth = lm.getOuterWidth(layoutElement);
                wrapperStyle.setWidth(contentWidth, Unit.PX);
            } else {
                wrapperStyle.clearWidth();
            }
        } else {
            childStyle.clearPosition();
        }
    }

}

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

License:Open Source License

private void clearElementStyle() {
    Element e = this.getElement();
    Style style = e.getStyle();

    style.clearPosition();
    style.clearTop();//from   ww w  .jav  a 2s .c o  m
    style.clearBottom();
    style.clearWidth();
    style.clearHeight();
    style.clearZIndex();
    e.getParentElement().getStyle().clearPaddingTop();
}

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

License:Apache License

public void removeChild(Element container, Element child) {
    container.removeFromParent();/*from   w  w  w  . ja  va2s . c  om*/

    // We want this code to be resilient to the child having already been
    // removed from its container (perhaps by widget code).
    if (child.getParentElement() == container) {
        child.removeFromParent();
    }

    // Cleanup child styles set by fillParent().
    Style style = child.getStyle();
    style.clearPosition();
    style.clearLeft();
    style.clearTop();
    style.clearWidth();
    style.clearHeight();
}

From source file:info.magnolia.ui.vaadin.gwt.client.richtext.TextAreaStretcherConnector.java

License:Open Source License

private void clearTraces() {
    Style style = textWidget.getElement().getStyle();
    style.clearLeft();/*from  w w w.  j  a v  a 2  s .c  o  m*/
    style.clearTop();
    style.clearPosition();
    style.clearZIndex();

    stretchControl.getStyle().clearTop();
    stretchControl.getStyle().clearLeft();

    JQueryWrapper.select("." + STRETCHER_BASE).setCss("display", "");
}