本文整理汇总了Java中com.google.gwt.user.client.DOM.isOrHasChild方法的典型用法代码示例。如果您正苦于以下问题:Java DOM.isOrHasChild方法的具体用法?Java DOM.isOrHasChild怎么用?Java DOM.isOrHasChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.DOM
的用法示例。
在下文中一共展示了DOM.isOrHasChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLocationValid
import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
/**
* Checks if the location is a valid drop location
*
* @param elementOver
* The element to check
* @return
*/
private boolean isLocationValid(Element elementOver) {
Element weekGridElement = calendarConnector.getWidget().getWeekGrid()
.getElement();
Element timeBarElement = calendarConnector.getWidget().getWeekGrid()
.getTimeBar().getElement();
Element todayBarElement = null;
if (calendarConnector.getWidget().getWeekGrid().hasToday()) {
todayBarElement = calendarConnector.getWidget().getWeekGrid()
.getDateCellOfToday().getTodaybarElement();
}
// drops are not allowed in:
// - weekday header
// - allday event list
// - todaybar
// - timebar
// - items
return DOM.isOrHasChild(weekGridElement, elementOver)
&& !DOM.isOrHasChild(timeBarElement, elementOver)
&& todayBarElement != elementOver
&& (WidgetUtil.findWidget(elementOver,
DateCellDayItem.class) == null);
}
示例2: isLocationValid
import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
/**
* Checks if the one can perform a drop in a element
*
* @param elementOver
* The element to check
* @return
*/
private boolean isLocationValid(Element elementOver) {
Element monthGridElement = calendarConnector.getWidget().getMonthGrid()
.getElement();
// drops are not allowed in:
// - weekday header
// - week number bart
return DOM.isOrHasChild(monthGridElement, elementOver);
}
示例3: onEventPreview
import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public boolean onEventPreview(Event event) {
// Always allow event if capturing is enabled
if (DOM.getCaptureElement() != null) {
return true;
}
// If this is a modal wizard then only allow it if the target element is a child of this wizard
if (modal) {
Element target = DOM.eventGetTarget(event);
return (target != null && DOM.isOrHasChild(getElement(), target));
} else {
return super.onEventPreview(event);
}
}