{"thread":{"id":"11810","subject":"[EGIT PATCH] Use keyboard arrow keys to go to the next and previous find results.","startedAt":"2008-02-01T02:12:39Z","lastAt":"2008-02-01T05:48:49Z","messageCount":2,"participants":["Roger C. Soares","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67002","messageId":"1201831959-3805-1-git-send-email-rogersoares@intelinet.com.br","threadId":"11810","inReplyTo":null,"subject":"[EGIT PATCH] Use keyboard arrow keys to go to the next and previous find results.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-02-01T02:12:39Z","receivedAt":"2008-02-01T02:12:39Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"On the history find toolbar, if the pattern text field has focus,\nthe down arrow key will generate a next event and the up arrow key\nwill generate the previous event.\n\nSigned-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n---\n .../src/org/spearce/egit/ui/FindToolbar.java       |   23 +++++++++++++++++++-\n 1 files changed, 22 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/FindToolbar.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/FindToolbar.java\nindex bc48371..5527453 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/FindToolbar.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/FindToolbar.java\n@@ -21,6 +21,8 @@ import java.util.List;\n \n import org.eclipse.core.runtime.Preferences;\n import org.eclipse.swt.SWT;\n+import org.eclipse.swt.events.KeyAdapter;\n+import org.eclipse.swt.events.KeyEvent;\n import org.eclipse.swt.events.ModifyEvent;\n import org.eclipse.swt.events.ModifyListener;\n import org.eclipse.swt.events.SelectionAdapter;\n@@ -193,7 +195,7 @@ public class FindToolbar extends Composite {\n \t\t\t}\n \t\t});\n \n-\t\tListener findButtonsListener = new Listener() {\n+\t\tfinal Listener findButtonsListener = new Listener() {\n \t\t\tpublic void handleEvent(Event event) {\n \t\t\t\tif (patternField.getText().length() > 0\n \t\t\t\t\t\t&& findResults.size() == 0) {\n@@ -242,6 +244,25 @@ public class FindToolbar extends Composite {\n \t\tnextButton.addListener(SWT.Selection, findButtonsListener);\n \t\tpreviousButton.addListener(SWT.Selection, findButtonsListener);\n \n+\t\tpatternField.addKeyListener(new KeyAdapter() {\n+\t\t\tprivate Event event = new Event();\n+\n+\t\t\t@Override\n+\t\t\tpublic void keyPressed(KeyEvent e) {\n+\t\t\t\tif(e.keyCode == SWT.ARROW_DOWN) {\n+\t\t\t\t\tif(nextButton.isEnabled()) {\n+\t\t\t\t\t\tevent.widget = nextButton;\n+\t\t\t\t\t\tfindButtonsListener.handleEvent(event);\n+\t\t\t\t\t}\n+\t\t\t\t} else if(e.keyCode == SWT.ARROW_UP) {\n+\t\t\t\t\tif(previousButton.isEnabled()) {\n+\t\t\t\t\t\tevent.widget = previousButton;\n+\t\t\t\t\t\tfindButtonsListener.handleEvent(event);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t});\n+\n \t\tcaseItem.addSelectionListener(new SelectionAdapter() {\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t\t\t\tprefs.setValue(UIPreferences.FINDTOOLBAR_IGNORE_CASE, caseItem\n-- \n1.5.3.7\n"},{"id":"67008","messageId":"200802010648.51209.robin.rosenberg@dewire.com","threadId":"11810","inReplyTo":"1201831959-3805-1-git-send-email-rogersoares@intelinet.com.br","subject":"Re: [EGIT PATCH] Use keyboard arrow keys to go to the next and previous find results.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-01T05:48:49Z","receivedAt":"2008-02-01T05:48:49Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"fredagen den 1 februari 2008 skrev Roger C. Soares:\n> On the history find toolbar, if the pattern text field has focus,\n> the down arrow key will generate a next event and the up arrow key\n\nWonderful. Pushed.\n\n-- robin\n"}]}