Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » [RESOLVED] Core expression checking for project natures not working
[RESOLVED] Core expression checking for project natures not working [message #1804752] Sun, 31 March 2019 11:58
Alexandros Karypidis is currently offline Alexandros KarypidisFriend
Messages: 135
Registered: March 2010
Senior Member
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 14:11]

Report message to a moderator

Previous Topic:Eclipse blocking IE's [Open] [Save] [Cancel] Popup
Next Topic:Eclipse 4 logging
Goto Forum:
  


Current Time: Mon Dec 09 09:55:34 GMT 2019

Powered by FUDForum. Page generated in 0.01938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top