diff options
author | Alexander Nittka | 2020-01-04 10:28:07 +0000 |
---|---|---|
committer | Matthias Sohn | 2020-01-05 19:43:54 +0000 |
commit | ccdc386a2d01408e19d26296fad26fffa3e3e61a (patch) | |
tree | 936240413ef5fa3b4fbc9a323177697d8af2fd55 | |
parent | c191dde7a674ca7c0eee0f241db46a39715b1187 (diff) | |
download | egit-ccdc386a2d01408e19d26296fad26fffa3e3e61a.tar.gz egit-ccdc386a2d01408e19d26296fad26fffa3e3e61a.tar.xz egit-ccdc386a2d01408e19d26296fad26fffa3e3e61a.zip |
Switch branch from repository group
Enable the switch menu for mixed selections of repositories and/or
repository groups
Bug:558561
Change-Id: Ib76cb558100a911dca3addfd1e57a66eb8a9214d
Signed-off-by: Alexander Nittka <alex@nittka.de>
-rw-r--r-- | org.eclipse.egit.ui/plugin.xml | 3 | ||||
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml index 5a09965678..285d375f0c 100644 --- a/org.eclipse.egit.ui/plugin.xml +++ b/org.eclipse.egit.ui/plugin.xml @@ -4133,6 +4133,9 @@ <and> <or> <instanceof + value="org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode"> + </instanceof> + <instanceof value="org.eclipse.egit.ui.internal.repository.tree.RepositoryNode"> </instanceof> <instanceof diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java index b77c02f344..6161668e85 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java @@ -376,6 +376,10 @@ public class SelectionUtils { @NonNull IStructuredSelection selection) { Set<Object> result = new HashSet<>(); for (Object o : selection.toList()) { + if (o instanceof RepositoryGroupNode) { + result.addAll(((RepositoryGroupNode) o).getRepositories()); + continue; + } Repository r = Adapters.adapt(o, Repository.class); if (r != null) { result.add(r); |