changeset 132:9ee013fde4d8

*** empty log message ***
author pin
date Mon, 21 Jan 2008 09:26:54 +0900
parents 61f82e84937a
children 1fce8ece5eeb
files src/remoteeditor/command/REPCommand.java src/remoteeditor/editors/RemoteEditor.java
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/remoteeditor/command/REPCommand.java	Mon Jan 21 07:18:11 2008 +0900
+++ b/src/remoteeditor/command/REPCommand.java	Mon Jan 21 09:26:54 2008 +0900
@@ -32,6 +32,9 @@
 		this(cmd.cmd, cmd.sid, cmd.eid, cmd.seq, cmd.lineno, cmd.string.length(), new String(cmd.string));
 	}
 
+	public REPCommand() {
+		// TODO Auto-generated constructor stub
+	}
 	public String toString(){
 		String repCmdString = new String(cmd + "," + sid + "," + eid + "," + seq + "," + lineno + "," + textsiz + "," + string);
 		return repCmdString;
--- a/src/remoteeditor/editors/RemoteEditor.java	Mon Jan 21 07:18:11 2008 +0900
+++ b/src/remoteeditor/editors/RemoteEditor.java	Mon Jan 21 09:26:54 2008 +0900
@@ -191,9 +191,17 @@
 	}
 	
 	private void createUndoCommand(int cmd, String replacedText, String inputText, int line) {
-		// TODO Auto-generated method stub
+		int undoCmd;
+		String undoString;
+		REPCommand undoCommand = new REPCommand();
 		if(cmd == REP.REPCMD_INSERT){
-			
+			undoCmd = REP.REPCMD_DELETE;
+			undoString = "";
+		}else if(cmd == REP.REPCMD_REPLACE){
+			undoCmd = REP.REPCMD_REPLACE;
+		}else if(cmd == REP.REPCMD_DELETE){
+			undoCmd = REP.REPCMD_INSERT;
+			undoString = replacedText;
 		}
 	}