changeset 288:d93b062eadaa

*** empty log message ***
author kono
date Mon, 29 Sep 2008 05:11:49 +0900
parents 1ff8bfc0a99a
children d59f4e9e7ad1
files test/sematest/TestEditor.java
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/sematest/TestEditor.java	Sun Sep 28 15:46:36 2008 +0900
+++ b/test/sematest/TestEditor.java	Mon Sep 29 05:11:49 2008 +0900
@@ -88,20 +88,24 @@
 		channel.register(selector, SelectionKey.OP_READ);
 		while(running) {
 			if (selector.select(timeout)<=0) {
-				REPCommand cmd = cmds.poll();
-				if (cmd!=null) {
-					text.edit(cmd);
-					sendCommand(cmd);
-				} else {
-					// no more command to send
-					timeout = 0;
-				}
+				userInput();
 			} else {
 				handle(channel.read());
 			}
 		}
 	}
 
+	private void userInput() {
+		REPCommand cmd = cmds.poll();
+		if (cmd!=null) {
+			text.edit(cmd);
+			sendCommand(cmd);
+		} else {
+			// no more command to send
+			timeout = 0;
+		}
+	}
+
 
 	private void sendCommand(REPCommand cmd) {
 		cmd.setSEQID(seq++);