Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Dirix2015-07-27 12:36:33 +0000
committerAndrey Loskutov2015-09-02 18:37:00 +0000
commitd37c07fac7a92a026b60ca40f3f0d1b7ae57fbd1 (patch)
tree8029a25582dd7f2419b9a34f83f1698016c0fb05 /org.eclipse.egit.ui/plugin.xml
parenta6cb2e476751e780dcc80653dd219b0d248bd565 (diff)
downloadegit-d37c07fac7a92a026b60ca40f3f0d1b7ae57fbd1.tar.gz
egit-d37c07fac7a92a026b60ca40f3f0d1b7ae57fbd1.tar.xz
egit-d37c07fac7a92a026b60ca40f3f0d1b7ae57fbd1.zip
Add "Compare with/Replace with" actions to ResourceMappings
Add the eGit "Compare with/Replace with" actions to selections which only adapt to ResourceMapping but not to IResource. This includes objects like Java-WorkingSets and custom ResourceMappings. ResourceMappings can be seen as a collection of resources forming a logical model. It often makes sense to extend the navigator view to add symbolic virtual nodes grouping the resources together. However since there is no "real" resource, the virtual node adapts only to ResourceMapping. Selecting these ResourceMappings can be seen as selecting all resources this mapping traverses. Since eGit's SelectionUtils already supports ResourceMappings (collecting contained resources), selections adapting only to ResourceMapping can be supported by simply enabling the actions on them. Bug: 474725 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I6f967f72feae10cae29505fa17b81e65e0aa87de Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui/plugin.xml')
-rw-r--r--org.eclipse.egit.ui/plugin.xml299
1 files changed, 298 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index a5357c6afc..2c7a9bd009 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -398,6 +398,12 @@
</with>
</or>
</definition>
+ <definition
+ id="org.eclipse.egit.ui.resourcesAllInRepository">
+ <test
+ property="GitSelection.resourcesAllInRepository">
+ </test>
+ </definition>
</extension>
<extension point="org.eclipse.ui.preferencePages">
@@ -4375,6 +4381,269 @@
</visibleWhen>
</command>
</menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:compareWithMenu?after=gitCompareWithGroup">
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareIndexWithHead"
+ label="%CompareIndexWithHeadAction_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>
+ </command>
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareWithIndex"
+ label="%CompareWithIndexAction_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>
+ </command>
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareWithHead"
+ label="%CompareWithHeadAction_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>
+ </command>
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareWithPrevious"
+ label="%CompareWithPreviousAction.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>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:compareWithMenu?after=gitCompareWithGroup2">
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareWithCommit"
+ label="%CompareWithCommitAction.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>
+ </command>
+ <command
+ commandId="org.eclipse.egit.ui.team.CompareWithRevision"
+ label="%CompareWithBranchOrTagAction.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>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:replaceWithMenu?after=gitReplaceWithGroup">
+ <command
+ commandId="org.eclipse.egit.ui.team.ReplaceWithPrevious"
+ label="%replaceWithPreviousVersionAction.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>
+ </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>
+ </command>
+ <command
+ 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>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:replaceWithMenu?after=gitReplaceWithGroup2">
+ <command
+ 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>
+ </command>
+ <command
+ 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>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <menu
+ id="compareWithMenu"
+ label="Compare With">
+ <separator
+ name="compareWithGroup">
+ </separator>
+ <separator
+ name="gitCompareWithGroup"
+ visible="true">
+ </separator>
+ <separator
+ name="gitCompareWithGroup2"
+ visible="true">
+ </separator>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <menu
+ id="replaceWithMenu"
+ label="Replace With">
+ <separator
+ name="replaceWithGroup">
+ </separator>
+ <separator
+ name="gitReplaceWithGroup"
+ visible="true">
+ </separator>
+ <separator
+ name="gitReplaceWithGroup2"
+ visible="true">
+ </separator>
+ </menu>
+ </menuContribution>
</extension>
<extension
name="%RepositoryCommandsLabel"
@@ -4946,7 +5215,7 @@
class="org.eclipse.egit.ui.internal.selection.SelectionPropertyTester"
id="org.eclipse.egit.ui.SelectionTester"
namespace="GitSelection"
- properties="projectSingleRepository,projectsWithRepositories,resourcesSingleRepository,fileOrFolderInRepository"
+ properties="projectSingleRepository,projectsWithRepositories,resourcesSingleRepository,fileOrFolderInRepository,resourcesAllInRepository"
type="java.util.Collection">
</propertyTester>
</extension>
@@ -5714,4 +5983,32 @@
</bundle>
</component>
</extension>
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.eclipse.egit.ui.egitOnlyResourceMapping">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <adapt
+ type="org.eclipse.core.resources.mapping.ResourceMapping">
+ <test
+ args="org.eclipse.team.core.repository"
+ property="org.eclipse.core.resources.projectPersistentProperty"
+ value="org.eclipse.egit.core.GitProvider">
+ </test>
+ </adapt>
+ <not>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </not>
+ </and>
+ </iterate>
+ </with>
+ </definition>
+ </extension>
</plugin>

Back to the top