scijava / scijava-table

Table structures for SciJava applications
Other
3 stars 1 forks source link

Add UI agnostic table selection listener #12

Open frauzufall opened 4 years ago

frauzufall commented 4 years ago

Continuing the discussion in the forum, citing @ctrueden:

However: I would like to discuss & design a way of using SciJava’s UI-agnostic event mechanism for UI actions. That way, every table viewer implementation would fire the same SciJava events on the EventService , and you could listen for them, without worrying about whether it is a Swing-based UI or not.

Would this be something worth considering?

.. this way I can load a GenericTable table, display it via UIService and filter TableSelectionChangedEvents by event.source == table.

Could this work bi-directional? I could publish my own TableSelectionChangedEvent(myOwnTableSelectionModel, genericTable) the table UI would listen to that and adjust accordingly.

There could be a general SelectionModel<T> and a SelectionChangedEvent, but what would T be then in case of a TableSelectionModel? It should communicate which column and which row is selected, so it could be TableSelectionModel extends SelectionModel<Pair<Column, Integer>>...

imagesc-bot commented 4 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/ij2-interactive-results-table/19705/17