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

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

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

Element.equals介绍

暂无

代码示例

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

  1. /**
  2. * In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
  3. * attached to the document. Always returns <code>true</code> in ProdMode.
  4. */
  5. private static boolean isAttachedToDom(Element rendered) {
  6. if (GWT.isProdMode()) {
  7. return true;
  8. }
  9. Element body = Document.get().getBody();
  10. while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
  11. rendered = rendered.getParentElement();
  12. }
  13. return body.equals(rendered);
  14. }

代码示例来源:origin: org.jboss.ballroom/widgets

  1. public void onElement(Element target) {
  2. for(int i=0; i<focusable.size(); i++)
  3. {
  4. Element element = focusable.get(i);
  5. if(target.equals(element))
  6. {
  7. // reset focus
  8. setFocus(element);
  9. currentFocus = i;
  10. break;
  11. }
  12. }
  13. }

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

  1. /**
  2. * In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
  3. * attached to the document. Always returns <code>true</code> in ProdMode.
  4. */
  5. private static boolean isAttachedToDom(Element rendered) {
  6. if (GWT.isProdMode()) {
  7. return true;
  8. }
  9. Element body = Document.get().getBody();
  10. while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
  11. rendered = rendered.getParentElement();
  12. }
  13. return body.equals(rendered);
  14. }

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

  1. /**
  2. * In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
  3. * attached to the document. Always returns <code>true</code> in ProdMode.
  4. */
  5. private static boolean isAttachedToDom(Element rendered) {
  6. if (GWT.isProdMode()) {
  7. return true;
  8. }
  9. Element body = Document.get().getBody();
  10. while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
  11. rendered = rendered.getParentElement();
  12. }
  13. return body.equals(rendered);
  14. }

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

  1. /**
  2. * Produces a string representation of the matched elements.
  3. */
  4. public String toString(boolean pretty) {
  5. String r = "";
  6. for (Element e : elements) {
  7. if (window.equals(e)) {
  8. continue;
  9. }
  10. String elStr;
  11. try {
  12. elStr = JsUtils.isXML(e) ? JsUtils.XML2String(e) : e.getString();
  13. } catch (Exception e2) {
  14. elStr =
  15. "< " + (e == null ? "null" : e.getNodeName())
  16. + "(gquery, error getting the element string representation: " + e2.getMessage()
  17. + ")/>";
  18. }
  19. r += (pretty && r.length() > 0 ? "\n " : "") + elStr;
  20. }
  21. return r;
  22. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
  3. if (parent == null || child == null) {
  4. return -1;
  5. }
  6. for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
  7. if (child.equals(parent.getChildNodes().getItem(i))) {
  8. return i;
  9. }
  10. }
  11. return -1;
  12. }

代码示例来源:origin: org.kuali.student.core/ks-common-ui

  1. @Override
  2. public void onClick(ClickEvent event) {
  3. Element e = Element.as(event.getNativeEvent().getEventTarget());
  4. if (e.equals(panel.getElementById(closeLinkId))) {
  5. CloseEvent.fire(KSNotification.this, KSNotification.this);
  6. }
  7. }
  8. }, ClickEvent.getType());

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
  3. if (parent == null || child == null) {
  4. return -1;
  5. }
  6. for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
  7. if (child.equals(parent.getChildNodes().getItem(i))) {
  8. return i;
  9. }
  10. }
  11. return -1;
  12. }

代码示例来源:origin: org.uberfire/uberfire-message-console-client

  1. @Override
  2. protected void onEnterKeyDown(final Context context,
  3. final Element parent,
  4. final HyperLink value,
  5. final NativeEvent event,
  6. final ValueUpdater<HyperLink> valueUpdater) {
  7. final Element element = event.getEventTarget().cast();
  8. if (!parent.getFirstChildElement().equals(element)) {
  9. return;
  10. }
  11. event.preventDefault();
  12. event.stopPropagation();
  13. if (valueUpdater != null) {
  14. valueUpdater.update(value);
  15. }
  16. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. @Override
  2. public void run() {
  3. if (WidgetUtil.getFocusedElement() == null) {
  4. // This should never become an infinite loop and
  5. // even if it does it will be stopped once something
  6. // is done with the browser.
  7. schedule(25);
  8. } else if (WidgetUtil.getFocusedElement().equals(
  9. Document.get().getBody())) {
  10. // Focus found it's way to BodyElement. Now it can
  11. // be restored
  12. focusedElement.focus();
  13. }
  14. }
  15. };

