/** * Sets the elements css class name. * * @param elem the element * @param className the class name */ static final void setClassname(final Element elem, final String className) { elem.setPropertyString("className", className); }
@Override public void onDetach() { panel.container.setPropertyString("onresize", null); }
/** * Sets the width of the table's border. This border is displayed around all * cells in the table. * * @param width the width of the border, in pixels */ public void setBorderWidth(int width) { tableElem.setPropertyString("border", "" + width); }
/** * Sets the width of the border to be applied to all cells in this panel. This * is particularly useful when debugging layouts, in that it allows you to see * explicitly the cells that contain this panel's children. * * @param width the width of the panel's cell borders, in pixels */ public void setBorderWidth(int width) { table.setPropertyString("border", "" + width); }
public void setText(String text) { elem.setPropertyString("value", text); }
/** * Sets a property on the given element. * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value * @deprecated Use {@link Element#setPropertyString(String, String)} instead. */ @Deprecated public static void setElementProperty(Element elem, String prop, String value) { elem.setPropertyString(prop, value); }
/** * Sets a property on the given element. * * @param elem the element whose property is to be set * @param attr the name of the property to be set * @param value the new property value * @deprecated Use the more appropriately named * {@link Element#setPropertyString(String, String)} instead. */ @Deprecated public static void setAttribute(Element elem, String attr, String value) { elem.setPropertyString(attr, value); }
/** * Sets the width of the specified column. * * @param column the column of the cell whose width is to be set * @param width the cell's new width, in percentage or pixel units * @throws IndexOutOfBoundsException */ public void setWidth(int column, String width) { ensureColumn(column).setPropertyString("width", width); }
@Override public Element createElement() { Element elem = super.createElement(); elem.setPropertyString("src", "about:blank"); return elem; }
/** * Sets the height of the cell associated with the given widget, related to * the panel as a whole. * * @param w the widget whose cell height is to be set * @param height the cell's height, in CSS units */ public void setCellHeight(Widget w, String height) { Element td = getWidgetTd(w); if (td != null) { td.setPropertyString("height", height); } }
public void setHTML(@IsSafeHtml String html) { elem.setPropertyString("value", html); }
/** * Sets the width of the cell associated with the given widget, related to the * panel as a whole. * * @param w the widget whose cell width is to be set * @param width the cell's width, in CSS units */ public void setCellWidth(Widget w, String width) { Element td = getWidgetTd(w); if (td != null) { td.setPropertyString("width", width); } }
/** * Sets the height of the specified cell. * * @param row the row of the cell whose height is to be set * @param column the column of the cell whose height is to be set * @param height the cell's new height, in CSS units * @throws IndexOutOfBoundsException */ public void setHeight(int row, int column, String height) { prepareCell(row, column); Element elem = getCellElement(bodyElem, row, column); elem.setPropertyString("height", height); }
/** * Sets the width of the specified cell. * * @param row the row of the cell whose width is to be set * @param column the column of the cell whose width is to be set * @param width the cell's new width, in CSS units * @throws IndexOutOfBoundsException */ public void setWidth(int row, int column, String width) { // Give the subclass a chance to prepare the cell. prepareCell(row, column); getCellElement(bodyElem, row, column).setPropertyString("width", width); }
/** * Sets the history token referenced by this hyperlink. This is the history * token that will be passed to {@link History#newItem} when this link is * clicked. * * @param targetHistoryToken the new history token, which may not be null (use * {@link Anchor} instead if you don't need history processing) */ @SuppressIsSafeUriCastCheck //TODO(bangert): Refactor setPropertyString public void setTargetHistoryToken(String targetHistoryToken) { assert targetHistoryToken != null : "targetHistoryToken must not be null, consider using Anchor instead"; this.targetHistoryToken = targetHistoryToken; String hash = History.encodeHistoryToken(targetHistoryToken); anchorElem.setPropertyString("href", "#" + hash); }
/** * Sets the horizontal alignment of the specified cell. * * @param row the row of the cell whose alignment is to be set * @param column the column of the cell whose alignment is to be set * @param align the cell's new horizontal alignment as specified in * {@link HasHorizontalAlignment}. * @throws IndexOutOfBoundsException */ public void setHorizontalAlignment(int row, int column, HorizontalAlignmentConstant align) { prepareCell(row, column); Element elem = getCellElement(bodyElem, row, column); elem.setPropertyString("align", align.getTextAlignString()); }
@Override public void ensureDebugId(Element elem, String baseID, String id) { assert baseID != null; baseID = (baseID.length() > 0) ? baseID + "-" : ""; String prefix = DebugInfo.getDebugIdPrefix(); String debugId = ((prefix == null) ? "" : prefix) + baseID + id; String attribute = DebugInfo.getDebugIdAttribute(); if (DebugInfo.isDebugIdAsProperty()) { elem.setPropertyString(attribute, debugId); } else { elem.setAttribute(attribute, debugId); } } }
private static void dispatchUnhandledEvent(Event evt) { Element element = evt.getCurrentEventTarget().cast(); element.setPropertyString("__gwtLastUnhandledEvent", evt.getType()); dispatchEvent(evt); }
@SuppressIsSafeUriCastCheck //TODO(bangert): refactor away setproperty. private ClickableHeader() { // Anchor is used to allow keyboard access. super(DOM.createAnchor()); Element elem = getElement(); elem.setPropertyString("href", "javascript:void(0);"); // Avoids layout problems from having blocks in inlines. elem.getStyle().setProperty("display", "block"); sinkEvents(Event.ONCLICK); setStyleName(STYLENAME_HEADER); }
private DefaultHeader(Imager imager, String text) { this.imager = imager; iconImage = imager.makeImage(); // I do not need any Widgets here, just a DOM structure. Element root = DOM.createTable(); Element tbody = DOM.createTBody(); Element tr = DOM.createTR(); final Element imageTD = DOM.createTD(); labelTD = DOM.createTD(); setElement(root); DOM.appendChild(root, tbody); DOM.appendChild(tbody, tr); DOM.appendChild(tr, imageTD); DOM.appendChild(tr, labelTD); // set image TD to be same width as image. imageTD.setPropertyString("align", "center"); imageTD.setPropertyString("valign", "middle"); imageTD.getStyle().setProperty("width", iconImage.getWidth() + "px"); DOM.appendChild(imageTD, iconImage.getElement()); setText(text); addOpenHandler(this); addCloseHandler(this); setStyle(); }