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
/**
	 * Style mask used to enable keyboard activation
	 */
	public static final int KEYBOARD_ACTIVATION = 1 << 5;
	private int feature;
	/**
	 * @param viewer
	 *            the viewer this editor is attached to
	 * @param editorActivationStrategy
	 *            the strategy used to decide about editor activation
	 * @param feature
	 *            bit mask controlling the editor
	 *            <ul>
	 *            <li>{@link ColumnViewerEditor#DEFAULT}</li>
	 *            <li>{@link ColumnViewerEditor#TABBING_CYCLE_IN_ROW}</li>
	 *            <li>{@link ColumnViewerEditor#TABBING_HORIZONTAL}</li>
	 *            <li>{@link ColumnViewerEditor#TABBING_MOVE_TO_ROW_NEIGHBOR}</li>
	 *            <li>{@link ColumnViewerEditor#TABBING_VERTICAL}</li>
	 *            </ul>
	 */
	protected ColumnViewerEditor(ColumnViewer viewer,
			ColumnViewerEditorActivationStrategy editorActivationStrategy,
			int feature) {
		this.viewer = viewer;
		this.editorActivationStrategy = editorActivationStrategy;
		if ((feature & KEYBOARD_ACTIVATION) == KEYBOARD_ACTIVATION) {
			this.editorActivationStrategy
					.setEnableEditorActivationWithKeyboard(true);
		}
		this.feature = feature;