From 7970d553df6a4fc5c1ea0b002fb78574de29292f Mon Sep 17 00:00:00 2001 From: Michael Scharf Date: Tue, 22 Jan 2008 20:24:06 +0000 Subject: [PATCH] FIXED - bug 211659: Add FieldAssist to the terminal input field https://bugs.eclipse.org/bugs/show_bug.cgi?id=211659 --- .../control/CommandInputFieldWithHistory.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java b/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java index 13c2cbf8d12..4fc3a062b5d 100644 --- a/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java +++ b/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java @@ -211,8 +211,18 @@ public class CommandInputFieldWithHistory implements ICommandInputField { } fInputField.setLayoutData(data); fInputField.setFont(terminal.getFont()); + // register the field assist + new ContentAssistCommandAdapter( + fInputField, + new TextContentAdapter(), + new FieldAssist(), + null, + null, + installDecoration); fInputField.addKeyListener(new KeyListener(){ public void keyPressed(KeyEvent e) { + if(!e.doit) + return; if(e.keyCode=='\n' || e.keyCode=='\r') { e.doit=false; String line=fInputField.getText(); @@ -240,14 +250,6 @@ public class CommandInputFieldWithHistory implements ICommandInputField { public void keyReleased(KeyEvent e) { } }); - // register the field assist - new ContentAssistCommandAdapter( - fInputField, - new TextContentAdapter(), - new FieldAssist(), - null, - null, - installDecoration); } public void setFont(Font font) { fInputField.setFont(font);