|HandlerUtil.getCurrentSelection failing miserably for handler based on a listviewer.... [message #896201]
|Tue, 17 July 2012 14:40
| Michael Dougherty
Registered: July 2012
Can anybody maybe help me out?
I am using the rcpmail template but changing it for my own purposes. This refers to the navigation view on the side.
I have added a listviewer, as the objects I am working with are my own created classes. Upon double clicking on an item in the list the regular View refreshes with information about the object.
Anyways, so I'm trying to implement a command that deletes an object from the list. You click on an object, right-click it to bring up the popup-menu, and then you can delete it. It is deleted and the view is refreshed.
Now normally this works fine, albeit not exactly how I wanted it (I would have loved if I could have had it work like the navigation view in Eclipse where if you hover over an object it is highlighted, and from there you can right-click it to bring up the menu for that object...I have to click to highlight and then right click...)
The problem comes if I double click on an object. If I double click, and then I select another object in the list, the delete function always deletes the previous object that I had double clicked, and never the object that is currently being selected, despite I am getting the object from HandlerUtil.getCurrentSelection(event).
A System.out.println statement in the NavigationView class tells me that the listviewer.getSelection() is returning the correct Object....so why is HandlerUtil.getCurrentSelection thinking that the item double clicked is currently selected when it isnt? And why does it have no trouble if I dont double click?
Can anybody help me solve this, and as an added bonus, maybe mention how to get the list viewer to highlight when you hover over items, and to allow you to right-click items without single clicking them first?
I kind of suck at this so keep explanations simple...haha....thanks a lot
Powered by FUDForum
. Page generated in 0.01990 seconds