Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Nittka2020-01-04 10:28:07 +0000
committerMatthias Sohn2020-01-05 19:43:54 +0000
commitccdc386a2d01408e19d26296fad26fffa3e3e61a (patch)
tree936240413ef5fa3b4fbc9a323177697d8af2fd55
parentc191dde7a674ca7c0eee0f241db46a39715b1187 (diff)
downloadegit-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.xml3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index 5a0996567..285d375f0 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 b77c02f34..6161668e8 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);

Back to the top