Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » how to use IViewActionDelegate?
how to use IViewActionDelegate? [message #989068] Tue, 04 December 2012 13:59 Go to next message
ben agai is currently offline ben agai
Messages: 36
Registered: July 2012
Member
hello.

i have added a menu item to the variablesview menu by extending the org.eclipse.ui.popupMenus extension point and what im trying to do is that when someone right clicks a variable and clicks my menu item i would parse the variable's value to an Ip format.

i succeded in adding the menu item and responding to a click with the IViewActionDelegate interface, but when someone clicks on my menu item the information given by IAction event is'nt helping with knowing which Object occoured the event or what is the value of the variable.

my question is, if there is a way to locate the variable's value after clicking my menu item? or is there another way of using the interface IViewActionDelegate that i dont know of, or i dont use it correctly?.

i have checked a lot in google about how to add a menu item and found good guide: http://www.eclipse.org/articles/article.php?file=Article-action-contribution/index.html

but it does'nt solve my problem, i really need help on this subject.

thanks.

[Updated on: Tue, 04 December 2012 14:00]

Report message to a moderator

Re: how to use IViewActionDelegate? [message #989608 is a reply to message #989068] Thu, 06 December 2012 22:45 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
When implementing your action as a subclass of org.eclipse.ui.actions.SelectionProviderAction, calling getStructuredSelection() should give you access to the variable, I'd expect elements of the selection to be of type IJavaVariable, at least IVariable.

Hopefully an existing action like org.eclipse.debug.internal.ui.actions.variables.ChangeVariableValueAction will give you an idea to to implement your action.

HTH,
Stephan
Re: how to use IViewActionDelegate? [message #994803 is a reply to message #989608] Fri, 28 December 2012 10:11 Go to previous message
ben agai is currently offline ben agai
Messages: 36
Registered: July 2012
Member
greate, thanks for the help.
Previous Topic:JavaScript editor: return key does not insert newline after opening square bracket, inserts spaces
Next Topic:Override cannot be resolved to a type
Goto Forum:
  


Current Time: Fri Oct 24 10:22:53 GMT 2014

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

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