@Test public void testGetOnChangeHandler() { final Event event = mock(Event.class); final Optional<Consumer<Event>> optionalConsumer = Optional.of(consumerEvent); doReturn(optionalConsumer).when(view).getOnValueChangedConsumer(); view.getOnChangeHandler().onInvoke(event); verify(consumerEvent).accept(event); }
Element.OnchangeFn getOnChangeHandler() { return e -> { getOnValueChangedConsumer().ifPresent(consumer -> consumer.accept(e)); return true; }; }
DayTimeSelectorView implements DayTimeSelector.View { Element.OnchangeFn getOnChangeHandler() { return e -> { getOnValueChangedConsumer().ifPresent(consumer -> consumer.accept(e)); return true; }; } }
DayTimeSelectorView implements DayTimeSelector.View { Element.OnchangeFn getOnChangeHandler() { return e -> { getOnValueChangedConsumer().ifPresent(consumer -> consumer.accept(e)); return true; }; } @Inject  DayTimeSelectorView(final HTMLInputElement daysInput,
                               final HTMLInputElement hoursInput,
                               final HTMLInputElement minutesInput,
                               final HTMLInputElement secondsInput); }
DayTimeSelectorView implements DayTimeSelector.View { Element.OnchangeFn getOnChangeHandler() { return e -> { getOnValueChangedConsumer().ifPresent(consumer -> consumer.accept(e)); return true; }; } @Inject  DayTimeSelectorView(final HTMLInputElement daysInput,
                               final HTMLInputElement hoursInput,
                               final HTMLInputElement minutesInput,
                               final HTMLInputElement secondsInput); @Override void init(final DayTimeSelector presenter); @PostConstruct void setupEventHandlers(); @Override DayTimeValue getValue(); @Override void setValue(final DayTimeValue value); @Override void setOnValueChanged(final Consumer<Event> onValueChangedConsumer); @Override void setOnValueInputBlur(final Consumer<BlurEvent> onValueInputBlurConsumer); @EventHandler("days-input") void onDaysInputBlurEvent(final BlurEvent blurEvent); @EventHandler("hours-input") void onHoursInputBlurEvent(final BlurEvent blurEvent); @EventHandler("minutes-input") void onMinutesInputBlurEvent(final BlurEvent blurEvent); @EventHandler("seconds-input") void onSecondsInputBlurEvent(final BlurEvent blurEvent); @Override void select(); }
DayTimeSelectorView implements DayTimeSelector.View { Element.OnchangeFn getOnChangeHandler() { return e -> { getOnValueChangedConsumer().ifPresent(consumer -> consumer.accept(e)); return true; }; } @Inject  DayTimeSelectorView(final HTMLInputElement daysInput,
                               final HTMLInputElement hoursInput,
                               final HTMLInputElement minutesInput,
                               final HTMLInputElement secondsInput); @Override void init(final DayTimeSelector presenter); @PostConstruct void setupEventHandlers(); @Override DayTimeValue getValue(); @Override void setValue(final DayTimeValue value); @Override void setOnValueChanged(final Consumer<Event> onValueChangedConsumer); @Override void setOnValueInputBlur(final Consumer<BlurEvent> onValueInputBlurConsumer); @EventHandler("days-input") void onDaysInputBlurEvent(final BlurEvent blurEvent); @EventHandler("hours-input") void onHoursInputBlurEvent(final BlurEvent blurEvent); @EventHandler("minutes-input") void onMinutesInputBlurEvent(final BlurEvent blurEvent); @EventHandler("seconds-input") void onSecondsInputBlurEvent(final BlurEvent blurEvent); @Override void select();  }