Refine search
/** * Convenience method to set the height of an element. * * @param elem the element * @param height a CSS length value for the height */ static final void setHeight(Element elem, String height) { elem.getStyle().setProperty("height", height); }
public void adjust(Element img, SafeUri url, int left, int top, int width, int height) { String style = "url(\"" + url.asString() + "\") no-repeat " + (-left + "px ") + (-top + "px"); img.getStyle().setProperty("background", style); img.getStyle().setPropertyPx("width", width); img.getStyle().setPropertyPx("height", height); }
/** * Convenience method to set the right offset of an element. * * @param elem the element * @param right a CSS length value for right */ static final void setRight(Element elem, String right) { elem.getStyle().setProperty("right", right); }
/** * @param popup the popup * @param rect the clip rect */ public void setClip(Element popup, String rect) { popup.getStyle().setProperty("clip", rect); } }
/** * Changes a DOM element's positioning to static. * * @param elem the DOM element */ private static void changeToStaticPositioning(Element elem) { elem.getStyle().setProperty("left", ""); elem.getStyle().setProperty("top", ""); elem.getStyle().setProperty("position", ""); }
/** * Adds clipping to an element. * * @param elem the element */ static final void addClipping(final Element elem) { elem.getStyle().setProperty("overflow", "hidden"); }
/** * Adds as-needed scrolling to an element. * * @param elem the element */ static final void addScrolling(final Element elem) { elem.getStyle().setProperty("overflow", "auto"); }
/** * Convenience method to set the top offset of an element. * * @param elem the element * @param top a CSS length value for top */ static final void setTop(Element elem, String top) { elem.getStyle().setProperty("top", top); }
/** * Convenience method to set the left offset of an element. * * @param elem the element * @param left a CSS length value for left */ static final void setLeft(Element elem, String left) { elem.getStyle().setProperty("left", left); }
/** * Sets an elements positioning to absolute. * * @param elem the element */ static void addAbsolutePositoning(Element elem) { elem.getStyle().setProperty("position", "absolute"); }
/** * Convenience method to set bottom offset of an element. * * @param elem the element * @param size a CSS length value for bottom */ static void setBottom(Element elem, String size) { elem.getStyle().setProperty("bottom", size); }
/** * Convenience method to set the width of an element. * * @param elem the element * @param width a CSS length value for the width */ static final void setWidth(Element elem, String width) { elem.getStyle().setProperty("width", width); }
/** * Setup the container around the widget. */ private Element createWidgetContainer() { Element container = DOM.createDiv(); container.getStyle().setProperty("width", "100%"); container.getStyle().setProperty("height", "0px"); container.getStyle().setProperty("padding", "0px"); container.getStyle().setProperty("margin", "0px"); return container; }
/** * Sets an integer attribute on the given element's style. * * @param elem the element whose style attribute is to be set * @param attr the name of the style attribute to be set * @param value the style attribute's new integer value */ public static void setIntStyleAttribute(Element elem, String attr, int value) { elem.getStyle().setProperty(attr, Integer.toString(value)); }
/** * Sets an attribute on the given element's style. * * @param elem the element whose style attribute is to be set * @param attr the name of the style attribute to be set * @param value the style attribute's new value * @deprecated Use {@link Element#getStyle()} and * {@link Style#setProperty(String, String)} instead. */ @Deprecated public static void setStyleAttribute(Element elem, String attr, String value) { elem.getStyle().setProperty(attr, value); }
private static void expandToFitParentHorizontally(Element elem) { addAbsolutePositoning(elem); elem.getStyle().setProperty("left", "0"); elem.getStyle().setProperty("right", "0"); }
protected void setWidgetPositionImpl(Widget w, int left, int top) { Element h = w.getElement(); if (left == -1 && top == -1) { changeToStaticPositioning(h); } else { h.getStyle().setProperty("position", "absolute"); h.getStyle().setProperty("left", left + "px"); h.getStyle().setProperty("top", top + "px"); } }
@Override protected void onUpdate(double progress) { int height = (int) (progress * scrollHeight); if (!opening) { height = scrollHeight - height; } // Issue 2338: If the height is 0px, IE7 will display all of the children // instead of hiding them completely. height = Math.max(height, 1); curItem.childSpanElem.getStyle().setProperty("height", height + "px"); // We need to set the width explicitly of the item might be cropped int scrollWidth = curItem.childSpanElem.getPropertyInt("scrollWidth"); curItem.childSpanElem.getStyle().setProperty("width", scrollWidth + "px"); } }
@Override public void setCellWidth(Widget w, String width) { LayoutData data = (LayoutData) w.getLayoutData(); data.width = width; if (data.td != null) { data.td.getStyle().setProperty("width", data.width); } }
@Override public void setCellHeight(Widget w, String height) { LayoutData data = (LayoutData) w.getLayoutData(); data.height = height; if (data.td != null) { data.td.getStyle().setProperty("height", data.height); } }