Lines 10-21
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.ui.trace.internal; |
11 |
package org.eclipse.ui.trace.internal; |
12 |
|
12 |
|
|
|
13 |
import static org.eclipse.jface.viewers.ColumnViewerEditor.KEYBOARD_ACTIVATION; |
14 |
import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_HORIZONTAL; |
15 |
import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR; |
16 |
import static org.eclipse.jface.viewers.ColumnViewerEditor.TABBING_VERTICAL; |
17 |
import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.KEY_PRESSED; |
18 |
import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION; |
19 |
import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.PROGRAMMATIC; |
20 |
import static org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.TRAVERSAL; |
21 |
|
13 |
import java.io.File; |
22 |
import java.io.File; |
14 |
import java.util.*; |
23 |
import java.util.*; |
15 |
import org.eclipse.core.runtime.*; |
24 |
import org.eclipse.core.runtime.*; |
16 |
import org.eclipse.jface.layout.*; |
25 |
import org.eclipse.jface.layout.*; |
17 |
import org.eclipse.jface.preference.PreferencePage; |
26 |
import org.eclipse.jface.preference.PreferencePage; |
18 |
import org.eclipse.jface.resource.JFaceResources; |
27 |
import org.eclipse.jface.resource.JFaceResources; |
|
|
28 |
import org.eclipse.jface.util.Util; |
19 |
import org.eclipse.jface.viewers.*; |
29 |
import org.eclipse.jface.viewers.*; |
20 |
import org.eclipse.swt.SWT; |
30 |
import org.eclipse.swt.SWT; |
21 |
import org.eclipse.swt.events.SelectionAdapter; |
31 |
import org.eclipse.swt.events.SelectionAdapter; |
Lines 34-39
import org.eclipse.ui.trace.internal.utils.*;
Link Here
|
34 |
*/ |
44 |
*/ |
35 |
public class TracingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { |
45 |
public class TracingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { |
36 |
|
46 |
|
|
|
47 |
/** |
48 |
* The key to activate the value cell editor. |
49 |
* Cannot use the usual enter (CR) key to activate it since this would close the page. Fix is to use |
50 |
* the space key as replacement. |
51 |
* On Linux, however, space is used as default key on ComboBoxes, leading to the editor being deactivated. |
52 |
* We use F2 instead. |
53 |
*/ |
54 |
private static final int VALUE_EDITOR_ACTIVATION_KEY = Util.isLinux() ? SWT.F2 : SWT.SPACE; |
55 |
|
37 |
/** A list of {@link TracingComponent} objects to display in the UI */ |
56 |
/** A list of {@link TracingComponent} objects to display in the UI */ |
38 |
private Map<String, TracingComponent> displayableTracingComponents = null; |
57 |
private Map<String, TracingComponent> displayableTracingComponents = null; |
39 |
|
58 |
|
Lines 233-238
public class TracingPreferencePage extends PreferencePage implements IWorkbenchP
Link Here
|
233 |
valueColumn.setLabelProvider(new TracingComponentColumnLabelProvider(TracingConstants.VALUE_COLUMN_INDEX)); |
252 |
valueColumn.setLabelProvider(new TracingComponentColumnLabelProvider(TracingConstants.VALUE_COLUMN_INDEX)); |
234 |
valueColumn.setEditingSupport(new TracingComponentColumnEditingSupport(getViewer(), TracingConstants.VALUE_COLUMN_INDEX)); |
253 |
valueColumn.setEditingSupport(new TracingComponentColumnEditingSupport(getViewer(), TracingConstants.VALUE_COLUMN_INDEX)); |
235 |
treeViewerCompositeLayout.setColumnData(getViewerTree().getColumn(1), new ColumnWeightData(25)); |
254 |
treeViewerCompositeLayout.setColumnData(getViewerTree().getColumn(1), new ColumnWeightData(25)); |
|
|
255 |
|
256 |
// install focus cell and cell editor activation |
257 |
TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(getViewer(), new FocusCellOwnerDrawHighlighter(getViewer())); |
258 |
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(getViewer()) { |
259 |
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) { |
260 |
return (event.eventType == KEY_PRESSED && event.keyCode == VALUE_EDITOR_ACTIVATION_KEY) // |
261 |
|| event.eventType == TRAVERSAL // |
262 |
|| event.eventType == MOUSE_CLICK_SELECTION // |
263 |
|| event.eventType == PROGRAMMATIC; |
264 |
} |
265 |
}; |
266 |
TreeViewerEditor.create(getViewer(), focusCellManager, actSupport, // |
267 |
TABBING_HORIZONTAL | TABBING_MOVE_TO_ROW_NEIGHBOR | TABBING_VERTICAL | KEYBOARD_ACTIVATION); |
236 |
} |
268 |
} |
237 |
|
269 |
|
238 |
/** |
270 |
/** |
239 |
- |
|
|