use of com.google.gwt.event.shared.UmbrellaException in project gwt-test-utils by gwt-test-utils.
the class Browser method dispatchEventInternal.
private static void dispatchEventInternal(IsWidget target, Event event) {
try {
// value
if (CheckBox.class.isInstance(target) && event.getTypeInt() == Event.ONCLICK) {
clickOnCheckBox((CheckBox) target);
}
// set the related target
Element relatedTargetElement = JavaScriptObjects.getObject(event, JsoProperties.EVENT_RELATEDTARGET);
if (relatedTargetElement == null) {
switch(event.getTypeInt()) {
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
Widget parent = target.asWidget().getParent();
if (parent != null) {
relatedTargetElement = parent.getElement();
} else {
relatedTargetElement = Document.get().getDocumentElement();
}
JavaScriptObjects.setProperty(event, JsoProperties.EVENT_RELATEDTARGET, relatedTargetElement);
break;
}
}
// fire with bubble support
Set<Widget> applied = new HashSet<Widget>();
dispatchEventWithBubble(target, event, applied);
} catch (UmbrellaException e) {
if (AssertionError.class.isInstance(e.getCause())) {
throw (AssertionError) e.getCause();
} else if (RuntimeException.class.isInstance(e.getCause())) {
throw (RuntimeException) e.getCause();
} else {
throw e;
}
}
}
Aggregations