Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-12-23 11:20:24 +0000
committerThomas Wolf2019-12-23 11:36:13 +0000
commita7a825dc8b70a78190a16c90e4046480acdfc857 (patch)
tree2660089c5cba6e32b274478e5d9507e41e7addeb
parent151dbb8d8e088004fc3c16d9ceaa5a5ec998e5a6 (diff)
downloadegit-a7a825dc8b70a78190a16c90e4046480acdfc857.tar.gz
egit-a7a825dc8b70a78190a16c90e4046480acdfc857.tar.xz
egit-a7a825dc8b70a78190a16c90e4046480acdfc857.zip
[ref filters] Keyboard activation for editing filters
Activate the inline editor on F2, too. F2 is the standard binding for the rename command. Space is already taken for toggling the checkbox, and <return> for the OK button. Change-Id: Ib18a79beb74f412e79afd0defcbf5b2632ea1db9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryRefFilterConfigurationDialog.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryRefFilterConfigurationDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryRefFilterConfigurationDialog.java
index 171774f3d..ac8eb6944 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryRefFilterConfigurationDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryRefFilterConfigurationDialog.java
@@ -74,6 +74,9 @@ import org.eclipse.ui.preferences.ViewSettingsDialog;
public class GitHistoryRefFilterConfigurationDialog
extends ViewSettingsDialog {
+ /** Standard binding for the rename command. */
+ private static final int EDITOR_ACTIVATION_KEY = SWT.F2;
+
private static final String FILTER_COLUMN_NAME = "filter"; //$NON-NLS-1$
private static final String NEW_FILTER_INITIAL_STRING = "refs/*"; //$NON-NLS-1$
@@ -280,11 +283,14 @@ public class GitHistoryRefFilterConfigurationDialog
boolean isLeftDoubleClick = event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
&& ((MouseEvent) event.sourceEvent).button == 1;
return singleSelect && (isLeftDoubleClick
- || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC);
+ || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
+ || event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
+ && event.keyCode == EDITOR_ACTIVATION_KEY);
}
};
TableViewerEditor.create(configsTable, focusCellManager,
- editorActivation, ColumnViewerEditor.DEFAULT);
+ editorActivation, ColumnViewerEditor.DEFAULT
+ | ColumnViewerEditor.KEYBOARD_ACTIVATION);
editor = new TextCellEditor(configsTable.getTable()) {
@@ -339,7 +345,8 @@ public class GitHistoryRefFilterConfigurationDialog
@Override
public void beforeEditorActivated(
ColumnViewerEditorActivationEvent event) {
- // Nothing
+ configsTable.reveal(configsTable
+ .getStructuredSelection().getFirstElement());
}
@Override

Back to the top