Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » gettting the name of the selected object in the Objectactiondelegate class
gettting the name of the selected object in the Objectactiondelegate class [message #335261] Sat, 28 March 2009 09:08 Go to next message
pudupatti Rajarajan is currently offline pudupatti RajarajanFriend
Messages: 3
Registered: July 2009
Junior Member
All,

i have actually started with a plugin development and have been stuck up
with this for sometime.

suppose i do a right click on a java file and do an action[custom inserted
in the context menu] , i need to get the fully qualified name of the java
file [eg : com.manh.contractmanagement.delete.java] which i have selected,
in the run method of my action delgate class.

the run method is dependant on the java file i have selected.how can i
get the fully qualified name of the java file i have selected inside my
run method ? i did some research but i was not able to find an answer for
this!!!!
Re: gettting the name of the selected object in the Objectactiondelegate class [message #335266 is a reply to message #335261] Sun, 29 March 2009 03:43 Go to previous message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
One way to do this would be to implement a command and a command handler.

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_cmd.htm

In your AbstractHandler subclass, you can use
HandlerUtil.getCurrentSelection(..) to retrieve the current selection.

If you are using ActionDelegate, it looks like you could capture the
selection as it changes in selectionChanged(..)

Also the selection service may help you.
http://www.eclipse.org/articles/Article-WorkbenchSelections/ article.html

-Ben

pudupatti Rajarajan wrote:
> All,
>
> i have actually started with a plugin development and have been stuck up
> with this for sometime.
> suppose i do a right click on a java file and do an action[custom
> inserted in the context menu] , i need to get the fully qualified name
> of the java file [eg : com.manh.contractmanagement.delete.java] which i
> have selected, in the run method of my action delgate class.
>
> the run method is dependant on the java file i have selected.how can i
> get the fully qualified name of the java file i have selected inside my
> run method ? i did some research but i was not able to find an answer
> for this!!!!
Previous Topic:Problem with 3.5 rewriting eclipse.ini
Next Topic:changes inside the selected object not getting reflected in the action
Goto Forum:
  


Current Time: Sat Jul 27 12:27:44 GMT 2024

Powered by FUDForum. Page generated in 0.03717 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top