|Cell Editors & Command Handlers [message #1004901]
||Thu, 24 January 2013 04:57
| Frank Ziglar
Registered: July 2009
I've been working on an editor component and have run into an issue where, when opening a CellEditor, cut/copy/paste keyboard shortcuts are redirected back to the root part's IHandlers (attached to the nearest IHandlerService).
Naturally, I expect that while a cell editor is open (such as a TextCellEditor), the cut/copy/paste should work as normal, rather than being redirected to operate on the underlying viewer's selection.
Digging around for some answers, I did notice that connecting each CellEditor to a org.eclipse.ui.part.CellEditorActionHandler would work... if the underlying viewer's cut/copy/paste handlers were designed to work as Actions instead of Commands (IHandler).
Instead, I've tied a listener to each CellEditor, which can then connect to the nearest IBindingService to call setKeyFilterEnabled(false) while the CellEditor is active. This at least allows the CellEditor to handle cut/copy/paste in a natural way for as long as it has focus.
While functional, I'm not entirely happy with that solution, and feel that I've overlooked something that should be obvious. Is there a Command/IHandler alternative to CellEditorActionHandler? Or perhaps a more streamlined class that would automatically detect CellEditor activation, and allow the CellEditor to handle some standard commands while active?
For reference, I'm working with Eclipse 3.6, so still don't have access to the e4 framework just yet
Powered by FUDForum
. Page generated in 0.03611 seconds