Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2010-10-12 11:51:47 -0400
committerTomasz Zarna2010-10-12 11:51:47 -0400
commit0b971c76db333f19614990e7ac0b4e8e2b0a1d50 (patch)
tree930fae04e99f9bda413d56ce057549ecf8e52c8b /bundles
parentca9e972510147938676ce06900c5e1cadab05c8e (diff)
downloadeclipse.platform.team-0b971c76db333f19614990e7ac0b4e8e2b0a1d50.tar.gz
eclipse.platform.team-0b971c76db333f19614990e7ac0b4e8e2b0a1d50.tar.xz
eclipse.platform.team-0b971c76db333f19614990e7ac0b4e8e2b0a1d50.zip
bug 321575: [Sync view] 'Show In' context menu item not available on multi-selection
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java35
2 files changed, 25 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index b51cd55a6..efd2a8e28 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -479,7 +479,14 @@
<instanceof value="org.eclipse.team.core.mapping.ISynchronizationContext"/>
</or>
</enablement>
- <actionProvider class="org.eclipse.team.internal.ui.mapping.ResourceModelActionProvider"/>
+ <actionProvider
+ class="org.eclipse.team.internal.ui.mapping.ResourceModelActionProvider">
+ <enablement>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </enablement>
+ </actionProvider>
<commonSorter
class="org.eclipse.team.internal.ui.mapping.ResourceModelSorter"
id="org.eclipse.team.ui.resourceSorter"/>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
index f2157f877..a8e653aba 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
@@ -124,14 +124,16 @@ public class OpenWithActionGroup extends ActionGroup {
if (openInCompareAction != null) {
menu.appendToGroup(groupId, openInCompareAction);
}
+ }
- for (int i = 0; i < resources.length; i++) {
- if (!resources[i].exists()) {
- // Only support non-compare actions if all files exist.
- return;
- }
+ for (int i = 0; i < resources.length; i++) {
+ if (!resources[i].exists()) {
+ // Only support non-compare actions if all resources exist.
+ return;
}
+ }
+ if (allFiles) {
if (openFileAction != null) {
openFileAction.selectionChanged(selection);
menu.appendToGroup(groupId, openFileAction);
@@ -149,19 +151,16 @@ public class OpenWithActionGroup extends ActionGroup {
}
}
- // Add "Show In" submenu, available for projects and folders, but only if one is selected.
- if (resources.length == 1) {
- IWorkbenchSite ws = getSite().getWorkbenchSite();
- if (ws != null) {
- MenuManager showInSubmenu = new MenuManager(
- getShowInMenuLabel(),
- IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU);
- IContributionItem showInMenu = ContributionItemFactory.VIEWS_SHOW_IN
- .create(ws.getWorkbenchWindow());
- showInSubmenu.add(showInMenu);
- menu.appendToGroup(groupId, showInSubmenu);
- }
- }
+ // Add "Show In" submenu, available for any number of resources
+ IWorkbenchSite ws = getSite().getWorkbenchSite();
+ if (ws != null) {
+ MenuManager showInSubmenu = new MenuManager(getShowInMenuLabel(),
+ IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU);
+ IContributionItem showInMenu = ContributionItemFactory.VIEWS_SHOW_IN
+ .create(ws.getWorkbenchWindow());
+ showInSubmenu.add(showInMenu);
+ menu.appendToGroup(groupId, showInSubmenu);
+ }
}
/**

Back to the top