com.google.gwt.dom.client.Element.getNodeType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(248)

本文整理了Java中com.google.gwt.dom.client.Element.getNodeType()方法的一些代码示例,展示了Element.getNodeType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getNodeType()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getNodeType

Element.getNodeType介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. private static void dispatchEvent(Event evt) {
  2. Element element = getFirstAncestorWithListener(evt);
  3. if (element == null) {
  4. return;
  5. }
  6. DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
  2. String fieldName = getFieldName(uiId, cursor);
  3. if (fieldName == null) {

代码示例来源:origin: net.wetheinter/gwt-user

  1. private static void dispatchEvent(Event evt) {
  2. Element element = getFirstAncestorWithListener(evt);
  3. if (element == null) {
  4. return;
  5. }
  6. DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
  7. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. private static void dispatchEvent(Event evt) {
  2. Element element = getFirstAncestorWithListener(evt);
  3. if (element == null) {
  4. return;
  5. }
  6. DOM.dispatchEvent(evt, element.getNodeType() != 1 ? null : element, getEventListener(element));
  7. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. /**
  2. * Set the innerHTML of every matched element.
  3. */
  4. public GQuery html(String html) {
  5. for (Element e : elements) {
  6. if (e.getNodeType() == Node.DOCUMENT_NODE) {
  7. e = e.<Document> cast().getBody();
  8. }
  9. e.setInnerHTML(html);
  10. }
  11. return this;
  12. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
  2. String fieldName = getFieldName(uiId, cursor);
  3. if (fieldName == null) {

代码示例来源:origin: net.wetheinter/gwt-user

  1. while (cursor != null && cursor != root && cursor.getNodeType() != Element.DOCUMENT_NODE) {
  2. String fieldName = getFieldName(uiId, cursor);
  3. if (fieldName == null) {

代码示例来源:origin: sk.seges.acris/acris-recorder-client-core

  1. protected String getElementTreeXpath(com.google.gwt.dom.client.Element element) {
  2. String result = "";
  3. // Use nodeName (instead of localName) so namespace prefix is included (if any).
  4. for (; element != null && element.getNodeType() == 1; element = element.getParentElement()) {
  5. if (result.length() > 0) {
  6. result = "/" + result;
  7. }
  8. if (hasId(element)) {
  9. return getXPathForId(element) + result;
  10. }
  11. int index = 0;
  12. for (Node sibling = element.getPreviousSibling(); sibling != null; sibling = sibling.getPreviousSibling())
  13. {
  14. // Ignore document type declaration.
  15. if (sibling.getNodeType() == Node.DOCUMENT_NODE)
  16. continue;
  17. if (sibling.getNodeName().equals(element.getNodeName())) {
  18. ++index;
  19. }
  20. }
  21. String tagName = element.getNodeName().toLowerCase();
  22. String pathIndex = (index > 0 ? "[" + (index+1) + "]" : "");
  23. result = tagName + pathIndex + result;
  24. }
  25. return result;
  26. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. public void removeAttribute(GQuery gQuery, String key) {
  2. for (Element e : gQuery.elements()) {
  3. if (e.getNodeType() != 1) {
  4. continue;
  5. }
  6. if (JsUtils.hasProperty(e, key)) {
  7. if (BOOLEAN_ATTR_REGEX.test(key)) {
  8. e.setPropertyBoolean(key, false);
  9. } else {
  10. e.setPropertyObject(key, null);
  11. }
  12. }
  13. e.removeAttribute(key);
  14. }
  15. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. public void setAttribute(GQuery gQuery, String key, Object value) {
  2. AttributeSetter setter = getAttributeSetter(key);
  3. if (setter.isRemoval(value)) {
  4. gQuery.removeAttr(key);
  5. return;
  6. }
  7. value = fixValue(key, value);
  8. for (Element e : gQuery.elements()) {
  9. int nodeType = e.getNodeType();
  10. // don't set attribute on text, comment and attributes nodes
  11. if (nodeType == 3 || nodeType == 8 || nodeType == 2) {
  12. continue;
  13. }
  14. setter.setAttribute(e, key, value);
  15. }
  16. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. /**
  2. * Remove all child nodes from the set of matched elements. In the case of a document element, it
  3. * removes all the content You should call this method whenever you create a new iframe and you
  4. * want to add dynamic content to it.
  5. */
  6. public GQuery empty() {
  7. for (Element e : elements) {
  8. if (e.getNodeType() == Element.DOCUMENT_NODE) {
  9. getStyleImpl().emptyDocument(e.<Document> cast());
  10. } else {
  11. Node c = e.getFirstChild();
  12. while (c != null) {
  13. removeData(c.<Element> cast(), null);
  14. WidgetsUtils.detachWidget(getAssociatedWidget(e));
  15. EventsListener.clean(c.<Element> cast());
  16. e.removeChild(c);
  17. c = e.getFirstChild();
  18. }
  19. }
  20. }
  21. return this;
  22. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. if (e.getNodeType() == Node.DOCUMENT_NODE) {
  2. e = e.<Document> cast().getBody();

相关文章

Element类方法