本文整理匯總了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());
}
示例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);
}
示例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();
}
};
}
示例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();
};
}
示例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();
}
}
示例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();
}
}
}
示例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;
}
示例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;
}
}
示例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);
}
示例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));
}
示例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;
}
示例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();
}
示例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();
}
示例14: deregisterHandlers
import com.google.web.bindery.event.shared.HandlerRegistration; //導入方法依賴的package包/類
private void deregisterHandlers()
{
for ( final HandlerRegistration registration : _registrations )
{
registration.removeHandler();
}
_registrations.clear();
}
示例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();
}
};
}