本文整理匯總了Java中com.google.gwt.event.logical.shared.ValueChangeEvent.fireIfNotEqual方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueChangeEvent.fireIfNotEqual方法的具體用法?Java ValueChangeEvent.fireIfNotEqual怎麽用?Java ValueChangeEvent.fireIfNotEqual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.event.logical.shared.ValueChangeEvent
的用法示例。
在下文中一共展示了ValueChangeEvent.fireIfNotEqual方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBrowserEvent
import com.google.gwt.event.logical.shared.ValueChangeEvent; //導入方法依賴的package包/類
/**
* Overridden to send ValueChangeEvents only when appropriate.
*/
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
case Event.ONBLUR:
case Event.ONKEYDOWN:
// Note the old value for onValueChange purposes (in ONCLICK case)
oldValue = getValue();
break;
case Event.ONCLICK:
EventTarget target = event.getEventTarget();
if (Element.is(target) && labelElem.isOrHasChild(Element.as(target))) {
// They clicked the label. Note our pre-click value, and
// short circuit event routing so that other click handlers
// don't hear about it
oldValue = getValue();
return;
}
// It's not the label. Let our handlers hear about the
// click...
super.onBrowserEvent(event);
// ...and now maybe tell them about the change
ValueChangeEvent.fireIfNotEqual(AccessibleRadioButton.this, oldValue, getValue());
return;
}
super.onBrowserEvent(event);
}