本文整理匯總了Java中org.gwtproject.event.shared.HandlerRegistration類的典型用法代碼示例。如果您正苦於以下問題:Java HandlerRegistration類的具體用法?Java HandlerRegistration怎麽用?Java HandlerRegistration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HandlerRegistration類屬於org.gwtproject.event.shared包,在下文中一共展示了HandlerRegistration類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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();
};
}
示例2: addWindowClosingHandler
import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addWindowClosingHandler(ClosingHandler handler) {
this.handler = handler;
return () -> {
throw new UnsupportedOperationException("Auto-generated method stub");
};
}
示例3: addValueChangeHandler
import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
return handlers.addHandler(ValueChangeEvent.getType(), handler);
}
示例4: addValueChangeHandler
import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(
ValueChangeHandler<String> valueChangeHandler) {
return History.addValueChangeHandler(valueChangeHandler);
}
示例5: addWindowClosingHandler
import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addWindowClosingHandler(Window.ClosingHandler handler) {
return Window.addWindowClosingHandler(handler);
}
示例6: addValueChangeHandler
import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(
ValueChangeHandler<String> valueChangeHandler) {
this.handler = valueChangeHandler;
return registration;
}