Bug 216706 [Viewers] Disable 'check for expiration of doubleClickTime' in TreeViewer and TableViewer
I use the TextCellEditor within the TreeViewer and TableViewer. When clicking on a cell to edit it the full text is selected (on win and gtk at least). At this point if I immediately click again (to position the cursor at a specific point within the text) the edit is cancelled. If I wait a bit before clicking again then the cursor is repositioned as expected. You could reproduce it by using the Tasks view. I guess the following code in TreeViewerImpl and TableViewerImpl is responsible for this behaviour: -------------------- snip -------------------------- private void activateCellEditor() { ... mouseListener = new MouseAdapter() { public void mouseDown(MouseEvent e) { // time wrap? // check for expiration of doubleClickTime if (e.time <= doubleClickExpirationTime) { control.removeMouseListener(mouseListener); cancelEditing(); handleDoubleClickEvent(); } else if (mouseListener != null) { control.removeMouseListener(mouseListener); } } }; control.addMouseListener(mouseListener); ... } -------------------- snap -------------------------- So clicking the second time within the doubleClickExpirationTime cancels editing. Is it possible to add a flag to disable this behaviour, or to remove it completely?
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditor.java
*
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Tom Schindl <tom.schindl@bestsolution.at> - refactoring (bug 153993)
 *     											   fix in bug: 151295,178946,166500,195908,201906,207676,180504
 *******************************************************************************/
package org.eclipse.jface.viewers;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;
/**
 * This is the base for all editor implementations of Viewers. ColumnViewer
 * implementors have to subclass this class and implement the missing methods
 *
 * @since 3.3
 * @see TableViewerEditor
 * @see TreeViewerEditor
 */
public abstract class ColumnViewerEditor {
	private CellEditor cellEditor;
	private ICellEditorListener cellEditorListener;