changeset 106:8a3880cd858b

*** empty log message ***
author pin
date Sun, 23 Dec 2007 10:32:27 +0900
parents 6c209de0dd99
children 823a45f843a9
files bin/remoteeditor/editors/RemoteEditor.class src/remoteeditor/editors/RemoteEditor.java
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file bin/remoteeditor/editors/RemoteEditor.class has changed
--- a/src/remoteeditor/editors/RemoteEditor.java	Sat Dec 22 21:11:01 2007 +0900
+++ b/src/remoteeditor/editors/RemoteEditor.java	Sun Dec 23 10:32:27 2007 +0900
@@ -285,11 +285,38 @@
 					e.printStackTrace();
 				}
 			break;
+		case REP.REPCMD_READ_ACK:
+			try {
+					read(command);
+				} catch (BadLocationException e) {
+					e.printStackTrace();
+				}
+			break;
 		}
 	}
 
 
 
+	private void read(REPCommand command) throws BadLocationException {
+		if(command.sid != mysid) return;
+		if(command.eid != myeid) return;
+		final int offset = document.getLineOffset(command.lineno);
+		final String string = command.string + "¥n";
+		
+		viewer.getTextWidget().getDisplay().syncExec(new Runnable() {
+			public void run() {
+				try {
+					lock = true;
+					//document.replace(offset, replaceLength, changedText);
+					document.replace(offset, 0, string);
+					lock = false;
+				} catch (BadLocationException e) {
+					e.printStackTrace();
+				}
+			}
+		});
+	}
+
 	private void textDelete(int lineNo, int len, String string) throws BadLocationException {
 		final int offset = document.getLineOffset(lineNo);
 		//final String changedText = string;