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 6253845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:04:32+00:00 2026-05-24T14:04:32+00:00

I am using menuContributions+popup to show a context menu in my plugin.xml. I need

  • 0

I am using menuContributions+popup to show a context menu in my plugin.xml. I need to limit it’s visibility only to

  1. certain type of Project(e.g. Dynamic Web Project) (Menu should appear on right click of only parent project folder) and
  2. a particular folder(e.g Web Content) and it’s sub folders inside the Project Folder structure.

I was able to achieve the 1) condition to some extent by using

<menuContribution locationURI="popup:common.new.menu?after=additions">
            <command
                label="Web Wiz"
                commandId="commandId"
                icon="icons/sample.gif">
               <visibleWhen>
                  <with  variable="selection">
                            <iterate ifEmpty="false"
                        operator="or">
                     <instanceof
                           value="org.eclipse.core.resources.IProject"/>
                  </iterate>
                  </with>
               </visibleWhen>
            </command>
        </menuContribution>

but it appears for all kinds of projects…I need to limit it to only a Dynamic Web Project, so what should I add to meet this requirement in plugin.xml?

  • 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-24T14:04:33+00:00Added an answer on May 24, 2026 at 2:04 pm
    1. Add a propertyTester that will test your project type.
    2. Use that tester in the visibleWhen

    You can read about property-tester at the eclipse help, or at the extension help itself 🙂

    EDIT – Check this one out as well – http://wiki.eclipse.org/Command_Core_Expressions#Property_Testers (especially the ResourcePropertyTester, which can provide you a built-in implementation that you can use)

    • 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 menuContribution + command along with the <visibleWhen> element in my plugin.xml
Using JDeveloper , I started developing a set of web pages for a project
Using C#, I need a class called User that has a username, password, active
using a binary search tree I need to add to a vector all int
(Using MVC 2) From inside my controller action, I need to display the url:
Using gcc and ld on x86_64 linux I need to link against a newer
Using C#, I want to format a decimal to only display two decimal places
Using JAXB in Java it is easy to generate from a xml schema file
using SQL Server 2005 standard edition with SP2 I need to design a table

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.