Hello,
I am trying to get the command for adding my nature to only show when the nature is not already present AND the project is not a Java project. This does not seem to work:
<menuContribution
locationURI="popup:org.eclipse.ui.projectConfigure?after=additions">
<command
commandId="my.command.addRemoveMyNature"
label="Enable my nature"
style="push">
<visibleWhen checkEnabled="false">
<with variable="selection">
<count value="1" />
<iterate>
<adapt type="org.eclipse.core.resources.IProject">
<and>
<not>
<test
property="org.eclipse.core.resources.projectNature"
value="my.Nature">
</test>
</not>
<not>
<test
property="org.eclipse.core.resources.projectNature"
value="org.eclipse.jdt.core.java.javanature">
</test>
</not>
</and>
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
The above makes the command visible even for Java projects. I do not want that to happen. Any idea why the expression does not work as I expect?
I am coding for version 2018-09 on Windows, though I doubt that is significant.
UPDATE: The name of the JDT nature is actually "org.eclipse.jdt.core.javanature". I found it while stepping through the code to see how the expression was being evaluated...
[Updated on: Sun, 31 March 2019 10:11] by Moderator