Click event source
Similar to HoverEventSource, it would be nice to be able to use arbitrary objects as click events. Some thought would need to go into the implementation of this, as some objects (e.g. commands) would have two obviously different applicable click events.
Perhaps something along the lines of object.asClickEvent(ClickEvent.Action.RUN_COMMAND). This would, however, raise the issue that you could create invalid click events. Alternative solutions could be providing interfaces for each type of click event, e.g. object.asRunCommandClickEvent().
Would appreciate any thoughts/ideas!
Maybe just a "copy" of HoverEventSource?
Maybe just a "copy" of
HoverEventSource?
Yes, implementation could provide a "default" click event and people could use the unary operator method to change the action if they wanted.