It would be nice to have the possibility to always include a button for a certain result type (e.g. ModuleSearchResult) but to disable it (i.e. show it greyed-out) according to the fulfillment of some additional requirements (e.g. if a specific module doesn't support a given input type).
IMHO, indicating that a certain action is available in principle, but not for the currently highlighted item, would allow for a more consistent user experience.
Currently, the
SearchActionFactory#supports
method is used to decide if aSearchAction
is to be included in a result's actions:https://github.com/scijava/scijava-search/blob/6105bdd562ae8e36d4170143e5d654a38b757639/src/main/java/org/scijava/search/SearchService.java#L61-L70
... and a button is added for each supported action:
https://github.com/scijava/scijava-search/blob/6105bdd562ae8e36d4170143e5d654a38b757639/src/main/java/org/scijava/ui/swing/search/SwingSearchBar.java#L514-L534
It would be nice to have the possibility to always include a button for a certain result type (e.g.
ModuleSearchResult
) but to disable it (i.e. show it greyed-out) according to the fulfillment of some additional requirements (e.g. if a specific module doesn't support a given input type).IMHO, indicating that a certain action is available in principle, but not for the currently highlighted item, would allow for a more consistent user experience.