beforeEditorActivated: Never double-click [message #902448] |
Fri, 17 August 2012 15:54 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
[Using Eclipse 3.7.2]
Has someone successfully used
ColumnViewerEditorActivationListener.beforeEditorActivated to detect
whether ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
is set for a jface TableViewer?
I'm using the default ColumnViewerEditorActivationStrategy (not setting
my own one), but I have registered an
ColumnViewerEditorActivationListener for some specific columns. What I
want to do is to disable editing for /specific columns/ unless a
double-click event occurs. Astonishingly the TableViewer always sends
single-click events, which was easy to find out when attempting to break
within this function:
protected void hookEditingSupport(Control control) {
// Needed for backwards comp with AbstractTreeViewer and TableTreeViewer
// who are not hooked this way others may already overwrite and provide
// their own impl
if (viewerEditor != null) {
control.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent e) {
// Workaround for bug 185817
if (e.count != 2) {
handleMouseDown(e);
}
}
public void mouseDoubleClick(MouseEvent e) {
handleMouseDown(e);
}
});
}
}
A counditional break-point in mouseDown never observes the situation
e.count == 2. For a corresponding standard TreeViewer I always get
e.count == 2 for comparable click-situations.
Any idea what might be wrong here?
Thanks & Greetings from Bremen,
Daniel Krügler
|
|
|
Powered by
FUDForum. Page generated in 0.05047 seconds