Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Getting active tableviewer in Handler
Getting active tableviewer in Handler [message #763502] Fri, 09 December 2011 21:45 Go to next message
Ricky de Klerck is currently offline Ricky de Klerck
Messages: 295
Registered: January 2011
Senior Member
Hi,

Yet another question.. I have a menu on my tableviewer so when I do a right click I can choose to delete an object. In the handler I want to know which tableviewer is clicked so I can retrieve the input.. On this input I want to do some modifications. Is this possible?

Thanks in advance.

Regards,
Ricky de Klerck
Re: Getting active tableviewer in Handler [message #764562 is a reply to message #763502] Mon, 12 December 2011 12:42 Go to previous messageGo to next message
Arthur Gurov is currently offline Arthur Gurov
Messages: 7
Registered: November 2011
Location: Ukraine
Junior Member
Hi,

Are you sure that you really need exactly tableviewer? I think it's litle bit wrong from eclipse selection concepts. I mean that you can provide selection exactly from table viever and in this case selection will be element which you want to handle.

Best regards,
Arthur.
Re: Getting active tableviewer in Handler [message #764581 is a reply to message #764562] Mon, 12 December 2011 13:26 Go to previous message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 2011-12-12 13:42, Arthur wrote:
> Are you sure that you really need exactly tableviewer? I think it's
> litle bit wrong from eclipse selection concepts. I mean that you can
> provide selection exactly from table viever and in this case selection
> will be element which you want to handle.

I completely agree with Arthur and therefore recommend to use
HandlerUtil.getCurrentSelection[Checked] or
HandlerUtil.getActiveMenuSelection[Checked], depending on your needs. If
it is important, that you get the control in focus, register your
(table) control via IFocusService, and use the variables
activeFocusControl and activeFocusControlId via HandlerUtil.getVariable
inside your handler.

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:Extension Points: "Second instance" not available
Next Topic:Eclipse gemini integration with eclipse RCP
Goto Forum:
  


Current Time: Sun Oct 26 08:35:30 GMT 2014

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

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