@Override public Subscription addLayoutClickListener(Consumer<LayoutClickEvent> listener) { if (layoutClickListener == null) { layoutClickListener = event -> { Component childComponent = findChildComponent(event.getChildComponent()); MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event); LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails); publish(LayoutClickEvent.class, layoutClickEvent); }; component.addLayoutClickListener(layoutClickListener); } getEventHub().subscribe(LayoutClickEvent.class, listener); return () -> removeLayoutClickListener(listener); }
@Override public Subscription addLayoutClickListener(Consumer<LayoutClickEvent> listener) { if (layoutClickListener == null) { layoutClickListener = event -> { Component childComponent = findChildComponent(event.getChildComponent()); MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event); LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails); publish(LayoutClickEvent.class, layoutClickEvent); }; component.addLayoutClickListener(layoutClickListener); } getEventHub().subscribe(LayoutClickEvent.class, listener); return () -> removeLayoutClickListener(listener); }
@Override public Subscription addLayoutClickListener(Consumer<LayoutClickEvent> listener) { if (layoutClickListener == null) { layoutClickListener = event -> { Component childComponent = findChildComponent(this, event.getChildComponent()); MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event); LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails); publish(LayoutClickEvent.class, layoutClickEvent); }; component.addLayoutClickListener(layoutClickListener); } getEventHub().subscribe(LayoutClickEvent.class, listener); return () -> removeLayoutClickListener(listener); }
@Override public Subscription addLayoutClickListener(Consumer<LayoutClickEvent> listener) { if (layoutClickListener == null) { layoutClickListener = event -> { Component childComponent = findChildComponent(this, event.getChildComponent()); MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event); LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails); publish(LayoutClickEvent.class, layoutClickEvent); }; component.addLayoutClickListener(layoutClickListener); } return getEventHub().subscribe(LayoutClickEvent.class, listener); }