@Override public void setIconUri(String iconUri, ApplicationConnection client) { if (icon != null) { captionNode.removeChild(icon.getElement()); } icon = client.getIcon(iconUri); if (icon != null) { DOM.insertChild(captionNode, icon.getElement(), 1); } }
public void setIcon(Icon icon) { if (icon == null) { if (this.icon != null) { getElement().removeChild(this.icon.getElement()); } } else if (this.icon != null) { getElement() .replaceChild(this.icon.getElement(), icon.getElement()); } else { getElement().insertFirst(icon.getElement()); } this.icon = icon; }
public void updateIcon() { Optional.ofNullable(appTile.getIcon()).ifPresent(iconReference -> { icon.removeAllChildren(); icon.appendChild(iconSupplier.apply(appTile.getIcon().getURL()).getElement()); }); }
protected void updateIcon(VLabel widget) { Icon icon = getIcon(); if (icon != null) { widget.getElement().insertFirst(icon.getElement()); } }
itemHTML.append(icon.getElement().getString());
@Override public void render(RendererCellReference cell, String url) { cell.getElement().removeAllChildren(); cell.getElement().appendChild(iconRendererConnector.getConnection().getIcon(url).getElement()); } }
private void constructDOM() { setElement(root); setStyleName(CLASSNAME); text.addClassName("v-text"); icon.addClassName("v-icon"); root.appendChild(iconImage == null ? icon : iconImage.getElement()); root.appendChild(text); AriaHelper.bindCaption(this, text); }
public Element getDragCaptionElement(Widget w) { ComponentConnector component = Util.findConnectorFor(w); DDLayoutState state = ((DragAndDropAwareState) root.getState()).getDragAndDropState(); String dragCaptionText = state.dragCaptions.get(component); Document document = Document.get(); Element dragCaptionImage = document.createElement("div"); Element dragCaption = document.createElement("span"); dragCaption.setInnerText(dragCaptionText); String dragIconId = state.dragIcons.get(component); if (dragIconId != null) { String resourceUrl = root.getResourceUrl(dragIconId); Icon icon = component.getConnection().getIcon(resourceUrl); dragCaptionImage.appendChild(icon.getElement()); } dragCaptionImage.appendChild(dragCaption); return dragCaptionImage; } }
/** * Helper function to build html snippet for column or row headers. * * @param uidl * possibly with values caption and icon * @return html snippet containing possibly an icon + caption text */ protected String buildCaptionHtmlSnippet(UIDL uidl) { String s = uidl.hasAttribute("caption") ? uidl.getStringAttribute("caption") : ""; if (uidl.hasAttribute("icon")) { Icon icon = client.getIcon(uidl.getStringAttribute("icon")); icon.setAlternateText("icon"); s = icon.getElement().getString() + s; } return s; }
public final boolean setCaption(String caption, Icon icon, String captionStyleName) { DivElement captionElement = getFirstChildElement().cast(); boolean hasIcon = icon != null; boolean needsCaption = hasIcon || (caption != null && !caption.isEmpty()); if (needsCaption) { String captionHtml = hasIcon ? icon.getElement().getString() : ""; captionHtml += caption == null ? "" : caption; captionElement.setInnerHTML(captionHtml); captionElement.getStyle().setProperty("display", null); // copy v-caption prefixed styles from widget to caption captionElement.setClassName(captionStyleName); setClassName(ROW_CLASSNAME + " " + ROW_WITH_CAPTION_STYLENAME); } else { setClassName(ROW_CLASSNAME + " " + ROW_WITHOUT_CAPTION_STYLENAME); } return needsCaption; }
String resourceUrl = root.getResourceUrl(dragIconKey); Icon icon = component.getConnection().getIcon(resourceUrl); dragCaptionImage.appendChild(icon.getElement());
@Override public int getRenderedWidth() { int width = 0; if (icon != null) { width += WidgetUtil.getRequiredWidth(icon.getElement()); } if (captionText != null) { width += WidgetUtil.getRequiredWidth(captionText); } if (requiredFieldIndicator != null && requiredFieldIndicator.getParentElement() == getElement()) { width += WidgetUtil.getRequiredWidth(requiredFieldIndicator); } if (errorIndicatorElement != null && errorIndicatorElement.getParentElement() == getElement()) { width += WidgetUtil.getRequiredWidth(errorIndicatorElement); } if (contextHelpIndicatorElement != null && contextHelpIndicatorElement.getParentElement() == getElement()) { width += WidgetUtil.getRequiredWidth(contextHelpIndicatorElement); } return width; }
wrapElement.appendChild(icon.getElement());
if(fontIconMarker) { vIcon = getIcon(); fontAwesomeChar = vIcon.getElement().getInnerText(); svgSb.append(vIcon.getStyleName());
protected boolean addTreeSpacer(UIDL rowUidl) { if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) { Element container = (Element) getElement().getLastChild() .getFirstChild(); if (rowUidl.hasAttribute("icon")) { Icon icon = client .getIcon(rowUidl.getStringAttribute("icon")); icon.setAlternateText("icon"); container.insertFirst(icon.getElement()); } String classname = "v-treetable-treespacer"; if (rowUidl.getBooleanAttribute("ca")) { canHaveChildren = true; open = rowUidl.getBooleanAttribute("open"); classname += open ? " v-treetable-node-open" : " v-treetable-node-closed"; } treeSpacer = Document.get().createSpanElement(); treeSpacer.setClassName(classname); container.insertFirst(treeSpacer); depth = rowUidl.hasAttribute("depth") ? rowUidl.getIntAttribute("depth") : 0; setIndent(); isTreeCellAdded = true; return true; } return false; }
getElement().removeChild(icon.getElement()); icon = null; DOM.insertChild(getElement(), icon.getElement(), getInsertPosition(InsertPosition.ICON));
getWidget().submitButton.wrapper.removeChild(getWidget().submitButton.icon.getElement()); getWidget().submitButton.icon = null; getWidget().submitButton.wrapper.insertBefore(icon.getElement(), getWidget().submitButton.captionElement);
this.icon.getElement().removeFromParent(); caption.insertFirst(icon.getElement());