DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Problem in validating object contribution action for the first time
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
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
  (#2 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 07-01-2009, 02:59 AM

The key point is when the Items of the Navigator was added in. As you said, when you start your application, before the Plugin was loaded, then the Items are already in Navigator, then the error occurs.
In this situation, you can have a try. After the initiation, when the Plugin was loaded, load the items of the navigator.
wish it could be helpful.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default 07-01-2009, 05:44 AM

Hi oxygold,
Thanks for ur reply. Your suggestion is helpful when I use the navigator only with that particular plugin in which the problem occurs. But if I use the same navigator to other plugins means, the navigator needs to be loaded for the other plugins prior to loading that particular plugin.

I also thought of loading the plugin along with the workbench. But that is also not correct because, a plugin should be loaded only when it is necessary, as a rule.

If any other solution for the problem exists means, its most welcome.

Thanks & regards,
Loganathan. S.
Reply With Quote
  (#4 (permalink)) Old
Member
 
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default 07-01-2009, 05:44 AM

Hi oxygold,
Thanks for ur reply. Your suggestion is helpful when I use the navigator only with that particular plugin in which the problem occurs. But if I use the same navigator to other plugins means, the navigator needs to be loaded for the other plugins prior to loading that particular plugin.

I also thought of loading the plugin along with the workbench. But that is also not correct because, a plugin should be loaded only when it is necessary, as a rule.

If any other solution for the problem exists means, its most welcome.

Thanks & regards,
Loganathan. S.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Right time to use your HTML, JavaScript and CSS knowledge dreeshsoni CSS & HTML 0 06-05-2009 08:18 AM
Is Eclipse checking/validating code while l'm typing? strafford Eclipse 1 04-02-2009 04:04 PM
how to increase session time in jcifs randy ortan Java 0 03-21-2009 08:21 AM
how to disable an action on some other action sandeepp Eclipse 0 08-28-2008 07:29 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com