本文整理了Java中com.google.gwt.dom.client.Element.equals()
方法的一些代码示例,展示了Element.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.equals()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:equals
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
* attached to the document. Always returns <code>true</code> in ProdMode.
*/
private static boolean isAttachedToDom(Element rendered) {
if (GWT.isProdMode()) {
return true;
}
Element body = Document.get().getBody();
while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
rendered = rendered.getParentElement();
}
return body.equals(rendered);
}
代码示例来源:origin: org.jboss.ballroom/widgets
public void onElement(Element target) {
for(int i=0; i<focusable.size(); i++)
{
Element element = focusable.get(i);
if(target.equals(element))
{
// reset focus
setFocus(element);
currentFocus = i;
break;
}
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
* attached to the document. Always returns <code>true</code> in ProdMode.
*/
private static boolean isAttachedToDom(Element rendered) {
if (GWT.isProdMode()) {
return true;
}
Element body = Document.get().getBody();
while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
rendered = rendered.getParentElement();
}
return body.equals(rendered);
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* In DevMode, walks up the parents of the {@code rendered} element to ascertain that it is
* attached to the document. Always returns <code>true</code> in ProdMode.
*/
private static boolean isAttachedToDom(Element rendered) {
if (GWT.isProdMode()) {
return true;
}
Element body = Document.get().getBody();
while (rendered != null && rendered.hasParentElement() && !body.equals(rendered)) {
rendered = rendered.getParentElement();
}
return body.equals(rendered);
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Produces a string representation of the matched elements.
*/
public String toString(boolean pretty) {
String r = "";
for (Element e : elements) {
if (window.equals(e)) {
continue;
}
String elStr;
try {
elStr = JsUtils.isXML(e) ? JsUtils.XML2String(e) : e.getString();
} catch (Exception e2) {
elStr =
"< " + (e == null ? "null" : e.getNodeName())
+ "(gquery, error getting the element string representation: " + e2.getMessage()
+ ")/>";
}
r += (pretty && r.length() > 0 ? "\n " : "") + elStr;
}
return r;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
if (parent == null || child == null) {
return -1;
}
for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
if (child.equals(parent.getChildNodes().getItem(i))) {
return i;
}
}
return -1;
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
@Override
public void onClick(ClickEvent event) {
Element e = Element.as(event.getNativeEvent().getEventTarget());
if (e.equals(panel.getElementById(closeLinkId))) {
CloseEvent.fire(KSNotification.this, KSNotification.this);
}
}
}, ClickEvent.getType());
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
if (parent == null || child == null) {
return -1;
}
for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
if (child.equals(parent.getChildNodes().getItem(i))) {
return i;
}
}
return -1;
}
代码示例来源:origin: org.uberfire/uberfire-message-console-client
@Override
protected void onEnterKeyDown(final Context context,
final Element parent,
final HyperLink value,
final NativeEvent event,
final ValueUpdater<HyperLink> valueUpdater) {
final Element element = event.getEventTarget().cast();
if (!parent.getFirstChildElement().equals(element)) {
return;
}
event.preventDefault();
event.stopPropagation();
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
public void run() {
if (WidgetUtil.getFocusedElement() == null) {
// This should never become an infinite loop and
// even if it does it will be stopped once something
// is done with the browser.
schedule(25);
} else if (WidgetUtil.getFocusedElement().equals(
Document.get().getBody())) {
// Focus found it's way to BodyElement. Now it can
// be restored
focusedElement.focus();
}
}
};
代码示例来源:origin: kiegroup/appformer
@Override
protected void onEnterKeyDown(final Context context,
final Element parent,
final HyperLink value,
final NativeEvent event,
final ValueUpdater<HyperLink> valueUpdater) {
final Element element = event.getEventTarget().cast();
if (!parent.getFirstChildElement().equals(element)) {
return;
}
event.preventDefault();
event.stopPropagation();
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-message-console-client
@Override
protected void onEnterKeyDown( final Context context,
final Element parent,
final HyperLinkCell.HyperLink value,
final NativeEvent event,
final ValueUpdater<HyperLinkCell.HyperLink> valueUpdater ) {
final Element element = event.getEventTarget().cast();
if ( !parent.getFirstChildElement().equals( element ) ) {
return;
}
event.preventDefault();
event.stopPropagation();
if ( valueUpdater != null ) {
valueUpdater.update( value );
}
}
代码示例来源:origin: dennisjzh/GwtMobile-UI
protected void fireDragEvent(DragEvent e) {
if (_capturingDragEventsHandler != null) {
e.dispatch(_capturingDragEventsHandler);
return;
}
EventTarget target = e.getNativeEvent().getEventTarget();
Node node = Node.as(target);
if (!Element.is(node)) {
node = node.getParentNode(); //Text node
}
if (Element.is(node)) {
Element ele = Element.as(target);
int count = 0;
while (ele != null) {
for (DragEventsHandler handler : _dragEventHandlers) {
if (ele.equals(handler.getElement())) {
e.dispatch(handler);
count++;
if (e.getStopPropagation() || count == _dragEventHandlers.size()) {
return;
}
}
}
ele = ele.getParentElement();
}
}
}
代码示例来源:origin: dennisjzh/GwtMobile-UI
protected void fireSwipeEvent(SwipeEvent e) {
if (_capturingSwipeEventsHandler != null) {
e.dispatch(_capturingSwipeEventsHandler);
return;
}
if (_capturingDragEventsHandler != null) {
return;
}
EventTarget target = e.getNativeEvent().getEventTarget();
Node node = Node.as(target);
if (!Element.is(node)) {
node = node.getParentNode(); //Text node
}
if (Element.is(node)) {
Element ele = Element.as(target);
int count = 0;
while (ele != null) {
for (SwipeEventsHandler handler : _swipeEventHandlers) {
if (ele.equals(handler.getElement())) {
e.dispatch(handler);
count++;
if (e.getStopPropagation() || count == _swipeEventHandlers.size()) {
return;
}
}
}
ele = ele.getParentElement();
}
}
}
代码示例来源:origin: sk.seges.acris/acris-recorder-client-core
if (currentActiveElement != null && (activeElement == null || !activeElement.equals(currentActiveElement))) {
代码示例来源:origin: thothbot/parallax
if (!element.getParentElement().equals(cameraElement)) {
cameraElement.appendChild(element);
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
DOM.eventCancelBubble(event, true);
} else if (targ.equals(getElement())
&& DOM.eventGetType(event) == Event.ONFOCUS) {
} else if (targ.equals(getElement())
&& DOM.eventGetType(event) == Event.ONBLUR) {
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
if (imageElem != null && anchor.equals(imageElem.getParentElement())) {
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
if (imageElem != null && anchor.equals(imageElem.getParentElement())) {
代码示例来源:origin: jqm4gwt/jqm4gwt
if (imageElem != null && anchor.equals(imageElem.getParentElement())) {
内容来源于网络,如有侵权,请联系作者删除!