@Override protected com.google.gwt.user.client.Element getContainerElement() { return inner.cast(); } }
/** * Gets the src attribute of an img element. This method is paired with * {@link #setImgSrc(Element, String)} so that it always returns the correct * url. * * @param img a non-null img whose src attribute is to be read. * @return the src url of the img */ public static String getImgSrc(Element img) { return img.<ImageElement> cast().getSrc(); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <button> element with type reset. * * @param element the element to be used */ protected ResetButton(com.google.gwt.dom.client.Element element) { super(element); assert "reset".equalsIgnoreCase(element.<ButtonElement> cast().getType()); } }
/** * If given a PotentialElement, returns the real Element to be * built from it. Otherwise returns the given Element itself. * <p> * Note that a PotentialElement can only be resolved once. * Making repeated calls to this method with the same PotentialElement * is an error. */ public static Element resolve(Element maybePotential) { return maybePotential.<PotentialElement>cast().resolve(); }
/** * Sets the src attribute of an img element. This method ensures that imgs * only ever have their contents requested one single time from the server. * * @param img a non-null img whose src attribute will be set. * @param src a non-null url for the img */ public static void setImgSrc(Element img, String src) { img.<ImageElement> cast().setSrc(src); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <textarea> element. * * @param element the element to be used */ protected TextArea(Element element) { super(element.<Element>cast()); TextAreaElement.as(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <button> element with type submit. * * @param element the element to be used */ protected SubmitButton(com.google.gwt.dom.client.Element element) { super(element); assert "submit".equalsIgnoreCase(element.<ButtonElement> cast().getType()); } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <button> element. * * @param element the element to be used */ protected Button(com.google.gwt.dom.client.Element element) { super(element.<Element> cast()); ButtonElement.as(element); }
/** * Assert that the builder is in a state where an attribute can be added. * * @return the element on which the attribute can be set */ protected E assertCanAddAttribute() { /* * An explicit parameterized return type on cast() is required by some javac * compilers. */ return delegate.assertCanAddAttribute().<E> cast(); }
@Override protected InputElement getInputElement(Element parent) { return super.getInputElement(parent).<InputElement> cast(); } }
@Override public ImageElement getImageElement(Image image) { return impl.getImgElement(image).cast(); }
/** * Creates an HTML OPTIONS element. * * @return the newly-created element * @deprecated there is no "options" element; use {@link #createOption()} * instead */ @Deprecated public static com.google.gwt.user.client.Element createOptions() { return Document.get().createElement("options").cast(); }
/** * Creates an HTML element. * * @param tagName the HTML tag of the element to be created * @return the newly-created element */ public static com.google.gwt.user.client.Element createElement(String tagName) { return Document.get().createElement(tagName).cast(); }
@Override protected com.google.gwt.user.client.Element getContainerElement() { return impl.getContainerElement(getPopupImplElement()).cast(); }
@Override protected com.google.gwt.user.client.Element getStyleElement() { return impl.getStyleElement(getPopupImplElement()).cast(); }
/** * Sets the option text of the given select object. * * @param select the select object whose option text is being set * @param text the text to set * @param index the index of the option whose text should be set */ public static void setOptionText(Element select, String text, int index) { select.<SelectElement> cast().getOptions().getItem(index).setText(text); }
@Override public void setFocus(Element parent, boolean focused) { Element focusable = parent.getFirstChildElement().cast(); if (focused) { focusable.focus(); } else { focusable.blur(); } } }
private void showImage(TreeItem treeItem, AbstractImagePrototype proto) { Element holder = treeItem.getImageHolderElement(); Element child = DOM.getFirstChild(holder); if (child == null) { // If no image element has been created yet, create one from the // prototype. DOM.appendChild(holder, proto.createElement().<Element> cast()); } else { // Otherwise, simply apply the prototype to the existing element. proto.applyTo(child.<ImagePrototypeElement> cast()); } }
@Override protected void onFocus() { TableCellElement td = getKeyboardSelectedTableCellElement(); if (td != null) { TableRowElement tr = td.getParentElement().cast(); td.addClassName(style.keyboardSelectedCell()); setRowStyleName(tr, style.keyboardSelectedRow(), style.keyboardSelectedRowCell(), true); } }
@Override protected void onBlur() { TableCellElement td = getKeyboardSelectedTableCellElement(); if (td != null) { TableRowElement tr = td.getParentElement().cast(); td.removeClassName(style.keyboardSelectedCell()); setRowStyleName(tr, style.keyboardSelectedRow(), style.keyboardSelectedRowCell(), false); } }