Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-10-20 20:38:17 +0000
committerMatthias Sohn2016-12-02 23:56:12 +0000
commita44e7448f1f5a036223b57432d8866c49412dc81 (patch)
tree2e72443738cf81010c4a16958e818aaa2637e495 /org.eclipse.egit.ui/plugin.xml
parent01bda60c5937b0cfd272f4b21f679be6c45c9a00 (diff)
downloadegit-a44e7448f1f5a036223b57432d8866c49412dc81.tar.gz
egit-a44e7448f1f5a036223b57432d8866c49412dc81.tar.xz
egit-a44e7448f1f5a036223b57432d8866c49412dc81.zip
Clean up "Replace With..." actions
Replace deprecated <objectContribution>s by command/handler combos. Remove now unused legacy actions. "Replace with HEAD" and "Replace With Index" also work on multiple repositories. Change the resourcesAllInRepository property test to also handle repository property tests in order to be able to test the isSafe property. Restrict the "Replace with Previous" to tracked resources; on untracked resources it would only open a dialog telling the user that there was no previous revision. Which is correct, but then why allow trying to execute the command at all? Visual change: previously, "Replace with HEAD" and "Replace With Index" did not appear on a WorkingSet containing projects from several repositories. Now they do. It's unclear to me why they didn't before, and in any case they also appeared before on WorkingSets containing projects from a single repository. Both commands are and were active when projects from several repositories were selected. Bug: 495064 Change-Id: Id0fae18e042aa180310f289e48ad13ad263c9481 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui/plugin.xml')
-rw-r--r--org.eclipse.egit.ui/plugin.xml116
1 files changed, 53 insertions, 63 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index c991a70fbf..c6b4a34ac1 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -50,23 +50,6 @@
value="org.eclipse.team.core.repository=org.eclipse.egit.core.GitProvider">
</filter>
<action
- class="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousAction"
- enablesFor="1"
- id="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousAction"
- label="%replaceWithPreviousVersionAction.label"
- menubarPath="replaceWithMenu/gitReplaceWithGroup">
- </action>
- <action
- class="org.eclipse.egit.ui.internal.actions.DiscardChangesAction"
- id="org.eclipse.egit.ui.internal.actions.DiscardChangesAction"
- label="%DiscardChangesAction_label"
- menubarPath="replaceWithMenu/gitReplaceWithGroup"/>
- <action
- class="org.eclipse.egit.ui.internal.actions.ReplaceWithHeadAction"
- id="org.eclipse.egit.ui.internal.actions.ReplaceWithHeadAction"
- label="%ReplaceWithHeadAction_label"
- menubarPath="replaceWithMenu/gitReplaceWithGroup"/>
- <action
class="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitAction"
id="org.eclipse.egit.ui.internal.actions.ReplaceWithCommitAction"
label="%ReplaceWithCommitAction_label"
@@ -2216,6 +2199,37 @@
<reference definitionId="org.eclipse.egit.ui.resourcesSingleRepository" />
</activeWhen>
</handler>
+ <handler
+ commandId="org.eclipse.egit.ui.team.ReplaceWithPrevious">
+ <class
+ class="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousActionHandler">
+ </class>
+ <activeWhen>
+ <and>
+ <count value="1" />
+ <test property="GitSelection.resourcesSingleRepository" args="isSafe" />
+ <test property="org.eclipse.egit.ui.resources.ResourceState.hasTrackedResources" />
+ </and>
+ </activeWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.egit.ui.team.Discard">
+ <class
+ class="org.eclipse.egit.ui.internal.actions.DiscardChangesActionHandler">
+ </class>
+ <activeWhen>
+ <test property="GitSelection.resourcesAllInRepository" args="isSafe" />
+ </activeWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.egit.ui.team.ReplaceWithHead">
+ <class
+ class="org.eclipse.egit.ui.internal.actions.ReplaceWithHeadActionHandler">
+ </class>
+ <activeWhen>
+ <test property="GitSelection.resourcesAllInRepository" args="isSafe" />
+ </activeWhen>
+ </handler>
</extension>
<extension
point="org.eclipse.ui.views">
@@ -4741,59 +4755,26 @@
allPopups="false"
locationURI="popup:replaceWithMenu?after=gitReplaceWithGroup">
<command
- commandId="org.eclipse.egit.ui.team.ReplaceWithPrevious"
- label="%replaceWithPreviousVersionAction.label"
+ commandId="org.eclipse.egit.ui.team.ReplaceWithHead"
+ label="%ReplaceWithHeadAction_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>
+ <visibleWhen checkEnabled="true" />
</command>
<command
commandId="org.eclipse.egit.ui.team.Discard"
label="%DiscardChangesAction_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>
+ <visibleWhen checkEnabled="true" />
</command>
<command
- commandId="org.eclipse.egit.ui.team.ReplaceWithHead"
- label="%ReplaceWithHeadAction_label"
+ commandId="org.eclipse.egit.ui.team.ReplaceWithPrevious"
+ label="%ReplaceWithPreviousVersionAction.label"
style="push">
- <visibleWhen
- checkEnabled="false">
+ <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>
+ <count value="1" />
+ <test property="GitSelection.resourcesSingleRepository" args="isSafe" />
+ <test property="org.eclipse.egit.ui.resources.ResourceState.hasTrackedResources" />
</and>
</visibleWhen>
</command>
@@ -4888,6 +4869,18 @@
name="gitReplaceWithGroup2"
visible="true">
</separator>
+ <visibleWhen>
+ <with variable="activeMenu">
+ <not>
+ <iterate operator="or">
+ <or>
+ <equals value="#AbstractTextEditorRulerContext" />
+ <equals value="#OverviewRulerContext" />
+ </or>
+ </iterate>
+ </not>
+ </with>
+ </visibleWhen>
</menu>
</menuContribution>
</extension>
@@ -5621,13 +5614,11 @@
</command>
<command
categoryId="org.eclipse.egit.ui.commandCategory"
- defaultHandler="org.eclipse.egit.ui.internal.actions.DiscardChangesActionHandler"
id="org.eclipse.egit.ui.team.Discard"
name="%ReplaceWithIndexCommand.name">
</command>
<command
categoryId="org.eclipse.egit.ui.commandCategory"
- defaultHandler="org.eclipse.egit.ui.internal.actions.ReplaceWithHeadActionHandler"
id="org.eclipse.egit.ui.team.ReplaceWithHead"
name="%ReplaceWithHeadCommand.name">
</command>
@@ -5645,7 +5636,6 @@
</command>
<command
categoryId="org.eclipse.egit.ui.commandCategory"
- defaultHandler="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousActionHandler"
id="org.eclipse.egit.ui.team.ReplaceWithPrevious"
name="%ReplaceWithPreviousCommand.name">
</command>

Back to the top