0

I have a condition using which I display an entry in the toolbar. I use menuContribution + command + visibleWhen to display this entry. As soon as I switch to another perspective my entry in the toolbar vanishes even though I have that project/project node selected in my project explorer.

Is it because I use

<visibleWhen> <with variable="selection">  in my plugin.xml ?

How can I keep my toolbar entry visible even if perspectives are switched ,at least it should display in certain fixed perspectives if not all of them....

I want to avoid using actionSets to display my entry in the toolbar as they are not friendly with the propertyTester I am using.

Any help in this regard will be really appreciated,

Thanks !

Abbas
  • 3,144
  • 2
  • 25
  • 45

1 Answers1

1

I am guessing when you shift perspectives, the selection is lost and that is the reason your contributions are not visible. Even though in the project explorer view (or something), the selection is present, it would sometimes be in grey shade indicating no selection. You need to handle selection via code, not extension points.

Ravi
  • 545
  • 3
  • 5
  • The selection seems like it's lost but it actually isn't...I wrote a code where I got the selection when perspective changes and I was able to get the selected resource in the project explorer. One way I think is to use another tag in which will check that for certain perspectives the selection should work...I am currently working on this but with not much success... – Abbas May 16 '12 at 03:44