diff options
author | Robin Stocker | 2014-09-08 10:19:28 +0000 |
---|---|---|
committer | Robin Stocker | 2014-09-08 10:24:56 +0000 |
commit | 494df40bfe4336ba71d8e4526555e4910de479ca (patch) | |
tree | 2839bacbab831651c12bdb80fa58052319d2f7f7 | |
parent | 81eb80f6df3bf2dc6fbabc7d53d5627d86fd4a55 (diff) | |
download | egit-494df40bfe4336ba71d8e4526555e4910de479ca.tar.gz egit-494df40bfe4336ba71d8e4526555e4910de479ca.tar.xz egit-494df40bfe4336ba71d8e4526555e4910de479ca.zip |
Add Team > "Show in History/Repositories View" for working sets
"Show in History" will focus history on all the projects that are
contained in the working set. For Show in Repositories View, it selects
the repository, as I felt that having all projects selected was a bit
confusing.
Bug: 311299
Change-Id: I81ed28ddcfac0174721d07d8cbea9540e36333e2
Signed-off-by: Robin Stocker <robin@nibor.org>
5 files changed, 37 insertions, 76 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml index a6db70c307..bca578df49 100644 --- a/org.eclipse.egit.ui/plugin.xml +++ b/org.eclipse.egit.ui/plugin.xml @@ -141,22 +141,6 @@ overrideActionId="org.eclipse.team.ui.applyPatch"> </action> <action - class="org.eclipse.egit.ui.internal.actions.ShowHistoryAction" - definitionId="org.eclipse.egit.ui.team.ShowHistory" - icon="icons/obj16/history.gif" - id="org.eclipse.egit.ui.internal.actions.ShowHistoryActionHandler" - label="%ShowResourceInHistoryAction_label" - menubarPath="team.main/group9"> - </action> - <action - class="org.eclipse.egit.ui.internal.actions.ShowRepositoriesViewAction" - definitionId="org.eclipse.egit.ui.team.ShowRepositoriesView" - icon="icons/eview16/repo_rep.gif" - id="org.eclipse.egit.ui.internal.actions.ShowRepositoriesViewAction" - label="%ShowRepositoryAction_label" - menubarPath="team.main/group9"> - </action> - <action class="org.eclipse.egit.ui.internal.actions.MergeToolAction" definitionId="org.eclipse.egit.ui.team.MergeTool" icon="icons/obj16/mergetool.gif" @@ -187,7 +171,7 @@ definitionId="org.eclipse.egit.ui.team.ShowBlame" label="%ShowBlameAction_label" icon="icons/etool16/annotate.gif" - menubarPath="team.main/group9"> + menubarPath="team.main/showAnnotationsGroup"> </action> </objectContribution> </extension> @@ -1562,16 +1546,9 @@ class="org.eclipse.egit.ui.internal.actions.ShowHistoryActionHandler"> </class> <activeWhen> - <and> - <count - value="1"> - </count> - <iterate> - <adapt - type="org.eclipse.core.resources.IResource"> - </adapt> - </iterate> - </and> + <test + property="GitSelection.resourcesSingleRepository"> + </test> </activeWhen> </handler> <handler @@ -4172,6 +4149,32 @@ name="group9" visible="true"> </separator> + <command + commandId="org.eclipse.egit.ui.team.ShowHistory" + label="%ShowResourceInHistoryAction_label" + style="push"> + <visibleWhen + checkEnabled="false"> + <test + property="GitSelection.resourcesSingleRepository"> + </test> + </visibleWhen> + </command> + <command + commandId="org.eclipse.egit.ui.team.ShowRepositoriesView" + label="%ShowRepositoryAction_label" + style="push"> + <visibleWhen + checkEnabled="false"> + <test + property="GitSelection.resourcesSingleRepository"> + </test> + </visibleWhen> + </command> + <separator + name="showAnnotationsGroup" + visible="false"> + </separator> <separator name="group10" visible="true"> diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ActionCommands.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ActionCommands.java index fd72327368..fb5ff006b1 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ActionCommands.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ActionCommands.java @@ -110,12 +110,6 @@ public class ActionCommands { /** "Rebase" action command id */ public static final String REBASE_ACTION = "org.eclipse.egit.ui.team.Rebase"; //$NON-NLS-1$ - /** "Show History" action command id */ - public static final String SHOW_HISTORY = "org.eclipse.egit.ui.team.ShowHistory"; //$NON-NLS-1$ - - /** "Show Repository View" action command id */ - public static final String SHOW_REPO_VIEW = "org.eclipse.egit.ui.team.ShowRepositoriesView"; //$NON-NLS-1$ - /** "Stash Changes" action command id */ public static final String STASH_CREATE = "org.eclipse.egit.ui.team.stash.create"; //$NON-NLS-1$ diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryAction.java deleted file mode 100644 index 4a8535b91a..0000000000 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryAction.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com> - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.egit.ui.internal.actions; - - -/** - * An action to show the history for a resource. - */ -public class ShowHistoryAction extends RepositoryAction { - /** - * - */ - public ShowHistoryAction() { - super(ActionCommands.SHOW_HISTORY, new ShowHistoryActionHandler()); - } -} diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewAction.java deleted file mode 100644 index c328e7f175..0000000000 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewAction.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com> - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.egit.ui.internal.actions; - -/** - * An action to show the repositories view for a resource. - */ -public class ShowRepositoriesViewAction extends RepositoryAction { - /** - * - */ - public ShowRepositoriesViewAction() { - super(ActionCommands.SHOW_REPO_VIEW, new ShowRepositoriesViewActionHandler()); - } -} diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java index 51aa3e1425..77847c553b 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java @@ -65,6 +65,7 @@ import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNodeType; import org.eclipse.egit.ui.internal.repository.tree.StashedCommitNode; import org.eclipse.egit.ui.internal.repository.tree.TagNode; import org.eclipse.egit.ui.internal.repository.tree.WorkingDirNode; +import org.eclipse.egit.ui.internal.selection.SelectionUtils; import org.eclipse.egit.ui.internal.trace.GitTraceLocation; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; @@ -756,6 +757,12 @@ public class RepositoriesView extends CommonNavigator implements IShowInSource, showPaths(paths); return true; } + + Repository repository = SelectionUtils.getRepository(ss); + if (repository != null) { + showRepository(repository); + return true; + } } if(context.getInput() instanceof IFileEditorInput) { IFileEditorInput input = (IFileEditorInput) context.getInput(); |