bndtools
bndtools copied to clipboard
Repositories-View doesnt handle multiple selections
When selecting multiple entries in the repositories-view and calling an action from the context-menu, the action is only applied to the first element which was selected.
Reproduce:
- select multiple entries from a JPM4J repo
- context-menu -> Attach Sources
Only one dependency got updated with the sources.
This can become quite tedious, for example when you need to update to a new version 5x which is followed by attaching sources 5x.
A fix must also check which actions are applicable to all selected elements (otherwise disable).
Need a PR.
This is non-trivial. I have a POC in a branch, but it's a bit ugly. The problem stems from the fact that some of the actions returned by the Actionable interface are implicitly singular (Copy Reference from the JPM repository as an example).
Another problem as it relates specifically to the JPM repository is that the Attach Sources context menu is at the version level, so in order to actually make this work you would have to expand each of the bundles and Ctrl-Click on each of the versions you wanted to attach sources for. This works, but it's a bit clunky and I'm not sure how much it improves the user experience.
It may make more sense to promote group actions to the repository plugin itself. Something like 'Attach Sources to All'
Thanks for the investigation Seen.
Would it be easier if some common actions can be configured, for example using a preference "attach sources automatically" as Maven-M2E does? This option could be applied to JPM4J as well as on BndMavenRepositories.
My understanding is that the JPM repository will soon be deprecated, so I'm not sure how much work will be put into that repository plugin. There is issue #1387 which relates to the MavenBndRepository and automatically attaching sources and javadoc where available.
Deprecating JPM would be a pitty: I really enjoy its features like querying for packages (rather than modules) and filtering out artifacts that do not provide OSGI metadata.
If implementing this issue would be rather dirty and if #1387 solves at least the issue for attaching source, the value in this issue is rather low. I wouldnt object if you prefer to close this one, though there are still actions like "delete" :-)