Skip to content

Add UI agnostic table selection listener #12

@frauzufall

Description

@frauzufall

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?

  • add a TableSelectionModel in scijava-table
  • publish TableSelectionChangedEvent(TableSelectionModel model, Table source) from the SwingTableDisplayPanel in scijava-swing-ui via EventService

.. 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>> ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions