Plugins (1059)


Training and Consulting (44)



EPIC Poll

What is your favourite developer portal?

[ Results | Polls ]

Votes: 541
Comments: 0

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
thetrav
5 Post subject: Action that operates on Classes  PostPosted: Jul 14, 2008 - 11:56 PM



Joined: Jul 14, 2008
Posts: 1

I'm working on a plugin that adds an action to the right click menu in package navigator.

Ideally I want the action to only be available for classes (not files or folders or projects) and it will need to know which class has been selected so it can interrogate it for members.

So far I've got part way there implementing IObjectActionDelegate, however the selection tells me I've got an instance of IFile as opposed to IJavaElement.

Can anyone point me to some documentation or examples of an Action that works on Java Elements as opposed to files? Or if there's a way of converting/adapting from IFile to IJavaElement?

[EDIT]
Answering my own question
IJavaElement javaElement = (IJavaElement) iFile.getAdapter(IJavaElement.class);
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits