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


Java HandlerRegistration.removeHandler方法代碼示例

本文整理匯總了Java中com.google.web.bindery.event.shared.HandlerRegistration.removeHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java HandlerRegistration.removeHandler方法的具體用法?Java HandlerRegistration.removeHandler怎麽用?Java HandlerRegistration.removeHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.web.bindery.event.shared.HandlerRegistration的用法示例。


在下文中一共展示了HandlerRegistration.removeHandler方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureSwipe

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
private void configureSwipe() {
    if (isSwipeDisabled()) {
        for (HandlerRegistration registration : touchHandlers) {
            registration.removeHandler();
        }
        touchHandlers.clear();
        setVisiblePageCount(1);
    } else {
        RootPanel rootPanel = rootPanelDelegate.getRootPanel();
        HasTouchHandlers touchHandler = touchRecognitionFactory.getTouchRecognition(rootPanel, false);
        touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_START)));
        touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_MOVE)));
        touchHandlers.add(touchHandler.addTouchHandler(multiPageTouchHandler, TouchEvent.getType(TouchTypes.TOUCH_END)));
        setVisiblePageCount(3);
    }
    panelsCache.setSwipeType(swipeType.get());
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:18,代碼來源:MultiPageController.java

示例2: removeHandler

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Test
public void removeHandler() {
    prepare();
    // handler globalny
    HandlerRegistration asyncRegistration = eventsBus.addAsyncHandler(PlayerEvent.getType(PlayerEventTypes.CREATE_MEDIA_WRAPPER), eventHandler);
    // handler na scope
    HandlerRegistration registration = eventsBus
            .addHandler(PlayerEvent.getType(PlayerEventTypes.CREATE_MEDIA_WRAPPER), scopeEventHandler, new CurrentPageScope(0));
    eventsBus.fireEvent(playerEvent);
    Mockito.verify(eventHandler, Mockito.times(1)).onPlayerEvent(playerEvent);
    Mockito.verify(scopeEventHandler, Mockito.times(1)).onPlayerEvent(playerEvent);
    asyncRegistration.removeHandler();
    registration.removeHandler();
    eventsBus.fireEvent(playerEvent);
    Mockito.verify(eventHandler, Mockito.times(1)).onPlayerEvent(playerEvent);
    Mockito.verify(scopeEventHandler, Mockito.times(1)).onPlayerEvent(playerEvent);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:18,代碼來源:EventBusJUnitTest.java

示例3: addConnectivityHandler

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Override
public final HandlerRegistration addConnectivityHandler(final ConnectivityEvent.Handler handler) {
	EventListener el = new EventListener() {
		@Override
		public void onBrowserEvent(Event event) {
			handler.onConnectivity((ConnectivityEventJsoImpl) event.cast());
		}
	};
	
	final HandlerRegistration hr1 = register(this, "online", el);
	final HandlerRegistration hr2 = register(this, "offline", el);
	
	return new HandlerRegistration() {
		
		@Override
		public void removeHandler() {
			hr1.removeHandler();
			hr2.removeHandler();
		}
	};
}
 
開發者ID:metteo,項目名稱:gwt-worker,代碼行數:22,代碼來源:AbstractWorkerScopeJsoImpl.java

示例4: initialize

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
/**
     * Initialize this place history handler.
     * @return a registration object to de-register the handler
     */
    public HandlerRegistration initialize(final PlaceManager placeManager,
                                          final EventBus eventBus,
                                          final PlaceRequest defaultPlaceRequest) {
        this.placeManager = placeManager;
        this.defaultPlaceRequest = defaultPlaceRequest;

        final HandlerRegistration historyReg =
                historian.addValueChangeHandler(event -> {
                    //Temporarily disabled until https://issues.jboss.org/browse/AF-523 is ready
//                    handleHistoryToken(event.getValue());
                });

        return () -> {
            PlaceHistoryHandler.this.defaultPlaceRequest = DefaultPlaceRequest.NOWHERE;
            PlaceHistoryHandler.this.placeManager = null;
            historyReg.removeHandler();
        };
    }
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:PlaceHistoryHandler.java

示例5: unbind

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
public void unbind()
{
  if ( bound )
  {
    bound = false;

    for ( HandlerRegistration reg : handlerRegistrations )
    {
      reg.removeHandler();
    }
    handlerRegistrations.clear();

    onUnbind();
  }

}
 
開發者ID:realityforge,項目名稱:gwt-presenter,代碼行數:17,代碼來源:BasicPresenter.java

示例6: removeHandler

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
protected void removeHandler(MediaEventTypes mediaEventType) {
    Set<Entry<MediaEventTypes, HandlerRegistration>> handleRegistrationsEntrySet = handlerRegistrations.entrySet();
    for (Entry<MediaEventTypes, HandlerRegistration> handlerRegistrationEntry : handleRegistrationsEntrySet) {
        MediaEventTypes entryMediaEventType = handlerRegistrationEntry.getKey();
        if (entryMediaEventType.equals(mediaEventType)) {
            HandlerRegistration handlerRegistration = handlerRegistrationEntry.getValue();
            handlerRegistration.removeHandler();
        }
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:11,代碼來源:AbstractHTML5MediaWrapper.java

示例7: remove

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
/**
 * Removes a field from the validation group.
 *
 * @param <T>   the generic type
 * @param field the field
 * @return true, if successful
 */
public <T extends Widget & HasValidators<?>> boolean remove(final T field) {
    fields.remove(field);
    HandlerRegistration reg = registrations.remove(field);
    if (reg != null) {
        reg.removeHandler();
        return true;
    }
    return false;
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:17,代碼來源:GroupValidator.java

示例8: removeEditor

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Override
public void removeEditor(EditorPartPresenter editor) {
  HandlerRegistration handlerRegistration = synchronizedEditors.remove(editor);
  if (handlerRegistration != null) {
    handlerRegistration.removeHandler();
  }

  if (groupLeaderEditor == editor) {
    groupLeaderEditor = null;
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:12,代碼來源:EditorGroupSynchronizationImpl.java

示例9: removeHandler

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Override
public void removeHandler() {
    if (handlerRegistrations != null) {
        // If there were other handlers bound to this one, then remove them
        for (HandlerRegistration handlerRegistration : handlerRegistrations) {
            handlerRegistration.removeHandler();
        }
    }
    binder.unbind(id);
}
 
開發者ID:growbit,項目名稱:turbogwt-databind,代碼行數:11,代碼來源:BinderRegistration.java

示例10: doTestUnbindWidget

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
private void doTestUnbindWidget(BindWidgetCallback callback) {
    /*
    The unbinding must be tested performing both #DatabindViewEngine.unbind and #HandlerRegistration.removeHandler.
     */
    final ViewEngine engine = new ViewEngine();

    final String someProperty = "someProperty";
    final String somePropertyInitialValue = "initialValue";

    final String otherProperty = "otherProperty";
    final Double otherPropertyInitialValue = 3.42;

    final HasValueMock<String> somePropertyWidget = new HasValueMock<String>();
    somePropertyWidget.setValue(somePropertyInitialValue);

    final HasValueMock<Double> otherPropertyWidget = new HasValueMock<Double>();
    otherPropertyWidget.setValue(otherPropertyInitialValue);

    // Bind the widget to the view
    HandlerRegistration somePropertyHandlerRegistration = callback.bind(engine, someProperty, somePropertyWidget);
    HandlerRegistration otherPropertyHandlerRegistration = callback.bind(engine, otherProperty,
            otherPropertyWidget);

    // Assert handler registrations created
    assertNotNull(somePropertyHandlerRegistration);
    assertNotNull(otherPropertyHandlerRegistration);

    // Assert unbind via handler registration
    somePropertyHandlerRegistration.removeHandler();
    assertFalse(engine.unbind(someProperty));

    // Assert unbind via engine
    assertTrue(engine.unbind(otherProperty));
    assertFalse(engine.unbind(otherProperty));
}
 
開發者ID:growbit,項目名稱:turbogwt-databind,代碼行數:36,代碼來源:DatabindViewEngineTest.java

示例11: clear

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
/**
 * Cancels all HandlerRegistrations added via {@link #addHandlerRegistration(HandlerRegistration)},
 * detaches this Presenter from the View and invalidates {@link #getEventBus()} and {@link #display()} methods.
 */
@SuppressWarnings("unchecked")
private void clear() {
    for (HandlerRegistration handler : handlers) {
        handler.removeHandler();
    }
    handlers.clear();
    view.setPresenter(null);
    panel = null;
    eventBus = null;
}
 
開發者ID:growbit,項目名稱:turbogwt,代碼行數:15,代碼來源:AbstractPresenter.java

示例12: removeHandler

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Override
public void removeHandler() {
	for (HandlerRegistration handler : this.handlers) {
		handler.removeHandler();
	}
	this.handlers.clear();
}
 
開發者ID:Putnami,項目名稱:putnami-web-toolkit,代碼行數:8,代碼來源:HandlerRegistrationCollection.java

示例13: onDetach

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
@Override
protected void onDetach() {
    for (HandlerRegistration reg : handlerRegistrations) {
        if (reg != null)
            reg.removeHandler();
    }
    handlerRegistrations.clear();
    super.onDetach();
}
 
開發者ID:inepex,項目名稱:ineform,代碼行數:10,代碼來源:HandlerAwareFlowPanel.java

示例14: deregisterHandlers

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
private void deregisterHandlers()
{
  for ( final HandlerRegistration registration : _registrations )
  {
    registration.removeHandler();
  }
  _registrations.clear();
}
 
開發者ID:realityforge,項目名稱:gwt-packetio-example,代碼行數:9,代碼來源:Example.java

示例15: register

import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
/**
 * Register a serializer/deserializer of the given type.
 *
 * @param serdes    The serializer/deserializer of T.
 * @param <T>       The type of the object to be serialized/deserialized.
 *
 * @return  The {@link HandlerRegistration} object, capable of cancelling this HandlerRegistration
 *          to the {@link SerdesManagerImpl}.
 */
public <T> HandlerRegistration register(Serdes<T> serdes) {
    final HandlerRegistration desReg = register((Deserializer<T>) serdes);
    final HandlerRegistration serReg = register((Serializer<T>) serdes);

    return new HandlerRegistration() {
        @Override
        public void removeHandler() {
            desReg.removeHandler();
            serReg.removeHandler();
        }
    };
}
 
開發者ID:reinert,項目名稱:requestor,代碼行數:22,代碼來源:SerdesManagerImpl.java


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