本文整理了Java中com.google.gwt.dom.client.Element.getNodeType()
方法的一些代码示例,展示了Element.getNodeType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getNodeType()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getNodeType
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
private static void dispatchEvent(Event evt) {
Element element = getFirstAncestorWithListener(evt);
if (element == null) {
return;
}
DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
String fieldName = getFieldName(uiId, cursor);
if (fieldName == null) {
代码示例来源:origin: net.wetheinter/gwt-user
private static void dispatchEvent(Event evt) {
Element element = getFirstAncestorWithListener(evt);
if (element == null) {
return;
}
DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private static void dispatchEvent(Event evt) {
Element element = getFirstAncestorWithListener(evt);
if (element == null) {
return;
}
DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Set the innerHTML of every matched element.
*/
public GQuery html(String html) {
for (Element e : elements) {
if (e.getNodeType() == Node.DOCUMENT_NODE) {
e = e.<Document> cast().getBody();
}
e.setInnerHTML(html);
}
return this;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
String fieldName = getFieldName(uiId, cursor);
if (fieldName == null) {
代码示例来源:origin: net.wetheinter/gwt-user
while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
String fieldName = getFieldName(uiId, cursor);
if (fieldName == null) {
代码示例来源:origin: sk.seges.acris/acris-recorder-client-core
protected String getElementTreeXpath(com.google.gwt.dom.client.Element element) {
String result = "";
// Use nodeName (instead of localName) so namespace prefix is included (if any).
for (; element != null && element.getNodeType() == 1; element = element.getParentElement()) {
if (result.length() > 0) {
result = "/" + result;
}
if (hasId(element)) {
return getXPathForId(element) + result;
}
int index = 0;
for (Node sibling = element.getPreviousSibling(); sibling != null; sibling = sibling.getPreviousSibling())
{
// Ignore document type declaration.
if (sibling.getNodeType() == Node.DOCUMENT_NODE)
continue;
if (sibling.getNodeName().equals(element.getNodeName())) {
++index;
}
}
String tagName = element.getNodeName().toLowerCase();
String pathIndex = (index > 0 ? "[" + (index+1) + "]" : "");
result = tagName + pathIndex + result;
}
return result;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public void removeAttribute(GQuery gQuery, String key) {
for (Element e : gQuery.elements()) {
if (e.getNodeType() != 1) {
continue;
}
if (JsUtils.hasProperty(e, key)) {
if (BOOLEAN_ATTR_REGEX.test(key)) {
e.setPropertyBoolean(key, false);
} else {
e.setPropertyObject(key, null);
}
}
e.removeAttribute(key);
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public void setAttribute(GQuery gQuery, String key, Object value) {
AttributeSetter setter = getAttributeSetter(key);
if (setter.isRemoval(value)) {
gQuery.removeAttr(key);
return;
}
value = fixValue(key, value);
for (Element e : gQuery.elements()) {
int nodeType = e.getNodeType();
// don't set attribute on text, comment and attributes nodes
if (nodeType == 3 || nodeType == 8 || nodeType == 2) {
continue;
}
setter.setAttribute(e, key, value);
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Remove all child nodes from the set of matched elements. In the case of a document element, it
* removes all the content You should call this method whenever you create a new iframe and you
* want to add dynamic content to it.
*/
public GQuery empty() {
for (Element e : elements) {
if (e.getNodeType() == Element.DOCUMENT_NODE) {
getStyleImpl().emptyDocument(e.<Document> cast());
} else {
Node c = e.getFirstChild();
while (c != null) {
removeData(c.<Element> cast(), null);
WidgetsUtils.detachWidget(getAssociatedWidget(e));
EventsListener.clean(c.<Element> cast());
e.removeChild(c);
c = e.getFirstChild();
}
}
}
return this;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
if (e.getNodeType() == Node.DOCUMENT_NODE) {
e = e.<Document> cast().getBody();
内容来源于网络,如有侵权,请联系作者删除!