@Override public XMLPacket addChild(final String name, final String namespace) { final Element newElement = document.createElement(checkNotNull(name)); if (namespace != null) { newElement.setAttribute("xmlns", namespace); } element.appendChild(newElement); return new XMLPacketImplGWT(newElement); }
@Override public XMLPacket addChild(final HasXML child) { checkArgument(checkNotNull(child.getXML()) instanceof XMLPacketImplGWT); final Element newElement = (Element) document.importNode(((XMLPacketImplGWT) child.getXML()).element, true); element.appendChild(newElement); return new XMLPacketImplGWT(newElement); }
public void nodeAdded(Object parent, Object node, int index) { Element parentNode = nodes.get(parent); Element childNode = document.createElement("event"); for (int i = 0; i < model.getColumnCount(); i++) { childNode.setAttribute(getAttributeName(i), getAttributeValue(node, i)); } parentNode.appendChild(childNode); nodes.put(node, childNode); updateTextArea(); }
databaseName.appendChild( databaseNameText ); databaseConnection.appendChild( databaseName ); databasePort.appendChild( databasePortText ); databaseConnection.appendChild( databasePort ); hostname.appendChild( hostnameText ); databaseConnection.appendChild( hostname ); indexTablespace.appendChild( indexTablespaceText ); databaseConnection.appendChild( indexTablespace ); dataTablespace.appendChild( dataTablespaceText ); databaseConnection.appendChild( dataTablespace ); informixServername.appendChild( informixServernameText ); databaseConnection.appendChild( informixServername ); name.appendChild( nameText ); databaseConnection.appendChild( name ); username.appendChild( usernameTxt ); databaseConnection.appendChild( username ); password.appendChild( passwordText ); databaseConnection.appendChild( password ); accessType.appendChild( accessTypeText ); databaseConnection.appendChild( accessType );
@Override public void setText(final String text) { // TODO: remove ALL children? final NodeList nodes = element.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { final Node child = nodes.item(i); if (child.getNodeType() == Node.TEXT_NODE) { element.removeChild(child); } } if (!Strings.isNullOrEmpty(text)) { element.appendChild(document.createTextNode(text)); } }