diff --git a/terminal/org.eclipse.tm.terminal/.classpath b/terminal/org.eclipse.tm.terminal/.classpath
index 52165ecfb58..73022aacf0d 100644
--- a/terminal/org.eclipse.tm.terminal/.classpath
+++ b/terminal/org.eclipse.tm.terminal/.classpath
@@ -1,7 +1,7 @@
-
+
diff --git a/terminal/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs b/terminal/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs
index 138063a1c19..64e23de578a 100644
--- a/terminal/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs
+++ b/terminal/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,12 @@
-#Fri Mar 28 14:14:24 CET 2008
+#Fri Apr 11 02:37:35 CEST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
diff --git a/terminal/org.eclipse.tm.terminal/META-INF/MANIFEST.MF b/terminal/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
index 4f1a7ce0093..d62bf57e9d5 100644
--- a/terminal/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
+++ b/terminal/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
Bundle-ClassPath: .
Export-Package: org.eclipse.tm.internal.terminal.connector;x-friends:="org.eclipse.tm.terminal.test",
org.eclipse.tm.internal.terminal.control;x-friends:="org.eclipse.tm.terminal.view",
diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java
index a41fd2b36cb..29b264c4e22 100644
--- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java
+++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java
@@ -1,18 +1,18 @@
/*******************************************************************************
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
* Michael Scharf (Wind River) - initial implementation
* Michael Scharf (Wing River) - [211659] Add field assist to terminal input field
* Michael Scharf (Wing River) - [196447] The optional terminal input line should be resizeable
+ * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
*******************************************************************************/
package org.eclipse.tm.internal.terminal.control;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -42,10 +42,10 @@ import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
*
* Navigate with ARROW_UP,ARROW_DOWN,PAGE_UP,PAGE_DOWN
* ESC to cancel history editing
- * History can be edited (by moving up and edit) but changes are
- * not persistent (like in bash).
- * If the same command is entered multiple times in a row,
- * only one entry is kept in the history.
+ * History can be edited (by moving up and edit) but changes are
+ * not persistent (like in bash).
+ * If the same command is entered multiple times in a row,
+ * only one entry is kept in the history.
*
*
*/
@@ -69,10 +69,10 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
}
return (IContentProposal[]) result.toArray(new IContentProposal[result.size()]);
}
-
+
}
private static class Proposal implements IContentProposal {
-
+
private final String fContent;
private final String fLabel;
Proposal(String content, String label) {
@@ -82,15 +82,15 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
public String getContent() {
return fContent;
}
-
+
public String getLabel() {
return fLabel;
}
-
+
public String getDescription() {
return null;
}
-
+
public int getCursorPosition() {
return fContent.length();
}
@@ -118,7 +118,7 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
fMaxSize=maxHistorySize;
}
/**
- * Add a line to the history.
+ * Add a line to the history.
* @param line The line to be added to the history.
*/
protected void pushLine(String line) {
@@ -143,7 +143,20 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
fHistory.clear();
if(history==null)
return;
- fHistory.addAll(Arrays.asList(history.split("\n"))); //$NON-NLS-1$
+ // add history entries separated by '\n'
+ // fHistory.addAll(Arrays.asList(history.split("\n"))); //$NON-NLS-1$
+ //
+ int i = 0;
+ int j = history.indexOf('\n');
+ while (j > i) {
+ fHistory.add(history.substring(i, j));
+ do {
+ j++;
+ } while (j < history.length() && history.charAt(j) == '\n');
+ i = j;
+ j = history.indexOf('\n', i);
+ }
+ //
}
/**
* @return the current content of the history buffer and new line separated list
@@ -218,7 +231,7 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
GridData gdata = (GridData) fInputField.getLayoutData();
Rectangle sashRect = fSash.getBounds ();
Rectangle containerRect = parent.getClientArea ();
-
+
int h=fInputField.getLineHeight();
// make sure the input filed hight is a multiple of the line height
gdata.heightHint = Math.max(((containerRect.height-e.y-sashRect.height)/h)*h,h);
@@ -248,7 +261,7 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
new ContentAssistCommandAdapter(
fInputField,
new TextContentAdapter(),
- new FieldAssist(),
+ new FieldAssist(),
null,
null,
installDecoration);
@@ -295,6 +308,6 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
fSash=null;
fInputField.dispose();
fInputField=null;
-
+
}
}
\ No newline at end of file
diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java
index e931e6ee3dd..f43bef9396f 100644
--- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java
+++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java
@@ -14,6 +14,7 @@
* Michael Scharf (Wind River) - split into core, view and connector plugins
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
* Michael Scharf (Wind River) - [209746] There are cases where some colors not displayed correctly
+ * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
*******************************************************************************/
package org.eclipse.tm.internal.terminal.emulator;
@@ -23,7 +24,6 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
@@ -839,10 +839,8 @@ public class VT100Emulator implements ControlListener {
String positionReport = "\u001b[" + (relativeCursorLine() + 1) + ";" + //$NON-NLS-1$ //$NON-NLS-2$
(getCursorColumn() + 1) + "R"; //$NON-NLS-1$
- OutputStreamWriter streamWriter = new OutputStreamWriter(terminal
- .getOutputStream(), Charset.forName("ISO-8859-1")); //$NON-NLS-1$
-
try {
+ OutputStreamWriter streamWriter = new OutputStreamWriter(terminal.getOutputStream(), "ISO-8859-1"); //$NON-NLS-1$
streamWriter.write(positionReport, 0, positionReport.length());
streamWriter.flush();
} catch (IOException ex) {
diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
index b8131aa9e13..9ec0d1c789c 100644
--- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
+++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -54,7 +55,16 @@ public class TerminalTextData implements ITerminalTextData {
buff.append(term.getChar(line, column));
}
}
- return buff.toString().replaceAll("\000+", ""); //$NON-NLS-1$//$NON-NLS-2$
+ // get rid of the empty space at the end of the lines
+ //return buff.toString().replaceAll("\000+", ""); //$NON-NLS-1$//$NON-NLS-2$
+ //
+ int i = buff.length() - 1;
+ while (i >= 0 && buff.charAt(i) == '\000') {
+ i--;
+ }
+ buff.setLength(i + 1);
+ return buff.toString();
+ //
}
/**
diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
index 2232823aac4..5decdabf3d9 100644
--- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
+++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
*******************************************************************************/
package org.eclipse.tm.internal.terminal.textcanvas;
@@ -293,7 +294,14 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
if(line==fSelectionStartLine)
text=text.substring(Math.min(fSelectionStartCoumn,text.length()));
// get rid of the empty space at the end of the lines
- text=text.replaceAll("\000+$",""); //$NON-NLS-1$//$NON-NLS-2$
+ // text=text.replaceAll("\000+$",""); //$NON-NLS-1$//$NON-NLS-2$
+ //
+ int i = text.length() - 1;
+ while (i >= 0 && text.charAt(i) == '\000') {
+ i--;
+ }
+ text = text.substring(0, i + 1);
+ //
// null means space
text=text.replace('\000', ' ');
} else {