Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:45:40+00:00 2026-05-24T13:45:40+00:00

I am using menuContribution + command along with the <visibleWhen> element in my plugin.xml

  • 0

I am using menuContribution + command along with the <visibleWhen> element in my plugin.xml.

Say there is a particular folder “XYZ” in my Project Structure with subfolders “xyz1” “xyz2“.
I want my popup menu entry to be only visible on right click of XYZ, xyz1 and xyz2 folders only.

Any inputs to do the same will be really helpful.

Thanks,
Abbas

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:45:40+00:00Added an answer on May 24, 2026 at 1:45 pm
    <test   forcePluginActivation="true"
            property="testWizard.propertyTester.checkFolder"
             value="org.eclipse.wst.jsdt.core.jsNature"
     </test>  is the reference to the property tester , which can be defined as
    

    <extension
            point="org.eclipse.core.expressions.propertyTesters">
         <propertyTester          
            class="testwizard.wizards.MyPropTester"
               id="MyPropTesterFolder"
               namespace="testWizard.propertyTester"
               properties="checkFolder"
               type="org.eclipse.core.resources.IFolder">
         </propertyTester>
    

    then the kind of folder and it’s subfolders can be tested as below in

    package testwizard.wizards;
    
    import org.eclipse.core.expressions.PropertyTester;
    import org.eclipse.core.resources.IFolder;
    import org.eclipse.core.runtime.CoreException;
    
    public class MyPropTester extends PropertyTester{
    
        @Override
        public boolean test(Object receiver, String property, Object[] args,
                Object expectedValue) {
    
            IFolder folder=(IFolder)receiver;
            String folderPath=folder.getProjectRelativePath().toString();
            String arr[]=folderPath.split("/");     
            try {
                if(folder.getProject().hasNature(expectedValue.toString()))
                {
                    if(arr[0].equals("XYZ"))
                    {
                        return true;
                    }
                }
            } catch (CoreException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            return false;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying configure visibility of a command within the context menu using 'visibleWhen'
I am using menuContributions+popup to show a context menu in my plugin.xml. I need
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using JDeveloper , I started developing a set of web pages for a project
Using jQuery, what's the best way to automatically initialize a plugin on all current
Using the HTML5 <canvas> element, I would like to load an image file (PNG,
Using SVN you can right click a folder TEST and add it to the
Using the below XML, I need to figure out which person worked more hours
Using Core Data. Let's say we have models for Team and Player. Assume: -Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.