use of com.google.gwt.event.shared.HandlerManager in project opennms by OpenNMS.
the class Main method onModuleLoad.
@Override
public void onModuleLoad() {
m_eventBus = new HandlerManager(null);
Application application = new Application(getEventBus());
MapPanel mapPanel = createMap(application);
LocationStatusServiceAsync remoteService = GWT.create(LocationStatusService.class);
RemoteEventService remoteEventService = RemoteEventServiceFactory.getInstance().getRemoteEventService();
application.initialize(new DefaultApplicationView(application, getEventBus(), mapPanel), remoteService, remoteEventService, new DeferredCommandExecutor());
}
use of com.google.gwt.event.shared.HandlerManager in project activityinfo by bedatadriven.
the class FilterPanelSet method ensureHandlers.
private HandlerManager ensureHandlers() {
if (manager == null) {
manager = new HandlerManager(this);
myRegistrations = new ArrayList<HandlerRegistration>();
for (FilterPanel panel : panels) {
HandlerRegistration registration = panel.addValueChangeHandler(new ValueChangeHandler<Filter>() {
@Override
public void onValueChange(ValueChangeEvent<Filter> event) {
// or indicator (reports) is selected
if (event.getSource() instanceof ActivityFilterPanel || event.getSource() instanceof IndicatorFilterPanel) {
clearAttributeAndPartnerFilters();
}
Filter value = composeFilter(new Filter(), null);
Log.debug("FilterPanelSet: Filter changed = " + value);
ValueChangeEvent.fire(FilterPanelSet.this, value);
}
});
myRegistrations.add(registration);
}
}
return manager;
}
use of com.google.gwt.event.shared.HandlerManager in project lienzo-core by ahome-it.
the class Node method addEnsureHandler.
protected final <H extends EventHandler> HandlerRegistration addEnsureHandler(final Type<H> type, final H handler) {
Objects.requireNonNull(type);
Objects.requireNonNull(handler);
HandlerManager hand = m_opts.getHandlerManager();
if (null == hand) {
hand = new HandlerManager(this);
m_opts.setHandlerManager(hand);
}
ALL_EVENTS.add(type);
return hand.addHandler(type, handler);
}
use of com.google.gwt.event.shared.HandlerManager in project kie-wb-common by kiegroup.
the class DecisionServiceSVGShapeViewTest method testAddDividerDragHandler.
@Test
public void testAddDividerDragHandler() {
view.addDividerDragHandler(dragHandler);
final HandlerManager handlerManager = view.getHandlerManager();
assertThat(handlerManager.isEventHandled(MoveDividerStartEvent.TYPE)).isTrue();
assertThat(handlerManager.isEventHandled(MoveDividerStepEvent.TYPE)).isTrue();
assertThat(handlerManager.isEventHandled(MoveDividerEndEvent.TYPE)).isTrue();
assertThat(handlerManager.getHandlerCount(MoveDividerStartEvent.TYPE)).isEqualTo(1);
assertThat(handlerManager.getHandlerCount(MoveDividerStepEvent.TYPE)).isEqualTo(1);
assertThat(handlerManager.getHandlerCount(MoveDividerEndEvent.TYPE)).isEqualTo(1);
handlerManager.getHandler(MoveDividerStartEvent.TYPE, 0).onMoveDividerStart(new MoveDividerStartEvent(view, nodeDragStartEvent));
verify(dragHandler).start(any(DragEvent.class));
handlerManager.getHandler(MoveDividerStepEvent.TYPE, 0).onMoveDividerStep(new MoveDividerStepEvent(view, nodeDragMoveEvent));
verify(dragHandler).handle(any(DragEvent.class));
handlerManager.getHandler(MoveDividerEndEvent.TYPE, 0).onMoveDividerEnd(new MoveDividerEndEvent(view, nodeDragEndEvent));
verify(dragHandler).end(any(DragEvent.class));
}
use of com.google.gwt.event.shared.HandlerManager in project kie-wb-common by kiegroup.
the class DecisionServiceSVGShapeView method addDividerDragHandler.
public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) {
final HandlerManager handlerManager = getHandlerManager();
final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event)));
final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event)));
final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event)));
final HandlerRegistration[] registrations = new HandlerRegistration[] { dragStartRegistration, dragStepRegistration, dragEndRegistration };
getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations);
return this;
}
Aggregations