代码示例来源:origin: kiegroup/appformer

  1. @Override
  2. protected void onEnterKeyDown(final Context context,
  3. final Element parent,
  4. final HyperLink value,
  5. final NativeEvent event,
  6. final ValueUpdater<HyperLink> valueUpdater) {
  7. final Element element = event.getEventTarget().cast();
  8. if (!parent.getFirstChildElement().equals(element)) {
  9. return;
  10. }
  11. event.preventDefault();
  12. event.stopPropagation();
  13. if (valueUpdater != null) {
  14. valueUpdater.update(value);
  15. }
  16. }

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-message-console-client

  1. @Override
  2. protected void onEnterKeyDown( final Context context,
  3. final Element parent,
  4. final HyperLinkCell.HyperLink value,
  5. final NativeEvent event,
  6. final ValueUpdater<HyperLinkCell.HyperLink> valueUpdater ) {
  7. final Element element = event.getEventTarget().cast();
  8. if ( !parent.getFirstChildElement().equals( element ) ) {
  9. return;
  10. }
  11. event.preventDefault();
  12. event.stopPropagation();
  13. if ( valueUpdater != null ) {
  14. valueUpdater.update( value );
  15. }
  16. }

代码示例来源:origin: dennisjzh/GwtMobile-UI

  1. protected void fireDragEvent(DragEvent e) {
  2. if (_capturingDragEventsHandler != null) {
  3. e.dispatch(_capturingDragEventsHandler);
  4. return;
  5. }
  6. EventTarget target = e.getNativeEvent().getEventTarget();
  7. Node node = Node.as(target);
  8. if (!Element.is(node)) {
  9. node = node.getParentNode(); //Text node
  10. }
  11. if (Element.is(node)) {
  12. Element ele = Element.as(target);
  13. int count = 0;
  14. while (ele != null) {
  15. for (DragEventsHandler handler : _dragEventHandlers) {
  16. if (ele.equals(handler.getElement())) {
  17. e.dispatch(handler);
  18. count++;
  19. if (e.getStopPropagation() || count == _dragEventHandlers.size()) {
  20. return;
  21. }
  22. }
  23. }
  24. ele = ele.getParentElement();
  25. }
  26. }
  27. }

代码示例来源:origin: dennisjzh/GwtMobile-UI

  1. protected void fireSwipeEvent(SwipeEvent e) {
  2. if (_capturingSwipeEventsHandler != null) {
  3. e.dispatch(_capturingSwipeEventsHandler);
  4. return;
  5. }
  6. if (_capturingDragEventsHandler != null) {
  7. return;
  8. }
  9. EventTarget target = e.getNativeEvent().getEventTarget();
  10. Node node = Node.as(target);
  11. if (!Element.is(node)) {
  12. node = node.getParentNode(); //Text node
  13. }
  14. if (Element.is(node)) {
  15. Element ele = Element.as(target);
  16. int count = 0;
  17. while (ele != null) {
  18. for (SwipeEventsHandler handler : _swipeEventHandlers) {
  19. if (ele.equals(handler.getElement())) {
  20. e.dispatch(handler);
  21. count++;
  22. if (e.getStopPropagation() || count == _swipeEventHandlers.size()) {
  23. return;
  24. }
  25. }
  26. }
  27. ele = ele.getParentElement();
  28. }
  29. }
  30. }

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

  1. if (currentActiveElement != null && (activeElement == null || !activeElement.equals(currentActiveElement))) {

代码示例来源:origin: thothbot/parallax

  1. if (!element.getParentElement().equals(cameraElement)) {
  2. cameraElement.appendChild(element);

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

  1. DOM.eventCancelBubble(event, true);
  2. } else if (targ.equals(getElement())
  3. && DOM.eventGetType(event) == Event.ONFOCUS) {
  4. } else if (targ.equals(getElement())
  5. && DOM.eventGetType(event) == Event.ONBLUR) {
  6. } else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone

  1. if (imageElem != null && anchor.equals(imageElem.getParentElement())) {

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

  1. if (imageElem != null && anchor.equals(imageElem.getParentElement())) {

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. if (imageElem != null && anchor.equals(imageElem.getParentElement())) {

相关文章

Element类方法