當前位置: 首頁>>代碼示例>>Java>>正文


Java HandlerRegistration類代碼示例

本文整理匯總了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();
  };
}
 
開發者ID:tbroyer,項目名稱:gwt-places,代碼行數:29,代碼來源:PlaceHistoryHandler.java

示例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");
  };
}
 
開發者ID:tbroyer,項目名稱:gwt-places,代碼行數:8,代碼來源:MockPlaceControllerDelegate.java

示例3: addValueChangeHandler

import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
  return handlers.addHandler(ValueChangeEvent.getType(), handler);
}
 
開發者ID:tbroyer,項目名稱:gwt-history,代碼行數:5,代碼來源:History.java

示例4: addValueChangeHandler

import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(
    ValueChangeHandler<String> valueChangeHandler) {
  return History.addValueChangeHandler(valueChangeHandler);
}
 
開發者ID:tbroyer,項目名稱:gwt-places,代碼行數:6,代碼來源:PlaceHistoryHandler.java

示例5: addWindowClosingHandler

import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addWindowClosingHandler(Window.ClosingHandler handler) {
  return Window.addWindowClosingHandler(handler);
}
 
開發者ID:tbroyer,項目名稱:gwt-places,代碼行數:5,代碼來源:PlaceController.java

示例6: addValueChangeHandler

import org.gwtproject.event.shared.HandlerRegistration; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(
    ValueChangeHandler<String> valueChangeHandler) {
  this.handler = valueChangeHandler;
  return registration;
}
 
開發者ID:tbroyer,項目名稱:gwt-places,代碼行數:7,代碼來源:PlaceHistoryHandlerTest.java


注:本文中的org.gwtproject.event.shared.HandlerRegistration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。