本文整理匯總了Java中org.gwtproject.event.shared.HandlerRegistration.removeHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java HandlerRegistration.removeHandler方法的具體用法?Java HandlerRegistration.removeHandler怎麽用?Java HandlerRegistration.removeHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gwtproject.event.shared.HandlerRegistration
的用法示例。
在下文中一共展示了HandlerRegistration.removeHandler方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: register
import org.gwtproject.event.shared.HandlerRegistration; //導入方法依賴的package包/類
/**
* Initialize this place history handler.
*
* @return a registration object to de-register the handler
*/
public HandlerRegistration register(
PlaceController placeController, EventBus eventBus, Place defaultPlace) {
this.placeController = placeController;
this.defaultPlace = defaultPlace;
final HandlerRegistration placeReg =
eventBus.addHandler(
PlaceChangeEvent.TYPE,
event -> {
Place newPlace = event.getNewPlace();
historian.newItem(tokenForPlace(newPlace), false);
});
final HandlerRegistration historyReg =
historian.addValueChangeHandler(event -> handleHistoryToken(event.getValue()));
return () -> {
PlaceHistoryHandler.this.defaultPlace = Place.NOWHERE;
PlaceHistoryHandler.this.placeController = null;
placeReg.removeHandler();
historyReg.removeHandler();
};
}