本文整理了Java中com.google.gwt.dom.client.Element.isOrHasChild()
方法的一些代码示例,展示了Element.isOrHasChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.isOrHasChild()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:isOrHasChild
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Determine whether one element is equal to, or the child of, another.
*
* @param parent the potential parent element
* @param child the potential child element
* @return <code>true</code> if the relationship holds
* @deprecated Use {@link Element#isOrHasChild(Element)} instead.
*/
@Deprecated
public static boolean isOrHasChild(Element parent, Element child) {
return parent.isOrHasChild(child);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Does the event target one of the partner elements?
*
* @param event the native event
* @return true if the event targets a partner
*/
private boolean eventTargetsPartner(NativeEvent event) {
if (autoHidePartners == null) {
return false;
}
EventTarget target = event.getEventTarget();
if (Element.is(target)) {
for (Element elem : autoHidePartners) {
if (elem.isOrHasChild(Element.as(target))) {
return true;
}
}
}
return false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
// Ignore events that don't target the input.
Element target = event.getEventTarget().cast();
if (!getInputElement(parent).isOrHasChild(target)) {
return;
}
String eventType = event.getType();
if (BrowserEvents.FOCUS.equals(eventType)) {
focusedKey = context.getKey();
} else if (BrowserEvents.BLUR.equals(eventType)) {
focusedKey = null;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private boolean isCaptionEvent(NativeEvent event) {
EventTarget target = event.getEventTarget();
if (Element.is(target)) {
return getCellElement(0, 1).getParentElement().isOrHasChild(
Element.as(target));
}
return false;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (CLICK.equals(event.getType())) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
if (parent.getFirstChildElement().isOrHasChild(Element.as(eventTarget))) {
// Ignore clicks that occur outside of the main element.
onEnterKeyDown(context, parent, value, event, valueUpdater);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (CLICK.equals(event.getType())) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
if (parent.getFirstChildElement().isOrHasChild(Element.as(eventTarget))) {
// Ignore clicks that occur outside of the main element.
onEnterKeyDown(context, parent, value, event, valueUpdater);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Check whether or not an event occurred within the wrapper around the image
* element.
*
* @param event the event
* @param parent the parent element
* @return true if the event targets the image
*/
private boolean eventOccurredOnImage(NativeEvent event, Element parent) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return false;
}
Element target = eventTarget.cast();
// Make sure the target occurred within the div around the image.
Element imgWrapper = parent.getFirstChildElement().getNextSiblingElement();
return imgWrapper.isOrHasChild(target);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
int index = 0;
EventTarget eventTarget = event.getEventTarget();
if (Element.is(eventTarget)) {
Element target = eventTarget.cast();
Element container = getContainerElement(parent);
Element wrapper = container.getFirstChildElement();
while (wrapper != null) {
if (wrapper.isOrHasChild(target)) {
onBrowserEventImpl(context, wrapper, value, event, valueUpdater,
hasCells.get(index));
}
index++;
wrapper = wrapper.getNextSiblingElement();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onEnterKeyDown(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
Element input = getInputElement(parent);
Element target = event.getEventTarget().cast();
Object key = context.getKey();
if (getInputElement(parent).isOrHasChild(target)) {
finishEditing(parent, value, key, valueUpdater);
} else {
focusedKey = key;
input.focus();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
if (!parent.getFirstChildElement().isOrHasChild(target)) {
return;
代码示例来源:origin: com.google.gwt/gwt-servlet
Element showMoreElem = nodeView.getShowMoreElement();
if (isMouseDown) {
if (!nodeView.isRootNode() && nodeView.getImageElement().isOrHasChild(target)) {
} else if (showMoreElem != null && showMoreElem.isOrHasChild(target)) {
} else if (isClick && showMoreElem != null && showMoreElem.isOrHasChild(target)) {
if (nodeView != rootNode && nodeView.getSelectionElement().isOrHasChild(target)) {
代码示例来源:origin: com.google.gwt/gwt-servlet
private boolean elementClicked(Element hElem) {
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), hElem);
TreeItem item = findItemByChain(chain, 0, root);
if (item != null && item != root) {
if (item.getChildCount() > 0
&& item.getImageElement().isOrHasChild(hElem)) {
item.setState(!item.getState(), true);
return true;
} else if (item.getElement().isOrHasChild(hElem)) {
onSelection(item, true, !shouldTreeDelegateFocusToElement(hElem));
return true;
}
}
return false;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Return true if the <code>descendant</code> is a child of the parent. Return false elsewhere.
*/
public static boolean contains(Element parent, Element descendant) {
return parent != descendant && parent.isOrHasChild(descendant);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Determine whether one element is equal to, or the child of, another.
*
* @param parent the potential parent element
* @param child the potential child element
* @return <code>true</code> if the relationship holds
* @deprecated Use {@link Element#isOrHasChild(Element)} instead.
*/
@Deprecated
public static boolean isOrHasChild(Element parent, Element child) {
return parent.isOrHasChild(child);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
if (from == null || !senderElem.isOrHasChild(from)) {
fireMouseEnter(sender);
if (to == null || !senderElem.isOrHasChild(to)) {
fireMouseLeave(sender);
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
// Hook the popup panel's event preview. We use this to keep it from
// auto-hiding when the parent menu is clicked.
if (!event.isCanceled()) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
// If the event target is part of the parent menu, suppress the
// event altogether.
EventTarget target = event.getNativeEvent().getEventTarget();
Element parentMenuElement = MenuBar.this.getElement();
if (parentMenuElement.isOrHasChild(Element.as(target))) {
event.cancel();
return;
}
super.onPreviewNativeEvent(event);
if (event.isCanceled()) {
selectItem(null);
}
return;
}
}
super.onPreviewNativeEvent(event);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
if (previewEvent.isCanceled() || !cellParent.isOrHasChild(Element.as(event.getEventTarget()))) {
return;
代码示例来源:origin: fr.putnami.pwt/pwt
private boolean isOrHasChildOfContainerOrPartner(Element target) {
if (this.containerWidget.getElement().isOrHasChild(target)) {
return true;
}
for (Element elem : this.focusPartners) {
if (elem.isOrHasChild(target)) {
return true;
}
}
return false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
} else if ((curSelection != null) && curSelection.getContentElem().isOrHasChild(e)) {
setFocus(true);
代码示例来源:origin: com.google.gwt/gwt-servlet
if (splitElem.isOrHasChild(target)) {
startResizingFrom(event.getClientX() - getAbsoluteLeft(),
event.getClientY() - getAbsoluteTop());
内容来源于网络,如有侵权,请联系作者删除!