View Single Post
  (#1 (permalink)) Old
loganathans loganathans is offline
Member
 
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Exclamation Problem in validating object contribution action for the first time - 06-27-2009, 04:27 AM

Hi friends,
I use an object contributed pop-up action for IFiles in my plugin navigator. But I wanted to validate the selected resource in navigator view whether it's parent folder is named "EN" or "DE" and its grand parent folder is named "Strings" and enable the action if valid. I tried to have filter validation in extension at plugin.xml itself which has no option for the above validation. Hence I validated them in selectionChanged() method of my action delegate class and enabled or disabled accordingly.

But the problem now is, for the first time when I start my application, before the plugin is loaded, any file selection in navigator view does not initiate my plugin and the validation. And hence for wrong file selection the action is yet enabled for the first time and while selecting the action from pop-up menu it tells "The chosen operation is not currently available." message, because then only the plugin is started, and the selectionChanged() method in action delegate is called and disabled the action. And for the consecutive wrong selections, the action is properly disabled, because the plugin is started already in first wrong selection.

Now, I want to avoid the enabling of action for wrong selection for the first time and hence avoiding the "The chosen operation is not currently available?." message.

How can i achieve this?

Thanks & regards,
Loganathan. S.

Last edited by loganathans; 06-27-2009 at 04:31 AM. Reason: For correcting message
Reply With Quote