I wish to add a popup menu to the Eclipse Problem View. I can add the menu but I want it to only appear under certain condition. Like for example when a certain type of problem is selected in the problems view.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Assuming you are using the “org.eclipse.ui.menus” extension point and the command framework, you can set the visibleWhen part of the menu definition to something like;
This should only make the option visible when the selected items are of the correct instance.
It is also possible to set enabled and active states on command handlers in a similar way.