Bug 144725 [History] Error when opening comparison in Local History
Bug 151921 [History View] Local History Page 'Get Contents' action doesn't get updated based on selection
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
index a5cc949..cbd853e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
@@ -298,13 +298,21 @@
protected void fillTableMenu(IMenuManager manager) {
// file actions go first (view file)
IHistoryPageSite parentSite = getHistoryPageSite();
- manager.add(new Separator(IWorkbenchActionConstants.GROUP_FILE));
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
if (file != null && !parentSite.isModal()){
manager.add(openAction);
manager.add(compareAction);
- manager.add(new Separator());
- manager.add(getContentsAction);
+ ISelection sel = treeViewer.getSelection();
+ if (!sel.isEmpty()) {
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection tempSelection = (IStructuredSelection) sel;
+ if (tempSelection.size() == 1) {
+ manager.add(new Separator("getContents")); //$NON-NLS-1$
+ manager.add(getContentsAction);
+ }
+ }
+ }
}
}