Package com.google.gwt.dom.client

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


        for (ComponentConnector child : getChildComponents()) {
            if (!getState().childCss.containsKey(child)) {
                continue;
            }
            String css = getState().childCss.get(child);
            Style style = child.getWidget().getElement().getStyle();
            // should we remove styles also? How can we know what we have added
            // as it is added directly to the child component?
            String[] cssRules = css.split(";");
            for (String cssRule : cssRules) {
                String parts[] = cssRule.split(":");
                if (parts.length == 2) {
                    style.setProperty(makeCamelCase(parts[0].trim()),
                            parts[1].trim());
                }
            }
        }
View Full Code Here


            if (scrollHandler != null) {
                scrollHandler.onScroll(null);
            }
        } else {
            for (Element el : layers) {
                Style style = el.getStyle();
                style.setProperty("webkitTransform", "translate3d(0,0,0)");
            }
            scrolledElement.setScrollTop(finalScrollTop);
        }
        activeScrollDelegate = null;
        handlerRegistration.removeHandler();
View Full Code Here

     * Note positive scrolltop moves layer up, positive translate moves layer
     * down.
     */
    private void translateTo(double translateY) {
        for (Element el : layers) {
            Style style = el.getStyle();
            style.setProperty("webkitTransform", "translate3d(0px,"
                    + translateY + "px,0px)");
        }
    }
View Full Code Here

    @Deprecated
    public void updateCaptionOffset(com.google.gwt.user.client.Element caption) {

        Element captionWrap = caption.getParentElement();

        Style captionWrapStyle = captionWrap.getStyle();
        captionWrapStyle.clearPaddingTop();
        captionWrapStyle.clearPaddingRight();
        captionWrapStyle.clearPaddingBottom();
        captionWrapStyle.clearPaddingLeft();

        Style captionStyle = caption.getStyle();
        captionStyle.clearMarginTop();
        captionStyle.clearMarginRight();
        captionStyle.clearMarginBottom();
        captionStyle.clearMarginLeft();

        // Get caption position from the classname
        CaptionPosition captionPosition = getCaptionPositionFromElement(captionWrap);

        if (captionPosition == CaptionPosition.LEFT
                || captionPosition == CaptionPosition.RIGHT) {
            int captionWidth;
            if (layoutManager != null) {
                captionWidth = layoutManager.getOuterWidth(caption)
                        - layoutManager.getMarginWidth(caption);
            } else {
                captionWidth = caption.getOffsetWidth();
            }
            if (captionWidth > 0) {
                if (captionPosition == CaptionPosition.LEFT) {
                    captionWrapStyle.setPaddingLeft(captionWidth, Unit.PX);
                    captionStyle.setMarginLeft(-captionWidth, Unit.PX);
                } else {
                    captionWrapStyle.setPaddingRight(captionWidth, Unit.PX);
                    captionStyle.setMarginRight(-captionWidth, Unit.PX);
                }
            }
        }
        if (captionPosition == CaptionPosition.TOP
                || captionPosition == CaptionPosition.BOTTOM) {
            int captionHeight;
            if (layoutManager != null) {
                captionHeight = layoutManager.getOuterHeight(caption)
                        - layoutManager.getMarginHeight(caption);
            } else {
                captionHeight = caption.getOffsetHeight();
            }
            if (captionHeight > 0) {
                if (captionPosition == CaptionPosition.TOP) {
                    captionWrapStyle.setPaddingTop(captionHeight, Unit.PX);
                    captionStyle.setMarginTop(-captionHeight, Unit.PX);
                } else {
                    captionWrapStyle.setPaddingBottom(captionHeight, Unit.PX);
                    captionStyle.setMarginBottom(-captionHeight, Unit.PX);
                }
            }
        }
    }
View Full Code Here

                }
                Profiler.enter("Overflow fix apply");

                Element parentElement = componentConnector.getWidget()
                        .getElement().getParentElement();
                Style style = parentElement.getStyle();
                String originalOverflow = style.getOverflow();

                if (originalOverflow != null
                        && !originalOverflows.containsKey(parentElement)) {
                    // Store original value for restore, but only the first time
                    // the value is changed
                    originalOverflows.put(parentElement, originalOverflow);
                }

                style.setOverflow(Overflow.HIDDEN);
                Profiler.leave("Overflow fix apply");
            }

            pendingOverflowFixes.removeAll(delayedOverflowFixes);
View Full Code Here

                // multiple downloads at once
                iframe.removeFromParent();
            }
            iframe = Document.get().createIFrameElement();

            Style style = iframe.getStyle();
            style.setVisibility(Visibility.HIDDEN);
            style.setHeight(0, Unit.PX);
            style.setWidth(0, Unit.PX);

            iframe.setFrameBorder(0);
            iframe.setTabIndex(-1);
            iframe.setSrc(url);
            RootPanel.getBodyElement().appendChild(iframe);
View Full Code Here

                 * exact size as in Vaadin 6.x, but we get here before
                 * MeasuredSize has been initialized.
                 * Util.measureHorizontalPaddingAndBorder does not work with
                 * border-box, so we must do this the hard way.
                 */
                Style style = getElement().getStyle();
                String originalPadding = style.getPadding();
                String originalBorder = style.getBorderWidth();
                style.setPaddingLeft(0, Unit.PX);
                style.setBorderWidth(0, Unit.PX);
                style.setProperty("padding", originalPadding);
                style.setProperty("borderWidth", originalBorder);

                // Use util.getRequiredWidth instead of getOffsetWidth here

                int iconWidth = selectedItemIcon == null ? 0 : Util
                        .getRequiredWidth(selectedItemIcon);
View Full Code Here

            if (highlights == null) {
                highlights = new HashSet<Element>();
            }

            Element highlight = DOM.createDiv();
            Style style = highlight.getStyle();
            style.setTop(element.getAbsoluteTop(), Unit.PX);
            style.setLeft(element.getAbsoluteLeft(), Unit.PX);
            int width = element.getOffsetWidth();
            if (width < MIN_WIDTH) {
                width = MIN_WIDTH;
            }
            style.setWidth(width, Unit.PX);
            int height = element.getOffsetHeight();
            if (height < MIN_HEIGHT) {
                height = MIN_HEIGHT;
            }
            style.setHeight(height, Unit.PX);
            RootPanel.getBodyElement().appendChild(highlight);

            style.setPosition(Position.ABSOLUTE);
            style.setZIndex(VWindow.Z_INDEX + 1000);
            style.setBackgroundColor(color);
            style.setOpacity(DEFAULT_OPACITY);
            if (BrowserInfo.get().isIE()) {
                style.setProperty("filter", "alpha(opacity="
                        + (DEFAULT_OPACITY * 100) + ")");
            }

            highlights.add(highlight);

View Full Code Here

    public VGridLayout() {
        super();
        setElement(Document.get().createDivElement());

        spacingMeasureElement = Document.get().createDivElement();
        Style spacingStyle = spacingMeasureElement.getStyle();
        spacingStyle.setPosition(Position.ABSOLUTE);
        getElement().appendChild(spacingMeasureElement);

        setStyleName(CLASSNAME);
        addStyleName(StyleConstants.UI_LAYOUT);
    }
View Full Code Here

            public void onClick(ClickEvent event) {
                close();
            }
        });

        Style s = content.getElement().getStyle();
        s.setOverflow(Overflow.AUTO);

        // move/resize
        final MouseHandler mouseHandler = new MouseHandler();
        mouseDownHandler = this.addDomHandler(mouseHandler,
                MouseDownEvent.getType());
View Full Code Here

TOP

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

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.