diff options
author | Thomas Wolf | 2016-04-26 14:27:15 +0000 |
---|---|---|
committer | Thomas Wolf | 2016-04-26 14:27:15 +0000 |
commit | 7a0e68035fd1db82442a5fbd924fe317c8fd579f (patch) | |
tree | eb48e051266ca1e7d96baf13a5c90735b11778dd | |
parent | 34b9ae2577af951a0d2b683229501fafa24e2b08 (diff) | |
download | egit-7a0e68035fd1db82442a5fbd924fe317c8fd579f.tar.gz egit-7a0e68035fd1db82442a5fbd924fe317c8fd579f.tar.xz egit-7a0e68035fd1db82442a5fbd924fe317c8fd579f.zip |
Determine selected resources before opening history view
Otherwise the selection might get lost if it changes due to the history
view opening.
Bug: 492336
Change-Id: I1310f0f4d751086969e14157af41fe7ecadc9d3c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java index 810af15f1f..8a8e889a00 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (C) 2010, 2012 Mathias Kinzler <mathias.kinzler@sap.com> and others. + * Copyright (C) 2010, 2016 Mathias Kinzler <mathias.kinzler@sap.com> and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -9,6 +9,7 @@ * Contributors: * Mathias Kinzler - initial version * François Rey - refactoring as part of gracefully ignoring linked resources + * Thomas Wolf <thomas.wolf@paranor.ch> - Bug 492336 *******************************************************************************/ package org.eclipse.egit.ui.internal.actions; @@ -34,15 +35,15 @@ public class ShowHistoryActionHandler extends RepositoryActionHandler { if (repo == null) { return null; } - IHistoryView view; try { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page != null) { - view = (IHistoryView) page.showView(IHistoryView.VIEW_ID); IResource[] resources = getSelectedResources(event); + IHistoryView view = (IHistoryView) page + .showView(IHistoryView.VIEW_ID); if (resources.length == 1) { view.showHistoryFor(resources[0]); return null; |