diff options
author | Thomas Wolf | 2015-11-23 06:42:35 +0000 |
---|---|---|
committer | Thomas Wolf | 2015-11-30 18:30:38 +0000 |
commit | 4e890505e710a1ecf7b2e8ec3b7c88f9daec18f0 (patch) | |
tree | b51297f0436cb575811e1d1116ce38d451cddc57 | |
parent | 9817448dca01fe11727b9b2e6b719765925322ee (diff) | |
download | egit-4e89050.tar.gz egit-4e89050.tar.xz egit-4e89050.zip |
Show 'Add to Index' and related team menu entries only when applicable
Change the menu configurations for 'Add to Index', 'Remove from Index',
and 'Ignore' from deprecated action to command/handler and a
menuContribution. Provide visibleWhen specifications using the new
properties hasStagedChanges, hasUnstagedChanges, and
hasNotIgnoredResources.
Bug: 355809
Change-Id: I35176f8ee77264c334d2c7d9b4333f4dd67fb458
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r-- | org.eclipse.egit.ui/plugin.xml | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml index 59ed7e5997..80cdaadaf2 100644 --- a/org.eclipse.egit.ui/plugin.xml +++ b/org.eclipse.egit.ui/plugin.xml @@ -84,27 +84,6 @@ menubarPath="compareWithMenu/gitCompareWithGroup2"> </action> <action - class="org.eclipse.egit.ui.internal.actions.IgnoreAction" - definitionId="org.eclipse.egit.ui.team.Ignore" - icon="$nl$/icons/obj16/ignore.gif" - id="org.eclipse.egit.ui.internal.actions.IgnoreAction" - label="%IgnoreAction_label" - menubarPath="team.main/group8"/> - <action - class="org.eclipse.egit.ui.internal.actions.RemoveFromIndexAction" - definitionId="org.eclipse.egit.ui.team.RemoveFromIndex" - icon="$nl$/icons/obj16/unstage.gif" - id="org.eclipse.egit.ui.internal.actions.RemoveFromIndexAction" - label="%RemoveFromIndexAction_label" - menubarPath="team.main/group8"/> - <action - class="org.eclipse.egit.ui.internal.actions.AddToIndexAction" - definitionId="org.eclipse.egit.ui.team.AddToIndex" - icon="$nl$/icons/obj16/add.gif" - id="org.eclipse.egit.ui.internal.actions.AddToIndexAction" - label="%AddToIndexAction_label" - menubarPath="team.main/group8"/> - <action class="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousAction" enablesFor="1" id="org.eclipse.egit.ui.internal.actions.ReplaceWithPreviousAction" @@ -4393,6 +4372,43 @@ </menuContribution> <menuContribution allPopups="false" + locationURI="popup:team.main?after=group8"> + <command + commandId="org.eclipse.egit.ui.team.AddToIndex" + label="%AddToIndexAction_label" + style="push"> + <visibleWhen + checkEnabled="false"> + <test + property="org.eclipse.egit.ui.resources.ResourceState.hasUnstagedChanges"> + </test> + </visibleWhen> + </command> + <command + commandId="org.eclipse.egit.ui.team.RemoveFromIndex" + label="%RemoveFromIndexAction_label" + style="push"> + <visibleWhen + checkEnabled="false"> + <test + property="org.eclipse.egit.ui.resources.ResourceState.hasStagedChanges"> + </test> + </visibleWhen> + </command> + <command + commandId="org.eclipse.egit.ui.team.Ignore" + label="%IgnoreAction_label" + style="push"> + <visibleWhen + checkEnabled="false"> + <test + property="org.eclipse.egit.ui.resources.ResourceState.hasNotIgnoredResources"> + </test> + </visibleWhen> + </command> + </menuContribution> + <menuContribution + allPopups="false" locationURI="popup:compareWithMenu?after=gitCompareWithGroup"> <command commandId="org.eclipse.egit.ui.team.CompareIndexWithHead" @@ -5073,6 +5089,10 @@ icon="icons/obj16/add.gif"> </image> <image + commandId="org.eclipse.egit.ui.team.RemoveFromIndex" + icon="icons/obj16/unstage.gif"> + </image> + <image commandId="org.eclipse.egit.ui.team.Branch" icon="icons/obj16/branch_obj.gif"> </image> |