本文整理匯總了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);
}
}