if ("body".equals(getElement().getNodeName().toLowerCase(Locale.ROOT))) { return;
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ private static Element clone(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(clone(child)); } return clone; }
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ private static Element clone(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(clone(child)); } return clone; }
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ public Element cloneSvgElement(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName(), Dom.createUniqueId()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(cloneSvgElement(child)); } return clone; }
/** * @see com.google.gwt.user.client.ui.Panel#add(com.google.gwt.user.client.ui.Widget) */ @Override public void add(Widget w) { if (w == null) throw new NullPointerException("Cannot add a null widget."); //$NON-NLS-1$ w.removeFromParent(); children.add(w); Element li; if (w.getElement().getNodeName().toLowerCase().equals("li")) { //$NON-NLS-1$ // The widget is a list item. Simply use it. li = w.getElement(); } else { // The widget needs wrapped with a list item. li = Document.get().createLIElement().cast(); DOM.appendChild(li, w.getElement()); } liMap.put(w, li); DOM.appendChild(getElement(), li); adopt(w); }
if ("body".equals(getElement().getNodeName().toLowerCase(Locale.ROOT))) { return;
if ("body".equals(StringCase.toLower(getElement().getNodeName()))) { return;