Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.Style$HasCssName


        for (Slot slot : widgetToSlot.values()) {

            Element slotElement = slot.getElement();
            slotElement.removeAttribute("aria-hidden");

            Style slotStyle = slotElement.getStyle();
            slotStyle.clearVisibility();
            slotStyle.clearMarginLeft();
            slotStyle.clearMarginTop();

            if (slot.getExpandRatio() != 0) {
                // FIXME expandRatio might be <0
                double size = 100 * (slot.getExpandRatio() / total);

                if (vertical) {
                    slot.setHeight(size + "%");
                    if (slot.hasRelativeHeight()) {
                        Util.notifyParentOfSizeChange(this, true);
                    }
                } else {
                    slot.setWidth(size + "%");
                    if (slot.hasRelativeWidth()) {
                        Util.notifyParentOfSizeChange(this, true);
                    }
                }

            } else if (slot.isRelativeInDirection(vertical)) {
                // Relative child without expansion gets no space at all
                if (vertical) {
                    slot.setHeight("0");
                } else {
                    slot.setWidth("0");
                }
                slotStyle.setVisibility(Visibility.HIDDEN);
                slotElement.setAttribute("aria-hidden", "true");

            } else {
                // Non-relative child without expansion should be unconstrained
                if (BrowserInfo.get().isIE8()) {
                    // unconstrained in IE8 is auto
                    if (vertical) {
                        slot.setHeight("auto");
                    } else {
                        slot.setWidth("auto");
                    }
                } else {
                    if (vertical) {
                        slotStyle.clearHeight();
                    } else {
                        slotStyle.clearWidth();
                    }
                }
            }
        }
    }
View Full Code Here


        // Opera (12.14) has a bug where an audio element w/o controls is shown
        // as 150x300px, which is not usually desired. However, in order to show
        // the error/alt message, we only do this in the exact situation.
        if (BrowserInfo.get().isOpera()
                && stateChangeEvent.hasPropertyChanged("showControls")) {
            Style style = getWidget().getElement().getStyle();
            if (!getState().showControls) {
                if (isUndefinedHeight() && isUndefinedWidth()
                        && getWidget().getOffsetHeight() == 150
                        && getWidget().getOffsetWidth() == 300) {
                    // only if no size set and 150x300
                    style.setWidth(0, Unit.PX);
                    style.setHeight(0, Unit.PX);
                }
            } else {
                // clear sizes if it's supposed to be undefined
                if (isUndefinedHeight()) {
                    style.clearHeight();
                }
                if (isUndefinedWidth()) {
                    style.clearWidth();
                }
            }
        }
    }
View Full Code Here

                    created = true;
                    DOM.sinkEvents(el, Event.ONLOAD);
                }

                // Set attributes
                Style style = el.getStyle();
                style.setProperty("width", getState().width);
                style.setProperty("height", getState().height);

                DOM.setElementProperty(el, "src",
                        getWidget().getSrc(uidl, client));

                if (uidl.hasAttribute(EmbeddedConstants.ALTERNATE_TEXT)) {
View Full Code Here

        int top = layoutManager.getOuterHeight(panel.captionNode);
        int bottom = layoutManager.getInnerHeight(panel.bottomDecoration);
        Profiler.leave("PanelConnector.layout getHeights");

        Profiler.enter("PanelConnector.layout modify style");
        Style style = panel.getElement().getStyle();
        panel.captionNode.getParentElement().getStyle()
                .setMarginTop(-top, Unit.PX);
        panel.bottomDecoration.getStyle().setMarginBottom(-bottom, Unit.PX);
        style.setPaddingTop(top, Unit.PX);
        style.setPaddingBottom(bottom, Unit.PX);
        Profiler.leave("PanelConnector.layout modify style");

        // Update scroll positions
        Profiler.enter("PanelConnector.layout update scroll positions");
        panel.contentNode.setScrollTop(panel.scrollTop);
View Full Code Here

        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);
    }
View Full Code Here

     *            the element whose animation-duration to set
     * @param duration
     *            the duration as a valid CSS value
     */
    public static void setAnimationDuration(Element elem, String duration) {
        Style style = elem.getStyle();
        style.setProperty(ANIMATION_PROPERTY_NAME + "Duration", duration);
    }
View Full Code Here

     *            the element whose animation-delay to set
     * @param delay
     *            the delay as a valid CSS value
     */
    public static void setAnimationDelay(Element elem, String delay) {
        Style style = elem.getStyle();
        style.setProperty(ANIMATION_PROPERTY_NAME + "Delay", delay);
    }
View Full Code Here

     *
     * @param element
     *            The element that should be redrawn
     */
    public static void forceWebkitRedraw(Element element) {
        Style style = element.getStyle();
        String s = style.getProperty("webkitTransform");
        if (s == null || s.length() == 0) {
            style.setProperty("webkitTransform", "scale(1)");
        } else {
            style.setProperty("webkitTransform", "");
        }
    }
View Full Code Here

     * @param tempValue
     *            The temporary value
     */
    public static void setStyleTemporarily(Element element,
            final String styleProperty, String tempValue) {
        final Style style = element.getStyle();
        final String currentValue = style.getProperty(styleProperty);

        style.setProperty(styleProperty, tempValue);
        element.getOffsetWidth();
        style.setProperty(styleProperty, currentValue);

    }
View Full Code Here

    }

    static void highlight(ComponentConnector paintable) {
        if (paintable != null) {
            Widget w = paintable.getWidget();
            Style style = highlight.getStyle();
            style.setTop(w.getAbsoluteTop(), Unit.PX);
            style.setLeft(w.getAbsoluteLeft(), Unit.PX);
            style.setWidth(w.getOffsetWidth(), Unit.PX);
            style.setHeight(w.getOffsetHeight(), Unit.PX);
            RootPanel.getBodyElement().appendChild(highlight);
        }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.Style$HasCssName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.