diff options
author | Thomas Wolf | 2016-10-20 21:02:27 +0000 |
---|---|---|
committer | Matthias Sohn | 2016-12-02 23:56:13 +0000 |
commit | b979970e6d36e7b728f5ca7f39056e8096925d7e (patch) | |
tree | 4d6cbad8b659b134db69624c5bc47fccfc30ffec | |
parent | a44e7448f1f5a036223b57432d8866c49412dc81 (diff) | |
download | egit-b979970e6d36e7b728f5ca7f39056e8096925d7e.tar.gz egit-b979970e6d36e7b728f5ca7f39056e8096925d7e.tar.xz egit-b979970e6d36e7b728f5ca7f39056e8096925d7e.zip |
Clean up "Replace With..." actions
Replace deprecated <objectContribution>s by command/handler combos.
Remove now unused legacy actions. Remove defaultHandlers.
Bug: 495064
Change-Id: I1968ba9b79172465c2704a100309b4c64a645acc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 files changed, 26 insertions, 90 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml index c6b4a34ac1..4ec8080628 100644 --- a/org.eclipse.egit.ui/plugin.xml +++ b/org.eclipse.egit.ui/plugin.xml @@ -50,16 +50,6 @@ value="org.eclipse.team.core.repository=org.eclipse.egit.core.GitProvider"> </filter> <action - class="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitAction" - id="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitAction" - label="%ReplaceWithCommitAction_label" - menubarPath="replaceWithMenu/gitReplaceWithGroup2"/> - <action - class="org.eclipse.egit.ui.internal.actions.ReplaceWithRefAction" - id="org.eclipse.egit.ui.internal.actions.ReplaceWithRefAction" - label="%ReplaceWithRefAction_label" - menubarPath="replaceWithMenu/gitReplaceWithGroup2"/> - <action class="org.eclipse.egit.ui.internal.actions.ApplyPatchAction" definitionId="org.eclipse.egit.ui.team.ApplyPatch" enablesFor="*" @@ -2230,6 +2220,24 @@ <test property="GitSelection.resourcesAllInRepository" args="isSafe" /> </activeWhen> </handler> + <handler + commandId="org.eclipse.egit.ui.team.ReplaceWithCommit"> + <class + class="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitActionHandler"> + </class> + <activeWhen> + <test property="GitSelection.resourcesSingleRepository" args="isSafe" /> + </activeWhen> + </handler> + <handler + commandId="org.eclipse.egit.ui.team.ReplaceWithRef"> + <class + class="org.eclipse.egit.ui.internal.actions.ReplaceWithRefActionHandler"> + </class> + <activeWhen> + <test property="GitSelection.resourcesSingleRepository" args="isSafe" /> + </activeWhen> + </handler> </extension> <extension point="org.eclipse.ui.views"> @@ -4783,41 +4791,19 @@ allPopups="false" locationURI="popup:replaceWithMenu?after=gitReplaceWithGroup2"> <command - commandId="org.eclipse.egit.ui.team.ReplaceWithCommit" - label="%ReplaceWithCommitAction_label" + commandId="org.eclipse.egit.ui.team.ReplaceWithRef" + label="%ReplaceWithRefAction_label" style="push"> - <visibleWhen - checkEnabled="false"> - <and> - <reference - definitionId="org.eclipse.egit.ui.resourcesSingleRepository"> - </reference> - <reference - definitionId="org.eclipse.egit.ui.egitOnlyResourceMapping"> - </reference> - <reference - definitionId="org.eclipse.egit.ui.resourcesAllInRepository"> - </reference> - </and> + <visibleWhen checkEnabled="false"> + <test property="GitSelection.resourcesSingleRepository" args="isSafe" /> </visibleWhen> </command> <command - commandId="org.eclipse.egit.ui.team.ReplaceWithRef" - label="%ReplaceWithRefAction_label" + commandId="org.eclipse.egit.ui.team.ReplaceWithCommit" + label="%ReplaceWithCommitAction_label" style="push"> - <visibleWhen - checkEnabled="false"> - <and> - <reference - definitionId="org.eclipse.egit.ui.resourcesSingleRepository"> - </reference> - <reference - definitionId="org.eclipse.egit.ui.egitOnlyResourceMapping"> - </reference> - <reference - definitionId="org.eclipse.egit.ui.resourcesAllInRepository"> - </reference> - </and> + <visibleWhen checkEnabled="false"> + <test property="GitSelection.resourcesSingleRepository" args="isSafe" /> </visibleWhen> </command> </menuContribution> @@ -5624,13 +5610,11 @@ </command> <command categoryId="org.eclipse.egit.ui.commandCategory" - defaultHandler="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitActionHandler" id="org.eclipse.egit.ui.team.ReplaceWithCommit" name="%ReplaceWithCommitCommand.name"> </command> <command categoryId="org.eclipse.egit.ui.commandCategory" - defaultHandler="org.eclipse.egit.ui.internal.actions.ReplaceWithRefActionHandler" id="org.eclipse.egit.ui.team.ReplaceWithRef" name="%ReplaceWithRefCommand.name"> </command> diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithCommitAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithCommitAction.java deleted file mode 100644 index d3fc4e5d5c..0000000000 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithCommitAction.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 GitHub Inc. - * 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 - * - * Contributors: - * Kevin Sawicki (GitHub Inc.) - initial API and implementation - *******************************************************************************/ -package org.eclipse.egit.ui.internal.actions; - -/** - * Replace with Commit action - */ -public class ReplaceWithCommitAction extends RepositoryAction { - - /** Create action */ - public ReplaceWithCommitAction() { - super(ActionCommands.REPLACE_WITH_COMMIT_ACTION, - new ReplaceWithCommitActionHandler()); - } - -} diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithRefAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithRefAction.java deleted file mode 100644 index 6f0771a63d..0000000000 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithRefAction.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 GitHub Inc. - * 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 - * - * Contributors: - * Kevin Sawicki (GitHub Inc.) - initial API and implementation - *******************************************************************************/ -package org.eclipse.egit.ui.internal.actions; - -/** - * Replace with reference action - */ -public class ReplaceWithRefAction extends RepositoryAction { - - /** Create action */ - public ReplaceWithRefAction() { - super(ActionCommands.REPLACE_WITH_REF_ACTION, - new ReplaceWithRefActionHandler()); - } - -} |