| author | Christian Georgi | 2013-01-23 11:50:33 (EST) |
|---|---|---|
| committer | Curtis Windatt | 2013-01-23 11:51:03 (EST) |
| commit | 37ea7f47ae54da3648c7aac7b76f8108bc8cbd34 (patch) (side-by-side diff) | |
| tree | 7e5a04b3496b814dfae21d946b1ba476d0241523 | |
| parent | 5b929105541c076e0c9ab7771dd24acc080caf41 (diff) | |
| download | eclipse.pde.ui-37ea7f47ae54da3648c7aac7b76f8108bc8cbd34.zip eclipse.pde.ui-37ea7f47ae54da3648c7aac7b76f8108bc8cbd34.tar.gz eclipse.pde.ui-37ea7f47ae54da3648c7aac7b76f8108bc8cbd34.tar.bz2 | |
Bug 385100 - [patch][tracing] Tracing options tree is not keyboardv20130123-165103
accessible
2 files changed, 39 insertions, 4 deletions
diff --git a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingComponentColumnEditingSupport.java b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingComponentColumnEditingSupport.java index 2e72162..b6e6919 100644 --- a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingComponentColumnEditingSupport.java +++ b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingComponentColumnEditingSupport.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation and others.
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
+ * SAP - ongoing enhancements
*******************************************************************************/
package org.eclipse.ui.trace.internal;
@@ -40,6 +41,7 @@ public class TracingComponentColumnEditingSupport extends EditingSupport { case TracingConstants.VALUE_COLUMN_INDEX :
this.textEditor = new TextCellEditor((Composite) viewer.getControl(), SWT.NONE);
this.comboEditor = new ComboBoxCellEditor((Composite) viewer.getControl(), new String[] {Messages.TracingComponentColumnEditingSupport_true, Messages.TracingComponentColumnEditingSupport_false}, SWT.READ_ONLY | SWT.SIMPLE);
+ this.comboEditor.setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION | ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);
break;
default :
// do nothing - no other columns provide editing support
@@ -138,6 +140,6 @@ public class TracingComponentColumnEditingSupport extends EditingSupport { * The {@link CellEditor} for the value column
*/
private CellEditor textEditor;
- private CellEditor comboEditor;
+ private ComboBoxCellEditor comboEditor;
}
\ No newline at end of file diff --git a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingPreferencePage.java b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingPreferencePage.java index 0dcc303..98bad2a 100644 --- a/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingPreferencePage.java +++ b/ui/org.eclipse.ui.trace/src/org/eclipse/ui/trace/internal/TracingPreferencePage.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation and others.
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,15 +7,26 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
+ * SAP - ongoing enhancements
*******************************************************************************/
package org.eclipse.ui.trace.internal;
+import static org.eclipse.jface.viewers.ColumnViewerEditor.KEYBOARD_ACTIVATION;
+import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_HORIZONTAL;
+import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR;
+import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_VERTICAL;
+import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.KEY_PRESSED;
+import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION;
+import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.PROGRAMMATIC;
+import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.TRAVERSAL;
+
import java.io.File;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.jface.layout.*;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.Util;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -30,10 +41,19 @@ import org.eclipse.ui.trace.internal.providers.*; import org.eclipse.ui.trace.internal.utils.*;
/**
- * The 'Product Tracing' workspace preference page.
+ * The 'Tracing' workspace preference page.
*/
public class TracingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ /**
+ * The key to activate the value cell editor.
+ * Cannot use the usual enter (CR) key to activate it since this would close the page. Fix is to use
+ * the space key as replacement.
+ * On Linux, however, space is used as default key on ComboBoxes, leading to the editor being deactivated.
+ * We use F2 instead.
+ */
+ private static final int VALUE_EDITOR_ACTIVATION_KEY = Util.isLinux() ? SWT.F2 : SWT.SPACE;
+
/** A list of {@link TracingComponent} objects to display in the UI */
private Map<String, TracingComponent> displayableTracingComponents = null;
@@ -233,6 +253,19 @@ public class TracingPreferencePage extends PreferencePage implements IWorkbenchP valueColumn.setLabelProvider(new TracingComponentColumnLabelProvider(TracingConstants.VALUE_COLUMN_INDEX));
valueColumn.setEditingSupport(new TracingComponentColumnEditingSupport(getViewer(), TracingConstants.VALUE_COLUMN_INDEX));
treeViewerCompositeLayout.setColumnData(getViewerTree().getColumn(1), new ColumnWeightData(25));
+
+ // install focus cell and cell editor activation for keyboard access (Bug 385100)
+ TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(getViewer(), new FocusCellOwnerDrawHighlighter(getViewer()));
+ ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(getViewer()) {
+ protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
+ return (event.eventType == KEY_PRESSED && event.keyCode == VALUE_EDITOR_ACTIVATION_KEY) //
+ || event.eventType == TRAVERSAL //
+ || event.eventType == MOUSE_CLICK_SELECTION //
+ || event.eventType == PROGRAMMATIC;
+ }
+ };
+ TreeViewerEditor.create(getViewer(), focusCellManager, actSupport, //
+ TABBING_HORIZONTAL | TABBING_MOVE_TO_ROW_NEIGHBOR | TABBING_VERTICAL | KEYBOARD_ACTIVATION);
}
/**
|

