diff --git a/site/category.xml b/site/category.xml
new file mode 100644
index 00000000000..58e44b5cb64
--- /dev/null
+++ b/site/category.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TM Terminal Features
+
+
+
+
+ TM Terminal SDK Features
+
+
+
+
+ TM Terminal Examples, Tests
+
+
+
+
+
+
+ Dependencies
+
+
+
diff --git a/site/pom.xml b/site/pom.xml
new file mode 100755
index 00000000000..f699ca1c9d2
--- /dev/null
+++ b/site/pom.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ 4.0.0
+
+ org.eclipse.tm
+ tm-parent
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.rse
+ org.eclipse.tm.site
+ 4.5.102-SNAPSHOT
+ eclipse-repository
+
diff --git a/terminal/.gitignore b/terminal/.gitignore
new file mode 100644
index 00000000000..0751d5c9ae4
--- /dev/null
+++ b/terminal/.gitignore
@@ -0,0 +1,17 @@
+# ignore various emacs droppings
+*~
+\#*\#
+
+# .
+workspace
+debug-workspace
+
+# Ignored throughout the whole tree
+bin/
+target/
+coverage/
+artifacts/
+/ManifestValidationResult.html
+
+# MacOSX
+.DS_Store
diff --git a/terminal/CONTRIBUTING b/terminal/CONTRIBUTING
new file mode 100644
index 00000000000..871327d9889
--- /dev/null
+++ b/terminal/CONTRIBUTING
@@ -0,0 +1,50 @@
+Contributing to Target Management Terminal
+==========================================
+
+Thanks for your interest in this project.
+
+Project description:
+--------------------
+
+The Target Management Terminal is a lightweight VT100 terminal implementation. The project provides a re-usable terminal widget,
+a set of predefined terminal connectors (i.e. SSH and local shell) and a view managing the terminal sessions.
+
+Developer resources:
+--------------------
+
+Source Repositories:
+
+You can use the code from these repositories to experiment, test, build, create patches, issue pull requests, etc. This project uses Gerrit Code Review; please see contributing via Gerrit (https://wiki.eclipse.org/Gerrit).
+
+tm/org.eclipse.tm.terminal - Target Management Terminal
+ Clone: https://git.eclipse.org/r/tm/org.eclipse.tm.terminal
+ Browse Repository: http://git.eclipse.org/c/tm/org.eclipse.tm.terminal.git
+ Review with Gerrit: https://git.eclipse.org/r/p/tm/org.eclipse.tm.terminal
+
+Contributor License Agreement:
+------------------------------
+
+Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).
+
+- http://www.eclipse.org/legal/CLA.php
+
+Contact:
+--------
+
+Contact the project developers via the project's "dev" list.
+
+- https://dev.eclipse.org/mailman/listinfo/tm-dev
+
+Search for bugs:
+----------------
+
+This project uses Bugzilla to track ongoing development and issues.
+
+- https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Tools&component=Terminal&list_id=11564722&product=Target%20Management&query_format=advanced
+
+Create a new bug:
+-----------------
+
+Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!
+
+- https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Target%20Management&component=Terminal
diff --git a/terminal/admin/.gitignore b/terminal/admin/.gitignore
new file mode 100644
index 00000000000..ea8c4bf7f35
--- /dev/null
+++ b/terminal/admin/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/terminal/admin/.project b/terminal/admin/.project
new file mode 100644
index 00000000000..fd600362323
--- /dev/null
+++ b/terminal/admin/.project
@@ -0,0 +1,38 @@
+
+
+ Administration (TM Terminal)
+
+
+
+
+
+
+
+
+
+ CONTRIBUTING
+ 1
+ PARENT-1-PROJECT_LOC/CONTRIBUTING
+
+
+ pom.xml
+ 1
+ PARENT-1-PROJECT_LOC/pom.xml
+
+
+ readme.txt
+ 1
+ PARENT-1-PROJECT_LOC/readme.txt
+
+
+ terminals.psf
+ 1
+ PARENT-1-PROJECT_LOC/terminals.psf
+
+
+ toplevel.gitignore
+ 1
+ PARENT-1-PROJECT_LOC/.gitignore
+
+
+
diff --git a/terminal/admin/findbugs-exclude.xml b/terminal/admin/findbugs-exclude.xml
new file mode 100644
index 00000000000..7e5962c7154
--- /dev/null
+++ b/terminal/admin/findbugs-exclude.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/admin/pom-build.xml b/terminal/admin/pom-build.xml
new file mode 100644
index 00000000000..4da5f4544ea
--- /dev/null
+++ b/terminal/admin/pom-build.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-config
+ 4.5.100-SNAPSHOT
+ pom-config.xml
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ pom
+ TM Terminal, Maven Build Master
+
+
+
+
+ org.eclipse.tycho
+ tycho-maven-plugin
+
+
+ org.eclipse.tycho
+ target-platform-configuration
+
+
+ org.eclipse.tycho
+ tycho-source-plugin
+
+
+
+
+
+
+ findbugs
+
+
+
+ org.codehaus.mojo
+ findbugs-maven-plugin
+
+
+
+
+
+ static-checks
+
+
+
+ org.codehaus.mojo
+ findbugs-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+
+
+
+
+
+ tests
+
+
+
+ org.eclipse.tycho
+ target-platform-configuration
+
+
+
+
+
+ p2-installable-unit
+ org.eclipse.platform.ide
+ 0.0.0
+
+
+ eclipse-feature
+ org.eclipse.sdk
+ 0.0.0
+
+
+ eclipse-feature
+ org.eclipse.cdt.platform
+ 0.0.0
+
+
+ eclipse-feature
+ org.eclipse.remote
+ 0.0.0
+
+
+ eclipse-feature
+ org.eclipse.swtbot.eclipse
+ 0.0.0
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+
+
+
+ prepare-agent
+
+
+
+ org.eclipse.tm.terminal*
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/admin/pom-config.xml b/terminal/admin/pom-config.xml
new file mode 100644
index 00000000000..21a4dba63e9
--- /dev/null
+++ b/terminal/admin/pom-config.xml
@@ -0,0 +1,94 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm
+ tm-parent
+ 4.5.100-SNAPSHOT
+ ../../
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-config
+ pom
+ TM Terminal, Maven Configuration Master
+
+
+
+ Eclipse Public License
+ https://www.eclipse.org/legal/epl-2.0/
+ repo
+
+ All rights reserved.
+
+ This program and the accompanying materials are made
+ available under the terms of the Eclipse Public License 2.0
+ which accompanies this distribution, and is available at
+ https://www.eclipse.org/legal/epl-2.0/
+
+
+
+
+
+ Eclipse Foundation
+ http://www.eclipse.org/
+
+
+
+
+ ${env.WORKSPACE}/admin
+ UTF-8
+
+
+ false
+ file
+ true
+
+ development
+ ${project.artifactId}.zip
+ /home/data/httpd/download.eclipse.org/tm/terminal/builds/${terminal-stream}/nightly
+ scm:git:git://git.eclipse.org/gitroot/tm/org.eclipse.tm.git
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ 3.8
+
+ utf-8
+ 100
+ 1.7
+ xml
+ false
+
+ **/UbcCheck.java
+
+
+
+
+
+ cpd-check
+
+
+
+
+
+
+
+
diff --git a/terminal/admin/target-defs/eclipse-4.8.x-photon.target b/terminal/admin/target-defs/eclipse-4.8.x-photon.target
new file mode 100644
index 00000000000..39952d614f2
--- /dev/null
+++ b/terminal/admin/target-defs/eclipse-4.8.x-photon.target
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/admin/target-defs/tm-baseline.target b/terminal/admin/target-defs/tm-baseline.target
new file mode 100644
index 00000000000..e2b7e52557e
--- /dev/null
+++ b/terminal/admin/target-defs/tm-baseline.target
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/.project
new file mode 100644
index 00000000000..ea0d993407f
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.cdtserial.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.properties
new file mode 100644
index 00000000000..a90186dd5a5
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2017, 2018 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Serial Connector Extensions
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A serial line connector for the Terminal
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2017 QNX Software Systems and others.\
+All rights reserved. This program and the accompanying materials\
+are made available under the terms of the Eclipse Public License 2.0\
+which accompanies this distribution, and is available at\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.xml
new file mode 100644
index 00000000000..b198559013e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/feature.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/pom.xml
new file mode 100644
index 00000000000..bf559ad5aea
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.cdtserial.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/.project
new file mode 100644
index 00000000000..b870ea2d162
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.cdtserial.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.properties
new file mode 100644
index 00000000000..67f7b2eb272
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2017, 2018 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Serial Connector Extensions, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A serial line connector for the Terminal
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2017 QNX Software Systems and others.\
+All rights reserved. This program and the accompanying materials\
+are made available under the terms of the Eclipse Public License 2.0\
+which accompanies this distribution, and is available at\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.xml
new file mode 100644
index 00000000000..570add7fec7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/feature.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/pom.xml
new file mode 100644
index 00000000000..a02406184db
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.cdtserial.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/.project
new file mode 100644
index 00000000000..2b177926011
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.local.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.properties
new file mode 100644
index 00000000000..9acef2d3f8a
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Local Connector Extensions
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A connector implementation for the Local Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.xml
new file mode 100644
index 00000000000..02ff5e2e12e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/p2.inf b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/p2.inf
new file mode 100644
index 00000000000..aa2b22ba1aa
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/p2.inf
@@ -0,0 +1,22 @@
+###############################################################################
+# Copyright (c) 2014, 2015 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+# Make the org.eclipse.cdt.native feature dependency "optional" since it didn't
+# exist in CDT 8.3 and we can also work on top of CDT 8.3.
+
+# The real dependencies are all properly managed via p2.inf in the
+# org.eclipse.tm.terminal.connector.process/META-INF/p2.inf file.
+# The only benefit of requesting the feature here is that it allow pulling in
+# additional fragments that we are not aware of in the bundle's p2.inf.
+
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = org.eclipse.cdt.native.feature.group
+requires.0.greedy = true
+requires.0.optional = true
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/pom.xml
new file mode 100644
index 00000000000..215d3563580
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.local.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/.project
new file mode 100644
index 00000000000..e85d50ff010
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.local.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.properties
new file mode 100644
index 00000000000..e3339ab9f3b
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Local Connector Extensions, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A connector implementation for the Local Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.xml
new file mode 100644
index 00000000000..efdefed91c7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/feature.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/pom.xml
new file mode 100644
index 00000000000..ac14412495e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.local.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/.project
new file mode 100644
index 00000000000..678a8ee6245
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.remote.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/build.properties
new file mode 100644
index 00000000000..de0d7aecfa8
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/build.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.properties
new file mode 100644
index 00000000000..d1943459533
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.properties
@@ -0,0 +1,35 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal via Remote API Connector Extensions
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A Terminal Connector using the org.eclipse.remote API.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2015, 2017 IBM Corporation and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.xml
new file mode 100644
index 00000000000..fe0d35a4280
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/feature.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/pom.xml
new file mode 100644
index 00000000000..f4665073bf2
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.remote.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/.project
new file mode 100644
index 00000000000..f63833fdb66
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.remote.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/build.properties
new file mode 100644
index 00000000000..38d32796c6d
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/build.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+
+bin.includes = feature.xml,\
+ feature.properties
+
+generate.plugin@org.eclipse.tm.terminal.remote.source=org.eclipse.tm.terminal.remote
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.properties
new file mode 100644
index 00000000000..24a2e7d8681
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.properties
@@ -0,0 +1,35 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal via Remote API Connector Extensions, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=An remote connector implementation for the Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2015, 2017 IBM Corporation and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.xml
new file mode 100644
index 00000000000..54556b9ec4a
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/feature.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/pom.xml
new file mode 100644
index 00000000000..3dee0088fac
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.remote.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.remote.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/.project
new file mode 100644
index 00000000000..c96f85db4dd
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.ssh.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/build.properties
new file mode 100644
index 00000000000..8e3ce5326b9
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.properties
new file mode 100644
index 00000000000..2c8e307d916
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal SSH Connector Extensions
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=An SSH connector implementation for the Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2000, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.xml
new file mode 100644
index 00000000000..7943d715af7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/pom.xml
new file mode 100644
index 00000000000..61100c70ff7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.ssh.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/.project
new file mode 100644
index 00000000000..3a7e0685dd4
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.ssh.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/build.properties
new file mode 100644
index 00000000000..8e3ce5326b9
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.properties
new file mode 100644
index 00000000000..b650b956f92
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal SSH Connector Extensions, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=An SSH connector implementation for the Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2000, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.xml
new file mode 100644
index 00000000000..6376b5b2d55
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/feature.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/pom.xml
new file mode 100644
index 00000000000..e829e93606c
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.ssh.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/.project
new file mode 100644
index 00000000000..97df9e70ce7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.telnet.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.properties
new file mode 100644
index 00000000000..a3b734b888f
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Telnet Connector Extensions
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A Telnet connector implementation for the Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.xml
new file mode 100644
index 00000000000..9d3b67a4c24
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/pom.xml
new file mode 100644
index 00000000000..49038af80cc
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.telnet.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/.project
new file mode 100644
index 00000000000..7abe52415a8
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.connector.telnet.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/build.properties
new file mode 100644
index 00000000000..c33f2d71b1e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.properties
new file mode 100644
index 00000000000..0c4787ac81c
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Telnet Connector Extensions, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=A Telnet connector implementation for the Terminal.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2017 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.xml
new file mode 100644
index 00000000000..2792c30cafd
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/feature.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/pom.xml
new file mode 100644
index 00000000000..b7efd30ce3d
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.connector.telnet.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/.project b/terminal/features/org.eclipse.tm.terminal.control.feature/.project
new file mode 100644
index 00000000000..2002b5a3f20
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.control.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties
new file mode 100644
index 00000000000..bfccdf49079
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.control.feature/feature.properties
new file mode 100644
index 00000000000..df9c50ce7f9
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/feature.properties
@@ -0,0 +1,39 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Control
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.4 Updates
+
+# "description" property - description of the feature
+description=An ANSI (vt102) compatible Terminal widget \
+with RCP-only dependencies.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2018 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.control.feature/feature.xml
new file mode 100644
index 00000000000..f0429f896ea
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/feature.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.control.feature/pom.xml
new file mode 100644
index 00000000000..60580345f14
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+ 4.5.102-SNAPSHOT
+
+ org.eclipse.tm.terminal.control.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/.project
new file mode 100644
index 00000000000..09a6bce3e20
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.control.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/build.properties
new file mode 100644
index 00000000000..bfccdf49079
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/build.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Uwe Stieber (Wind River) - Bug 434937 - Releng: The Terminal Features have an incorrect license
+################################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.properties
new file mode 100644
index 00000000000..acbfce1de76
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.properties
@@ -0,0 +1,39 @@
+###############################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Oberhuber (Wind River) - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal Control, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.4 Updates
+
+# "description" property - description of the feature
+description=An ANSI (vt102) compatible Terminal widget \
+with RCP-only dependencies.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2003, 2018 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.xml
new file mode 100644
index 00000000000..07d5e69347d
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/pom.xml
new file mode 100644
index 00000000000..0d4df06551b
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.control.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/.project b/terminal/features/org.eclipse.tm.terminal.feature/.project
new file mode 100644
index 00000000000..a456794a2fa
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.tm.terminal.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
+
+ 1311579318584
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.feature/build.properties
new file mode 100644
index 00000000000..b801dc44f40
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties,\
+ p2.inf
+src.includes = feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.feature/feature.properties
new file mode 100644
index 00000000000..bd474c35387
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/feature.properties
@@ -0,0 +1,40 @@
+##################################################################################
+# Copyright (c) 2015, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.4 Updates
+
+# "description" property - description of the feature
+description=An integrated Eclipse View for the local command prompt (console) or \
+ remote hosts (SSH, Telnet, Serial). Works on Windows, Linux, Mac and Solaris. \
+ Requires Eclipse 3.8.2 or newer and a Java 6 or newer JRE.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 - 2018 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.feature/feature.xml
new file mode 100644
index 00000000000..2c69251458e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/feature.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/p2.inf b/terminal/features/org.eclipse.tm.terminal.feature/p2.inf
new file mode 100644
index 00000000000..a6c5ff197fb
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/p2.inf
@@ -0,0 +1,5 @@
+update.id=org.eclipse.tcf.te.terminals.feature.feature.group
+update.range=(0,$version$)
+provides.99.namespace=org.eclipse.equinox.p2.iu
+provides.99.name=org.eclipse.tcf.te.terminals.feature.feature.group
+provides.99.version=$version$
diff --git a/terminal/features/org.eclipse.tm.terminal.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.feature/pom.xml
new file mode 100644
index 00000000000..7794403d6bc
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.feature/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.feature
+ 4.5.200-SNAPSHOT
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project
new file mode 100644
index 00000000000..48e5c337375
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project
@@ -0,0 +1,33 @@
+
+
+ org.eclipse.tm.terminal.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+ org.eclipse.pde.ds.core.builder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
+
+ 1311579318584
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties
new file mode 100644
index 00000000000..9ac7f804cc8
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
+src.includes = feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties
new file mode 100644
index 00000000000..3f78a9b8022
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties
@@ -0,0 +1,40 @@
+##################################################################################
+# Copyright (c) 2015, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=TM Terminal, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.4 Updates
+
+# "description" property - description of the feature
+description=An integrated Eclipse View for the local command prompt (console) or \
+ remote hosts via (SSH, Telnet, Serial). Works on Windows, Linux, Mac and Solaris. \
+ Requires Eclipse 3.8.2 or newer and a Java 6 or newer JRE.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 - 2018 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml
new file mode 100644
index 00000000000..ca554a3bd9b
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/p2.inf b/terminal/features/org.eclipse.tm.terminal.sdk.feature/p2.inf
new file mode 100644
index 00000000000..d5add3dbcc3
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/p2.inf
@@ -0,0 +1,5 @@
+update.id=org.eclipse.tcf.te.terminals.sdk.feature.feature.group
+update.range=(0,$version$)
+provides.99.namespace=org.eclipse.equinox.p2.iu
+provides.99.name=org.eclipse.tcf.te.terminals.sdk.feature.feature.group
+provides.99.version=$version$
diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml
new file mode 100644
index 00000000000..e5168cc7f29
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.feature/.project b/terminal/features/org.eclipse.tm.terminal.view.feature/.project
new file mode 100644
index 00000000000..1320e7a6255
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.feature/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.tm.terminal.view.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
+
+ 1311579318584
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.view.feature/build.properties
new file mode 100644
index 00000000000..b801dc44f40
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.feature/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties,\
+ p2.inf
+src.includes = feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.view.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.view.feature/feature.properties
new file mode 100644
index 00000000000..11b4c39a1f7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.feature/feature.properties
@@ -0,0 +1,40 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Terminal (Console) View
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=An integrated Eclipse View for the local command prompt (console) or \
+ remote hosts (SSH, Telnet, Serial). Works on Windows, Linux, Mac and Solaris. \
+ Requires Eclipse 3.8.2 or newer and a Java 6 or newer JRE.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 - 2016 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.view.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.view.feature/feature.xml
new file mode 100644
index 00000000000..2c4ec8b696b
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.feature/feature.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.view.feature/pom.xml
new file mode 100644
index 00000000000..4188445839a
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.feature/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.view.feature
+ 4.5.200-SNAPSHOT
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/.project
new file mode 100644
index 00000000000..c8ba6fd3f78
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/.project
@@ -0,0 +1,33 @@
+
+
+ org.eclipse.tm.terminal.view.sdk.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+ org.eclipse.pde.ds.core.builder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
+
+ 1311579318584
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/build.properties
new file mode 100644
index 00000000000..9ac7f804cc8
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/build.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
+src.includes = feature.properties
diff --git a/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.properties
new file mode 100644
index 00000000000..ce319c28598
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.properties
@@ -0,0 +1,40 @@
+##################################################################################
+# Copyright (c) 2011 - 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Terminal (Console) View, SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org - Target Management
+
+# "updateSiteName" property - label for the update site
+updateSiteName=TM Terminal 4.3 Updates
+
+# "description" property - description of the feature
+description=An integrated Eclipse View for the local command prompt (console) or \
+ remote hosts via (SSH, Telnet, Serial). Works on Windows, Linux, Mac and Solaris. \
+ Requires Eclipse 3.8.2 or newer and a Java 6 or newer JRE.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 - 2016 Wind River Systems, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+
+################ end of copyright property ####################################
diff --git a/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.xml
new file mode 100644
index 00000000000..9ef7dab4d7e
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/feature.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
diff --git a/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/pom.xml
new file mode 100644
index 00000000000..74c6faf6ae7
--- /dev/null
+++ b/terminal/features/org.eclipse.tm.terminal.view.sdk.feature/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.features
+ 4.5.100-SNAPSHOT
+
+
+ org.eclipse.tm.terminal.view.sdk.feature
+ eclipse-feature
+
+
+ true
+
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/terminal/features/pom.xml b/terminal/features/pom.xml
new file mode 100644
index 00000000000..1da93e88e52
--- /dev/null
+++ b/terminal/features/pom.xml
@@ -0,0 +1,69 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.features
+
+ pom
+
+
+ org.eclipse.tm.terminal.control.feature
+ org.eclipse.tm.terminal.control.sdk.feature
+
+ org.eclipse.tm.terminal.connector.local.feature
+ org.eclipse.tm.terminal.connector.local.sdk.feature
+ org.eclipse.tm.terminal.connector.remote.feature
+ org.eclipse.tm.terminal.connector.remote.sdk.feature
+ org.eclipse.tm.terminal.connector.ssh.feature
+ org.eclipse.tm.terminal.connector.ssh.sdk.feature
+ org.eclipse.tm.terminal.connector.telnet.feature
+ org.eclipse.tm.terminal.connector.telnet.sdk.feature
+
+ org.eclipse.tm.terminal.view.feature
+ org.eclipse.tm.terminal.view.sdk.feature
+
+ org.eclipse.tm.terminal.feature
+ org.eclipse.tm.terminal.sdk.feature
+
+
+
+
+
+
+ cdtserial
+
+
+
+ true
+
+ !nocdtserial
+
+
+
+ org.eclipse.tm.terminal.connector.cdtserial.feature
+ org.eclipse.tm.terminal.connector.cdtserial.sdk.feature
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.classpath
new file mode 100644
index 00000000000..eca7bdba8f0
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.options b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.options
new file mode 100644
index 00000000000..7a6120d0244
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.options
@@ -0,0 +1,2 @@
+org.eclipse.tm.terminal.connector.serial/debugmode = 0
+org.eclipse.tm.terminal.connector.serial/trace/serialLinePanel = false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.project
new file mode 100644
index 00000000000..4a564b77c17
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.project
@@ -0,0 +1,34 @@
+
+
+ org.eclipse.tm.terminal.connector.cdtserial
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..6f5171a972b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,361 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0d732269684
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.pde.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000000..cf80c8bc5b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..e131cd1b6f4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.cdtserial;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Activator: org.eclipse.tm.terminal.connector.cdtserial.activator.Activator
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.equinox.security;bundle-version="1.1.100",
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.control;bundle-version="4.5.0",
+ org.eclipse.ui;bundle-version="3.8.0",
+ org.eclipse.cdt.native.serial;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tm.terminal.connector.cdtserial.activator;x-internal:=true,
+ org.eclipse.tm.terminal.connector.cdtserial.connector,
+ org.eclipse.tm.terminal.connector.cdtserial.controls,
+ org.eclipse.tm.terminal.connector.cdtserial.launcher,
+ org.eclipse.tm.terminal.connector.cdtserial.nls;x-internal:=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/about.html
new file mode 100644
index 00000000000..fe4ae3f5b94
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
May 24, 2012
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/build.properties
new file mode 100644
index 00000000000..1c3465df7d0
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/build.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.properties
new file mode 100644
index 00000000000..b7e4a56d546
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.properties
@@ -0,0 +1,22 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Terminal Serial Connector
+providerName = Eclipse.org - Target Management
+
+# ----- Terminal Launcher Delegates -----
+
+SerialLauncherDelegate.label=Serial Terminal
+
+# ----- Terminal Connectors -----
+
+SerialConnector.label = Serial
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.xml
new file mode 100644
index 00000000000..583c143166c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/plugin.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/pom.xml
new file mode 100644
index 00000000000..2c35890725e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.cdtserial
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/activator/Activator.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/activator/Activator.java
new file mode 100644
index 00000000000..84edbb2733a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/activator/Activator.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.activator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tm.terminal.view.core.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+ // The shared instance
+ private static Activator plugin;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tm.terminal.connector.serial"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the Image object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The Image object instance or null.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the ImageDescriptor object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The ImageDescriptor object instance or null.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+
+ public static void log(IStatus status) {
+ plugin.getLog().log(status);
+ }
+
+ public static void log(Exception exception) {
+ if (exception instanceof CoreException) {
+ log(((CoreException) exception).getStatus());
+ } else {
+ log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), exception.getLocalizedMessage(), exception));
+ }
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialConnector.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialConnector.java
new file mode 100644
index 00000000000..9cfa234910b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialConnector.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.connector;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.cdt.serial.SerialPort;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
+import org.eclipse.tm.terminal.connector.cdtserial.activator.Activator;
+
+public class SerialConnector extends TerminalConnectorImpl {
+
+ private SerialSettings settings = new SerialSettings();
+ SerialPort serialPort;
+
+ private static Set openPorts = new HashSet<>();
+
+ public static boolean isOpen(String portName) {
+ return openPorts.contains(portName);
+ }
+
+ @Override
+ public OutputStream getTerminalToRemoteStream() {
+ return serialPort.getOutputStream();
+ }
+
+ public SerialSettings getSettings() {
+ return settings;
+ }
+
+ public SerialPort getSerialPort() {
+ return serialPort;
+ }
+
+ @Override
+ public String getSettingsSummary() {
+ return settings.getSummary();
+ }
+
+ @Override
+ public void load(ISettingsStore store) {
+ settings.load(store);
+ }
+
+ @Override
+ public void save(ISettingsStore store) {
+ settings.save(store);
+ }
+
+ @Override
+ public void connect(ITerminalControl control) {
+ super.connect(control);
+ control.setState(TerminalState.CONNECTING);
+
+ serialPort = new SerialPort(settings.getPortName());
+ try {
+ serialPort.setBaudRate(settings.getBaudRate());
+ serialPort.setByteSize(settings.getByteSize());
+ serialPort.setParity(settings.getParity());
+ serialPort.setStopBits(settings.getStopBits());
+ serialPort.open();
+ } catch (IOException e) {
+ Activator.log(e);
+ control.setState(TerminalState.CLOSED);
+ return;
+ }
+
+ openPorts.add(serialPort.getPortName());
+
+ new Thread() {
+ @Override
+ public void run() {
+ InputStream targetIn = serialPort.getInputStream();
+ byte[] buff = new byte[256];
+ int n;
+ try {
+ while ((n = targetIn.read(buff, 0, buff.length)) >= 0) {
+ if (n != 0) {
+ control.getRemoteToTerminalOutputStream().write(buff, 0, n);
+ }
+ }
+ disconnect();
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+ }
+ }.start();
+ control.setState(TerminalState.CONNECTED);
+ }
+
+ @Override
+ protected void doDisconnect() {
+ if (serialPort != null && serialPort.isOpen()) {
+ openPorts.remove(serialPort.getPortName());
+ try {
+ serialPort.close();
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+ }
+ serialPort = null;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialSettings.java
new file mode 100644
index 00000000000..444acb6b5ce
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/connector/SerialSettings.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.connector;
+
+import org.eclipse.cdt.serial.BaudRate;
+import org.eclipse.cdt.serial.ByteSize;
+import org.eclipse.cdt.serial.Parity;
+import org.eclipse.cdt.serial.StopBits;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+
+public class SerialSettings {
+
+ public static final String PORT_NAME_ATTR = "cdtserial.portName"; //$NON-NLS-1$
+ public static final String BAUD_RATE_ATTR = "cdtserial.baudRate"; //$NON-NLS-1$
+ public static final String BYTE_SIZE_ATTR = "cdtserial.byteSize"; //$NON-NLS-1$
+ public static final String PARITY_ATTR = "cdtserial.parity"; //$NON-NLS-1$
+ public static final String STOP_BITS_ATTR = "cdtserial.stopBits"; //$NON-NLS-1$
+
+ private String portName;
+ private BaudRate baudRate;
+ private ByteSize byteSize;
+ private Parity parity;
+ private StopBits stopBits;
+
+ /**
+ * Load information into the RemoteSettings object.
+ */
+ public void load(ISettingsStore store) {
+ portName = store.get(PORT_NAME_ATTR, ""); //$NON-NLS-1$
+
+ String baudRateStr = store.get(BAUD_RATE_ATTR, ""); //$NON-NLS-1$
+ if (baudRateStr.isEmpty()) {
+ baudRate = BaudRate.getDefault();
+ } else {
+ String[] rates = BaudRate.getStrings();
+ for (int i = 0; i < rates.length; ++i) {
+ if (baudRateStr.equals(rates[i])) {
+ baudRate = BaudRate.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String byteSizeStr = store.get(BYTE_SIZE_ATTR, ""); //$NON-NLS-1$
+ if (byteSizeStr.isEmpty()) {
+ byteSize = ByteSize.getDefault();
+ } else {
+ String[] sizes = ByteSize.getStrings();
+ for (int i = 0; i < sizes.length; ++i) {
+ if (byteSizeStr.equals(sizes[i])) {
+ byteSize = ByteSize.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String parityStr = store.get(PARITY_ATTR, ""); //$NON-NLS-1$
+ if (parityStr.isEmpty()) {
+ parity = Parity.getDefault();
+ } else {
+ String[] parities = Parity.getStrings();
+ for (int i = 0; i < parities.length; ++i) {
+ if (parityStr.equals(parities[i])) {
+ parity = Parity.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String stopBitsStr = store.get(STOP_BITS_ATTR, ""); //$NON-NLS-1$
+ if (stopBitsStr.isEmpty()) {
+ stopBits = StopBits.getDefault();
+ } else {
+ String[] bits = StopBits.getStrings();
+ for (int i = 0; i < bits.length; ++i) {
+ if (stopBitsStr.equals(bits[i])) {
+ stopBits = StopBits.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Extract information from the RemoteSettings object.
+ */
+ public void save(ISettingsStore store) {
+ store.put(PORT_NAME_ATTR, portName);
+ store.put(BAUD_RATE_ATTR, BaudRate.getStrings()[BaudRate.getStringIndex(baudRate)]);
+ store.put(BYTE_SIZE_ATTR, ByteSize.getStrings()[ByteSize.getStringIndex(byteSize)]);
+ store.put(PARITY_ATTR, Parity.getStrings()[Parity.getStringIndex(parity)]);
+ store.put(STOP_BITS_ATTR, StopBits.getStrings()[StopBits.getStringIndex(stopBits)]);
+ }
+
+ public String getPortName() {
+ return portName;
+ }
+
+ public void setPortName(String portName) {
+ this.portName = portName;
+ }
+
+ public BaudRate getBaudRate() {
+ return baudRate;
+ }
+
+ public void setBaudRate(BaudRate baudRate) {
+ this.baudRate = baudRate;
+ }
+
+ public ByteSize getByteSize() {
+ return byteSize;
+ }
+
+ public void setByteSize(ByteSize byteSize) {
+ this.byteSize = byteSize;
+ }
+
+ public Parity getParity() {
+ return parity;
+ }
+
+ public void setParity(Parity parity) {
+ this.parity = parity;
+ }
+
+ public StopBits getStopBits() {
+ return stopBits;
+ }
+
+ public void setStopBits(StopBits stopBits) {
+ this.stopBits = stopBits;
+ }
+
+ public String getSummary() {
+ return portName;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialConfigPanel.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialConfigPanel.java
new file mode 100644
index 00000000000..fe42b841b52
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialConfigPanel.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.controls;
+
+import java.util.Map;
+
+import org.eclipse.cdt.serial.BaudRate;
+import org.eclipse.cdt.serial.ByteSize;
+import org.eclipse.cdt.serial.Parity;
+import org.eclipse.cdt.serial.StopBits;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tm.terminal.connector.cdtserial.connector.SerialConnector;
+import org.eclipse.tm.terminal.connector.cdtserial.connector.SerialSettings;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel;
+
+public class SerialConfigPanel extends AbstractExtendedConfigurationPanel {
+
+ private SerialSettings settings;
+ private SerialSettingsPage page;
+
+ public SerialConfigPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ @Override
+ public void setupPanel(Composite parent) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ panel.setLayoutData(data);
+
+ SerialConnector connector = new SerialConnector();
+ settings = connector.getSettings();
+ page = new SerialSettingsPage(settings, this);
+ page.createControl(panel);
+
+ createEncodingUI(panel, true);
+
+ setControl(panel);
+ }
+
+ @Override
+ public void extractData(Map data) {
+ if (data == null) {
+ return;
+ }
+
+ page.saveSettings();
+ data.put(SerialSettings.PORT_NAME_ATTR, settings.getPortName());
+ data.put(SerialSettings.BAUD_RATE_ATTR, settings.getBaudRate());
+ data.put(SerialSettings.BYTE_SIZE_ATTR, settings.getByteSize());
+ data.put(SerialSettings.PARITY_ATTR, settings.getParity());
+ data.put(SerialSettings.STOP_BITS_ATTR, settings.getStopBits());
+
+ if (getEncoding() != null) {
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ }
+ }
+
+ @Override
+ public void setupData(Map data) {
+ if (data == null) {
+ return;
+ }
+
+ settings.setPortName((String) data.get(SerialSettings.PORT_NAME_ATTR));
+ settings.setBaudRate((BaudRate) data.get(SerialSettings.BAUD_RATE_ATTR));
+ settings.setByteSize((ByteSize) data.get(SerialSettings.BYTE_SIZE_ATTR));
+ settings.setParity((Parity) data.get(SerialSettings.PARITY_ATTR));
+ settings.setStopBits((StopBits) data.get(SerialSettings.STOP_BITS_ATTR));
+
+ String encoding = (String) data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (encoding != null) {
+ setEncoding(encoding);
+ }
+ }
+
+ @Override
+ protected void saveSettingsForHost(boolean add) {
+ }
+
+ @Override
+ protected void fillSettingsForHost(String host) {
+ }
+
+ @Override
+ protected String getHostFromSettings() {
+ if (page != null) {
+ page.saveSettings();
+ return settings.getPortName();
+ }
+ return null;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialSettingsPage.java
new file mode 100644
index 00000000000..1f9f4f2e151
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialSettingsPage.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.controls;
+
+import java.io.IOException;
+
+import org.eclipse.cdt.serial.BaudRate;
+import org.eclipse.cdt.serial.ByteSize;
+import org.eclipse.cdt.serial.Parity;
+import org.eclipse.cdt.serial.SerialPort;
+import org.eclipse.cdt.serial.StopBits;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.eclipse.tm.terminal.connector.cdtserial.activator.Activator;
+import org.eclipse.tm.terminal.connector.cdtserial.connector.SerialConnector;
+import org.eclipse.tm.terminal.connector.cdtserial.connector.SerialSettings;
+import org.eclipse.tm.terminal.connector.cdtserial.nls.Messages;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+
+public class SerialSettingsPage extends AbstractSettingsPage {
+
+ private final SerialSettings settings;
+ private final IConfigurationPanel panel;
+ private final IDialogSettings dialogSettings;
+
+ private Combo portCombo;
+ private Combo baudRateCombo;
+ private Combo byteSizeCombo;
+ private Combo parityCombo;
+ private Combo stopBitsCombo;
+
+ private String portName;
+ private BaudRate baudRate;
+ private ByteSize byteSize;
+ private Parity parity;
+ private StopBits stopBits;
+
+ public SerialSettingsPage(SerialSettings settings, IConfigurationPanel panel) {
+ this.settings = settings;
+ this.panel = panel;
+ setHasControlDecoration(true);
+
+ dialogSettings = DialogSettings.getOrCreateSection(Activator.getDefault().getDialogSettings(),
+ this.getClass().getSimpleName());
+ portName = dialogSettings.get(SerialSettings.PORT_NAME_ATTR);
+
+ String baudRateStr = dialogSettings.get(SerialSettings.BAUD_RATE_ATTR);
+ if (baudRateStr == null || baudRateStr.isEmpty()) {
+ baudRate = BaudRate.getDefault();
+ } else {
+ String[] rates = BaudRate.getStrings();
+ for (int i = 0; i < rates.length; ++i) {
+ if (baudRateStr.equals(rates[i])) {
+ baudRate = BaudRate.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String byteSizeStr = dialogSettings.get(SerialSettings.BYTE_SIZE_ATTR);
+ if (byteSizeStr == null || byteSizeStr.isEmpty()) {
+ byteSize = ByteSize.getDefault();
+ } else {
+ String[] sizes = ByteSize.getStrings();
+ for (int i = 0; i < sizes.length; ++i) {
+ if (byteSizeStr.equals(sizes[i])) {
+ byteSize = ByteSize.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String parityStr = dialogSettings.get(SerialSettings.PARITY_ATTR);
+ if (parityStr == null || parityStr.isEmpty()) {
+ parity = Parity.getDefault();
+ } else {
+ String[] parities = Parity.getStrings();
+ for (int i = 0; i < parities.length; ++i) {
+ if (parityStr.equals(parities[i])) {
+ parity = Parity.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+
+ String stopBitsStr = dialogSettings.get(SerialSettings.STOP_BITS_ATTR);
+ if (stopBitsStr == null || stopBitsStr.isEmpty()) {
+ stopBits = StopBits.getDefault();
+ } else {
+ String[] bits = StopBits.getStrings();
+ for (int i = 0; i < bits.length; ++i) {
+ if (stopBitsStr.equals(bits[i])) {
+ stopBits = StopBits.fromStringIndex(i);
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = gridLayout.marginHeight = 0;
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ comp.setLayout(gridLayout);
+ comp.setLayoutData(gridData);
+
+ Label portLabel = new Label(comp, SWT.NONE);
+ portLabel.setText(Messages.SerialTerminalSettingsPage_SerialPort);
+
+ portCombo = new Combo(comp, SWT.NONE);
+ portCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ String[] portNames = new String[0];
+ try {
+ portNames = SerialPort.list();
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+ for (String portName : portNames) {
+ if (!SerialConnector.isOpen(portName)) {
+ portCombo.add(portName);
+ }
+ }
+ portCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ Label baudRateLabel = new Label(comp, SWT.NONE);
+ baudRateLabel.setText(Messages.SerialTerminalSettingsPage_BaudRate);
+
+ baudRateCombo = new Combo(comp, SWT.READ_ONLY);
+ baudRateCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ for (String baudRateStr : BaudRate.getStrings()) {
+ baudRateCombo.add(baudRateStr);
+ }
+
+ Label byteSizeLabel = new Label(comp, SWT.NONE);
+ byteSizeLabel.setText(Messages.SerialTerminalSettingsPage_DataSize);
+
+ byteSizeCombo = new Combo(comp, SWT.READ_ONLY);
+ byteSizeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ for (String byteSizeStr : ByteSize.getStrings()) {
+ byteSizeCombo.add(byteSizeStr);
+ }
+
+ Label parityLabel = new Label(comp, SWT.NONE);
+ parityLabel.setText(Messages.SerialTerminalSettingsPage_Parity);
+
+ parityCombo = new Combo(comp, SWT.READ_ONLY);
+ parityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ for (String parityStr : Parity.getStrings()) {
+ parityCombo.add(parityStr);
+ }
+
+ Label stopBitsLabel = new Label(comp, SWT.NONE);
+ stopBitsLabel.setText(Messages.SerialTerminalSettingsPage_StopBits);
+
+ stopBitsCombo = new Combo(comp, SWT.READ_ONLY);
+ stopBitsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ for (String stopBitsStr : StopBits.getStrings()) {
+ stopBitsCombo.add(stopBitsStr);
+ }
+
+ loadSettings();
+ }
+
+ void validate() {
+ IConfigurationPanelContainer container = panel.getContainer();
+ container.validate();
+ }
+
+ @Override
+ public void loadSettings() {
+ String portName = settings.getPortName();
+ if (portName == null || portName.isEmpty()) {
+ portName = this.portName;
+ }
+ if (portName != null && !portName.isEmpty() && !SerialConnector.isOpen(portName)) {
+ int i = 0;
+ for (String name : portCombo.getItems()) {
+ if (portName.equals(name)) {
+ portCombo.select(i);
+ break;
+ }
+ i++;
+ }
+ } else if (portCombo.getItemCount() > 0) {
+ portCombo.select(0);
+ }
+
+ BaudRate baudRate = settings.getBaudRate();
+ if (baudRate == null) {
+ baudRate = this.baudRate;
+ }
+ baudRateCombo.select(BaudRate.getStringIndex(baudRate));
+
+ ByteSize byteSize = settings.getByteSize();
+ if (byteSize == null) {
+ byteSize = this.byteSize;
+ }
+ byteSizeCombo.select(ByteSize.getStringIndex(byteSize));
+
+ Parity parity = settings.getParity();
+ if (parity == null) {
+ parity = this.parity;
+ }
+ parityCombo.select(Parity.getStringIndex(parity));
+
+ StopBits stopBits = settings.getStopBits();
+ if (stopBits == null) {
+ stopBits = this.stopBits;
+ }
+ stopBitsCombo.select(StopBits.getStringIndex(stopBits));
+ }
+
+ @Override
+ public void saveSettings() {
+ settings.setPortName(portCombo.getText());
+ settings.setBaudRate(BaudRate.fromStringIndex(baudRateCombo.getSelectionIndex()));
+ settings.setByteSize(ByteSize.fromStringIndex(byteSizeCombo.getSelectionIndex()));
+ settings.setParity(Parity.fromStringIndex(parityCombo.getSelectionIndex()));
+ settings.setStopBits(StopBits.fromStringIndex(stopBitsCombo.getSelectionIndex()));
+
+ dialogSettings.put(SerialSettings.PORT_NAME_ATTR, portCombo.getText());
+ dialogSettings.put(SerialSettings.BAUD_RATE_ATTR,
+ BaudRate.getStrings()[baudRateCombo.getSelectionIndex()]);
+ dialogSettings.put(SerialSettings.BYTE_SIZE_ATTR,
+ ByteSize.getStrings()[byteSizeCombo.getSelectionIndex()]);
+ dialogSettings.put(SerialSettings.PARITY_ATTR, Parity.getStrings()[parityCombo.getSelectionIndex()]);
+ dialogSettings.put(SerialSettings.STOP_BITS_ATTR,
+ StopBits.getStrings()[stopBitsCombo.getSelectionIndex()]);
+ }
+
+ @Override
+ public boolean validateSettings() {
+ if (portCombo.getSelectionIndex() < 0 && portCombo.getText().isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/launcher/SerialLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/launcher/SerialLauncherDelegate.java
new file mode 100644
index 00000000000..05b49a0aa27
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/launcher/SerialLauncherDelegate.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.launcher;
+
+import java.util.Map;
+
+import org.eclipse.cdt.serial.BaudRate;
+import org.eclipse.cdt.serial.ByteSize;
+import org.eclipse.cdt.serial.Parity;
+import org.eclipse.cdt.serial.StopBits;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.connector.cdtserial.connector.SerialSettings;
+import org.eclipse.tm.terminal.connector.cdtserial.controls.SerialConfigPanel;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+
+public class SerialLauncherDelegate extends AbstractLauncherDelegate {
+
+ @Override
+ public boolean needsUserConfiguration() {
+ return true;
+ }
+
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new SerialConfigPanel(container);
+ }
+
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String) properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) {
+ connectorId = "org.eclipse.tm.terminal.connector.cdtserial.SerialConnector"; //$NON-NLS-1$
+ }
+
+ // Extract the properties
+ SerialSettings settings = new SerialSettings();
+ settings.setPortName((String) properties.get(SerialSettings.PORT_NAME_ATTR));
+ settings.setBaudRate((BaudRate) properties.get(SerialSettings.BAUD_RATE_ATTR));
+ settings.setByteSize((ByteSize) properties.get(SerialSettings.BYTE_SIZE_ATTR));
+ settings.setParity((Parity) properties.get(SerialSettings.PARITY_ATTR));
+ settings.setStopBits((StopBits) properties.get(SerialSettings.STOP_BITS_ATTR));
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+ settings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+
+ @Override
+ public void execute(Map properties, Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String name = (String) properties.get(SerialSettings.PORT_NAME_ATTR);
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, name);
+
+ // Force a new terminal tab each time it is launched, if not set otherwise from outside
+ // TODO need a command shell service routing to get this
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.java
new file mode 100644
index 00000000000..a43aaaafc0e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2017, 2018 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.cdtserial.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tm.terminal.connector.cdtserial.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String SerialTerminalSettingsPage_BaudRate;
+ public static String SerialTerminalSettingsPage_DataSize;
+ public static String SerialTerminalSettingsPage_Parity;
+ public static String SerialTerminalSettingsPage_SerialPort;
+ public static String SerialTerminalSettingsPage_StopBits;
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.properties
new file mode 100644
index 00000000000..9052b4e2c66
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/nls/Messages.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2017, 2018 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+###############################################################################
+
+SerialTerminalSettingsPage_BaudRate=Baud rate:
+SerialTerminalSettingsPage_DataSize=Data size:
+SerialTerminalSettingsPage_Parity=Parity:
+SerialTerminalSettingsPage_SerialPort=Serial port:
+SerialTerminalSettingsPage_StopBits=Stop bits:
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.options b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.options
new file mode 100644
index 00000000000..5cbcb6722b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.options
@@ -0,0 +1 @@
+org.eclipse.tm.terminal.connector.local/debugmode = 0
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.project
new file mode 100644
index 00000000000..696a343153f
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.project
@@ -0,0 +1,45 @@
+
+
+ org.eclipse.tm.terminal.connector.local
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
+
+ 0
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..24dad4464e4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Tue Oct 11 11:53:38 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0d732269684
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.pde.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000000..cf80c8bc5b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..4bc3ca52378
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.local;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Activator: org.eclipse.tm.terminal.connector.local.activator.UIPlugin
+Bundle-Vendor: %providerName
+Import-Package: org.eclipse.cdt.utils.pty;mandatory:=native
+Require-Bundle: org.eclipse.cdt.core;bundle-version="5.6.0";resolution:=optional,
+ org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.resources;bundle-version="3.8.1";resolution:=optional,
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.core.variables;bundle-version="3.2.600",
+ org.eclipse.debug.ui;bundle-version="3.8.1";resolution:=optional,
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.connector.process;bundle-version="4.5.0",
+ org.eclipse.tm.terminal.control;bundle-version="4.5.0",
+ org.eclipse.ui;bundle-version="3.8.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tm.terminal.connector.local.activator;x-internal:=true,
+ org.eclipse.tm.terminal.connector.local.controls,
+ org.eclipse.tm.terminal.connector.local.launcher
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/p2.inf b/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/p2.inf
new file mode 100644
index 00000000000..3aec0927ef9
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/META-INF/p2.inf
@@ -0,0 +1,82 @@
+###############################################################################
+# Copyright (c) 2014 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+# Most of the dependencies exposed here are actually covered in the feature.xml
+# This file ensures that the current bundle has all it needs, even if installed
+# without the enclosing org.eclipse.tcf.te.terminals.feature .
+# See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=435150 .
+
+# 1. Make the optional cdt.core dependency non-greedy: Use (or update to proper
+# version!) when installed, but do not install automatically since the newer
+# org.eclipse.cdt.core.native can satisfy the dependency better. We use this
+# trick since CDT 8.3 had no version on export-package yet but we do want
+# a version constraint.
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = org.eclipse.cdt.core
+#requires.0.range = [5.6, 6.0)
+requires.0.greedy = false
+requires.0.optional = true
+
+#requires.1.namespace = org.eclipse.equinox.p2.iu
+#requires.1.name = org.eclipse.cdt.core.native
+#requires.1.range = [5.6, 6.0)
+#requires.1.greedy = true
+#requires.1.optional = true
+
+# 2. Add the required fragments for local terminal support with proper version.
+requires.2.namespace = org.eclipse.equinox.p2.iu
+requires.2.name = org.eclipse.cdt.core.aix
+#requires.2.range = [5.3, 6.0)
+requires.2.filter = (osgi.os=aix)
+
+requires.3.namespace = org.eclipse.equinox.p2.iu
+requires.3.name = org.eclipse.cdt.core.linux
+#requires.3.range = [5.2, 6.0)
+requires.3.filter = (osgi.os=linux)
+
+requires.4.namespace = org.eclipse.equinox.p2.iu
+requires.4.name = org.eclipse.cdt.core.linux.ppc64
+#requires.4.range = [5.1, 6.0)
+requires.4.filter = (&(osgi.os=linux)(osgi.arch=ppc64))
+
+#requires.5.namespace = org.eclipse.equinox.p2.iu
+#requires.5.name = org.eclipse.cdt.core.linux.x86
+#requires.5.range = [5.2, 6.0)
+#requires.5.filter = (&(osgi.os=linux)(osgi.arch=x86))
+
+requires.6.namespace = org.eclipse.equinox.p2.iu
+requires.6.name = org.eclipse.cdt.core.linux.x86_64
+#requires.6.range = [5.2, 6.0)
+requires.6.filter = (&(osgi.os=linux)(osgi.arch=x86_64))
+
+requires.7.namespace = org.eclipse.equinox.p2.iu
+requires.7.name = org.eclipse.cdt.core.macosx
+#requires.7.range = [5.2, 6.0)
+requires.7.filter = (osgi.os=macosx)
+
+requires.8.namespace = org.eclipse.equinox.p2.iu
+requires.8.name = org.eclipse.cdt.core.solaris
+#requires.8.range = [5.2, 6.0)
+requires.8.filter = (&(osgi.os=solaris)(osgi.arch=sparc))
+
+requires.9.namespace = org.eclipse.equinox.p2.iu
+requires.9.name = org.eclipse.cdt.core.win32
+#requires.9.range = [5.3, 6.0)
+requires.9.filter = (osgi.os=win32)
+
+#requires.10.namespace = org.eclipse.equinox.p2.iu
+#requires.10.name = org.eclipse.cdt.core.win32.x86
+#requires.10.range = [5.2, 6.0)
+#requires.10.filter = (&(osgi.os=win32)(osgi.arch=x86))
+
+requires.11.namespace = org.eclipse.equinox.p2.iu
+requires.11.name = org.eclipse.cdt.core.win32.x86_64
+#requires.11.range = [5.2, 6.0)
+requires.11.filter = (&(osgi.os=win32)(osgi.arch=x86_64))
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.local/about.html
new file mode 100644
index 00000000000..fe4ae3f5b94
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
May 24, 2012
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.local/build.properties
new file mode 100644
index 00000000000..c4d9151b7b7
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ icons/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/icons/eview16/terminal_view.gif b/terminal/plugins/org.eclipse.tm.terminal.connector.local/icons/eview16/terminal_view.gif
new file mode 100644
index 00000000000..bbb6a9e153e
Binary files /dev/null and b/terminal/plugins/org.eclipse.tm.terminal.connector.local/icons/eview16/terminal_view.gif differ
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.properties
new file mode 100644
index 00000000000..6ce98f79939
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.properties
@@ -0,0 +1,27 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Terminal Local Connector
+providerName = Eclipse.org - Target Management
+
+# ----- Commands and Menu contributions -----
+LocalLauncherDelegate.label=Local Terminal
+
+command.launch.name=Open Local Terminal on Selection
+
+menu.showIn.localterminal.label = Terminal
+
+TerminalConnector.local=Local
+
+# ----- Preference Pages -----
+
+preference.page.name=Local Terminal
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.xml
new file mode 100644
index 00000000000..b394dd40b44
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/plugin.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.local/pom.xml
new file mode 100644
index 00000000000..88f03dacc85
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.local
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/activator/UIPlugin.java b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/activator/UIPlugin.java
new file mode 100644
index 00000000000..c725a5cdbcc
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/activator/UIPlugin.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2012 - 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.local.activator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tm.terminal.view.core.preferences.ScopedEclipsePreferences;
+import org.eclipse.tm.terminal.view.core.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The scoped preferences instance
+ private static volatile ScopedEclipsePreferences scopedPreferences;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plug-in.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tm.terminal.connector.local"; //$NON-NLS-1$
+ }
+
+ /**
+ * Return the scoped preferences for this plug-in.
+ */
+ public static ScopedEclipsePreferences getScopedPreferences() {
+ if (scopedPreferences == null) {
+ scopedPreferences = new ScopedEclipsePreferences(getUniqueIdentifier());
+ }
+ return scopedPreferences;
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ scopedPreferences = null;
+ traceHandler = null;
+ super.stop(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ super.initializeImageRegistry(registry);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the Image object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The Image object instance or null.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the ImageDescriptor object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The ImageDescriptor object instance or null.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/controls/LocalWizardConfigurationPanel.java b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/controls/LocalWizardConfigurationPanel.java
new file mode 100644
index 00000000000..28f0bcab2cb
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/controls/LocalWizardConfigurationPanel.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.local.controls;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchEncoding;
+import org.osgi.framework.Bundle;
+
+/**
+ * Serial wizard configuration panel implementation.
+ */
+public class LocalWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
+
+ private Object resource;
+
+ /**
+ * Constructor.
+ *
+ * @param container The configuration panel container or null.
+ */
+ public LocalWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // Create the encoding selection combo
+ createEncodingUI(panel, false);
+
+ // Set the default encoding:
+ // Default UTF-8 on Mac or Windows for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS()) || Platform.OS_WIN32.equals(Platform.getOS())) {
+ setEncoding("UTF-8"); //$NON-NLS-1$
+ } else {
+ String encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ if (encoding != null && !"".equals(encoding)) setEncoding(encoding); //$NON-NLS-1$
+ }
+
+ // Fill the rest of the panel with a label to be able to
+ // set a height and width hint for the dialog
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ layoutData.widthHint = 300;
+ layoutData.heightHint = 80;
+ label.setLayoutData(layoutData);
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ resource = getSelectionResource();
+ }
+
+ setControl(panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#setupData(java.util.Map)
+ */
+ @Override
+ public void setupData(Map data) {
+ if (data == null) return;
+
+ String value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) setEncoding(value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#extractData(java.util.Map)
+ */
+ @Override
+ public void extractData(Map data) {
+ // set the terminal connector id for local terminal
+ data.put(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID, "org.eclipse.tm.terminal.connector.local.LocalConnector"); //$NON-NLS-1$
+
+ // Store the encoding
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ // if we have a IResource selection use the location for working directory
+ if (resource instanceof org.eclipse.core.resources.IResource){
+ String dir = ((org.eclipse.core.resources.IResource)resource).getProject().getLocation().toString();
+ data.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, dir);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
+ */
+ @Override
+ protected void fillSettingsForHost(String host){
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
+ @Override
+ protected void saveSettingsForHost(boolean add){
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid(){
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ // Save the encodings widget values
+ doSaveEncodingsWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ // Restore the encodings widget values
+ doRestoreEncodingsWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
+ */
+ @Override
+ protected String getHostFromSettings() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isWithHostList()
+ */
+ @Override
+ public boolean isWithHostList() {
+ return false;
+ }
+
+ /**
+ * Returns the IResource from the current selection
+ *
+ * @return the IResource, or null.
+ */
+ private org.eclipse.core.resources.IResource getSelectionResource() {
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService != null ? selectionService.getSelection() : StructuredSelection.EMPTY;
+
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if (element instanceof org.eclipse.core.resources.IResource){
+ return ((org.eclipse.core.resources.IResource)element);
+ }
+ if (element instanceof IAdaptable) {
+ return (org.eclipse.core.resources.IResource) ((IAdaptable) element).getAdapter(org.eclipse.core.resources.IResource.class);
+ }
+ }
+ return null;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherDelegate.java
new file mode 100644
index 00000000000..a7277d69dbf
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherDelegate.java
@@ -0,0 +1,409 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Dirk Fauth - Bug 460496
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.local.launcher;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.connector.local.activator.UIPlugin;
+import org.eclipse.tm.terminal.connector.local.controls.LocalWizardConfigurationPanel;
+import org.eclipse.tm.terminal.connector.process.ProcessSettings;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalServiceOutputStreamMonitorListener;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ILineSeparatorConstants;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.tm.terminal.view.ui.interfaces.IPreferenceKeys;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchEncoding;
+import org.osgi.framework.Bundle;
+
+/**
+ * Serial launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class LocalLauncherDelegate extends AbstractLauncherDelegate {
+
+ private final IMementoHandler mementoHandler = new LocalMementoHandler();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#getPanel(org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new LocalWizardConfigurationPanel(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map properties, ITerminalService.Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String terminalTitle = getTerminalTitle(properties);
+ if (terminalTitle != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
+ }
+
+ // If not configured, set the default encodings for the local terminal
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_ENCODING)) {
+ String encoding = null;
+ // Set the default encoding:
+ // Default UTF-8 on Mac or Windows for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS()) || Platform.OS_WIN32.equals(Platform.getOS())) {
+ encoding = "UTF-8"; //$NON-NLS-1$
+ } else {
+ encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ }
+ if (encoding != null && !"".equals(encoding)) properties.put(ITerminalsConnectorConstants.PROP_ENCODING, encoding); //$NON-NLS-1$
+ }
+
+ // For local terminals, force a new terminal tab each time it is launched,
+ // if not set otherwise from outside
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Initialize the local terminal working directory.
+ // By default, start the local terminal in the users home directory
+ String initialCwd = org.eclipse.tm.terminal.view.ui.activator.UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD);
+ String cwd = null;
+ if (initialCwd == null || IPreferenceKeys.PREF_INITIAL_CWD_USER_HOME.equals(initialCwd) || "".equals(initialCwd.trim())) { //$NON-NLS-1$
+ cwd = System.getProperty("user.home"); //$NON-NLS-1$
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_HOME.equals(initialCwd)) {
+ String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
+ if (eclipseHomeLocation != null) {
+ try {
+ URI uri = URIUtil.fromString(eclipseHomeLocation);
+ File f = URIUtil.toFile(uri);
+ cwd = f.getAbsolutePath();
+ } catch (URISyntaxException ex) { /* ignored on purpose */ }
+ }
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_WS.equals(initialCwd)) {
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ if (org.eclipse.core.resources.ResourcesPlugin.getWorkspace() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation() != null) {
+ cwd = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ }
+ }
+ } else {
+ try {
+ // Resolve possible dynamic variables
+ IStringVariableManager vm = VariablesPlugin.getDefault().getStringVariableManager();
+ String resolved = vm.performStringSubstitution(initialCwd);
+
+ IPath p = new Path(resolved);
+ if (p.toFile().canRead() && p.toFile().isDirectory()) {
+ cwd = p.toOSString();
+ }
+ } catch (CoreException ex) {
+ if (Platform.inDebugMode()) {
+ UIPlugin.getDefault().getLog().log(ex.getStatus());
+ }
+ }
+ }
+
+ if (cwd != null && !"".equals(cwd)) { //$NON-NLS-1$
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, cwd);
+ }
+
+ // If the current selection resolved to an folder, default the working directory
+ // to that folder and update the terminal title
+ ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ if ((service != null && service.getSelection() != null) || properties.containsKey(ITerminalsConnectorConstants.PROP_SELECTION)) {
+ ISelection selection = (ISelection)properties.get(ITerminalsConnectorConstants.PROP_SELECTION);
+ if (selection == null) selection = service.getSelection();
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ String dir = null;
+ Iterator> iter = ((IStructuredSelection)selection).iterator();
+ while (iter.hasNext()) {
+ Object element = iter.next();
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ // If the element is not an IResource, try to adapt to IResource
+ if (!(element instanceof org.eclipse.core.resources.IResource)) {
+ Object adapted = element instanceof IAdaptable ? ((IAdaptable)element).getAdapter(org.eclipse.core.resources.IResource.class) : null;
+ if (adapted == null) adapted = Platform.getAdapterManager().getAdapter(element, org.eclipse.core.resources.IResource.class);
+ if (adapted != null) element = adapted;
+ }
+
+ if (element instanceof org.eclipse.core.resources.IResource && ((org.eclipse.core.resources.IResource)element).exists()) {
+ IPath location = ((org.eclipse.core.resources.IResource)element).getLocation();
+ if (location == null) continue;
+ if (location.toFile().isFile()) location = location.removeLastSegments(1);
+ if (location.toFile().isDirectory() && location.toFile().canRead()) {
+ dir = location.toFile().getAbsolutePath();
+ break;
+ }
+ }
+
+ if (element instanceof IPath || element instanceof File) {
+ File f = element instanceof IPath ? ((IPath)element).toFile() : (File)element;
+ if (f.isDirectory() && f.canRead()) {
+ dir = f.getAbsolutePath();
+ break;
+ }
+ }
+ }
+ }
+ if (dir != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, dir);
+
+ String basename = new Path(dir).lastSegment();
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, basename + " (" + terminalTitle + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /**
+ * Returns the terminal title string.
+ *
+ * The default implementation constructs a title like "Serial <port> (Start time) ".
+ *
+ * @return The terminal title string or null.
+ */
+ private String getTerminalTitle(Map properties) {
+ // Try to see if the user set a title explicitly via the properties map.
+ String title = getDefaultTerminalTitle(properties);
+ if (title != null) return title;
+
+ try {
+ String hostname = InetAddress.getLocalHost().getHostName();
+ if (hostname != null && !"".equals(hostname.trim())) { //$NON-NLS-1$
+ return hostname;
+ }
+ } catch (UnknownHostException e) { /* ignored on purpose */ }
+
+ return "Local"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IMementoHandler.class.equals(adapter)) {
+ return mementoHandler;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * Returns the default shell to launch. Looks at the environment
+ * variable "SHELL" first before assuming some default default values.
+ *
+ * @return The default shell to launch.
+ */
+ private final File defaultShell() {
+ String shell = null;
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ if (System.getenv("ComSpec") != null && !"".equals(System.getenv("ComSpec").trim())) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ shell = System.getenv("ComSpec").trim(); //$NON-NLS-1$
+ } else {
+ shell = "cmd.exe"; //$NON-NLS-1$
+ }
+ }
+ if (shell == null) {
+ shell = org.eclipse.tm.terminal.view.ui.activator.UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_DEFAULT_SHELL_UNIX);
+ if (shell == null || "".equals(shell)) { //$NON-NLS-1$
+ if (System.getenv("SHELL") != null && !"".equals(System.getenv("SHELL").trim())) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ shell = System.getenv("SHELL").trim(); //$NON-NLS-1$
+ } else {
+ shell = "/bin/sh"; //$NON-NLS-1$
+ }
+ }
+ }
+
+ return new File(shell);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String)properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) connectorId = "org.eclipse.tm.terminal.connector.local.LocalConnector"; //$NON-NLS-1$
+
+ // Extract the process properties using defaults
+ String image;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_PATH)
+ || properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH) == null) {
+ File defaultShell = defaultShell();
+ image = defaultShell.isAbsolute() ? defaultShell.getAbsolutePath() : defaultShell.getPath();
+ } else {
+ image = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH);
+ }
+
+ String arguments = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ARGS);
+ if (arguments == null && !Platform.OS_WIN32.equals(Platform.getOS())) {
+ arguments = org.eclipse.tm.terminal.view.ui.activator.UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_DEFAULT_SHELL_UNIX_ARGS);
+ }
+
+ // Determine if a PTY will be used
+ boolean isUsingPTY = (properties.get(ITerminalsConnectorConstants.PROP_PROCESS_OBJ) == null && PTY.isSupported(PTY.Mode.TERMINAL))
+ || properties.get(ITerminalsConnectorConstants.PROP_PTY_OBJ) instanceof PTY;
+
+ boolean localEcho = false;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)
+ || !(properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO) instanceof Boolean)) {
+ // On Windows, turn on local echo by default if no PTY is used (bug 433645)
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ localEcho = !isUsingPTY;
+ }
+ } else {
+ localEcho = ((Boolean)properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)).booleanValue();
+ }
+
+ String lineSeparator = null;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR)
+ || !(properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR) instanceof String)) {
+ // No line separator will be set if a PTY is used
+ if (!isUsingPTY) {
+ lineSeparator = Platform.OS_WIN32.equals(Platform.getOS()) ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF;
+ }
+ } else {
+ lineSeparator = (String)properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR);
+ }
+
+ Process process = (Process)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_OBJ);
+ PTY pty = (PTY)properties.get(ITerminalsConnectorConstants.PROP_PTY_OBJ);
+ ITerminalServiceOutputStreamMonitorListener[] stdoutListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDOUT_LISTENERS);
+ ITerminalServiceOutputStreamMonitorListener[] stderrListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDERR_LISTENERS);
+ String workingDir = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR);
+
+ String[] envp = null;
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) != null &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) instanceof String[]){
+ envp = (String[])properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT);
+ }
+
+ // Set the ECLIPSE_HOME and ECLIPSE_WORKSPACE environment variables
+ List envpList = new ArrayList();
+ if (envp != null) envpList.addAll(Arrays.asList(envp));
+
+ // ECLIPSE_HOME
+ String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
+ if (eclipseHomeLocation != null) {
+ try {
+ URI uri = URIUtil.fromString(eclipseHomeLocation);
+ File f = URIUtil.toFile(uri);
+ envpList.add("ECLIPSE_HOME=" + f.getAbsolutePath()); //$NON-NLS-1$
+ } catch (URISyntaxException e) { /* ignored on purpose */ }
+ }
+
+ // ECLIPSE_WORKSPACE
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ if (org.eclipse.core.resources.ResourcesPlugin.getWorkspace() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation() != null) {
+ envpList.add("ECLIPSE_WORKSPACE=" + org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()); //$NON-NLS-1$
+ }
+ }
+
+ // Convert back into a string array
+ envp = envpList.toArray(new String[envpList.size()]);
+
+ Assert.isTrue(image != null || process != null);
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the process settings
+ ProcessSettings processSettings = new ProcessSettings();
+ processSettings.setImage(image);
+ processSettings.setArguments(arguments);
+ processSettings.setProcess(process);
+ processSettings.setPTY(pty);
+ processSettings.setLocalEcho(localEcho);
+ processSettings.setLineSeparator(lineSeparator);
+ processSettings.setStdOutListeners(stdoutListeners);
+ processSettings.setStdErrListeners(stderrListeners);
+ processSettings.setWorkingDir(workingDir);
+ processSettings.setEnvironment(envp);
+
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT)) {
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT);
+ processSettings.setMergeWithNativeEnvironment(value instanceof Boolean ? ((Boolean)value).booleanValue() : false);
+ }
+
+ // And save the settings to the store
+ processSettings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherHandler.java b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherHandler.java
new file mode 100644
index 00000000000..d8701cb49b1
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalLauncherHandler.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.local.launcher;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate;
+import org.eclipse.tm.terminal.view.ui.launcher.LauncherDelegateManager;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Local terminal launcher handler implementation.
+ */
+public class LocalLauncherHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // If the selection is not a structured selection, check if there is an active
+ // editor and get the path from the editor input
+ if (!(selection instanceof IStructuredSelection)) {
+ IEditorInput input = HandlerUtil.getActiveEditorInput(event);
+ if (input instanceof IPathEditorInput) {
+ IPath path = ((IPathEditorInput)input).getPath();
+ if (path != null) {
+ if (path.toFile().isFile()) path = path.removeLastSegments(1);
+ if (path.toFile().isDirectory() && path.toFile().canRead()) selection = new StructuredSelection(path);
+ }
+ }
+ }
+
+ // Get all applicable launcher delegates for the current selection
+ ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection);
+ // Find the local terminal launcher delegate
+ ILauncherDelegate delegate = null;
+ for (ILauncherDelegate candidate : delegates) {
+ if ("org.eclipse.tm.terminal.connector.local.launcher.local".equals(candidate.getId())) { //$NON-NLS-1$
+ delegate = candidate;
+ break;
+ }
+ }
+
+ // Launch the local terminal
+ if (delegate != null) {
+ Map properties = new HashMap();
+ properties.put(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegate.getId());
+ properties.put(ITerminalsConnectorConstants.PROP_SELECTION, selection);
+
+ delegate.execute(properties, null);
+ }
+
+ return null;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalMementoHandler.java b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalMementoHandler.java
new file mode 100644
index 00000000000..d334b946ae9
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.local/src/org/eclipse/tm/terminal/connector/local/launcher/LocalMementoHandler.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.local.launcher;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Local terminal connection memento handler implementation.
+ */
+public class LocalMementoHandler implements IMementoHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void saveState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#restoreState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void restoreState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.options b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.options
new file mode 100644
index 00000000000..7e3d5dfe7aa
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.options
@@ -0,0 +1 @@
+org.eclipse.tm.terminal.connector.process/debugmode = 0
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.project
new file mode 100644
index 00000000000..92d9bc9fd90
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.project
@@ -0,0 +1,45 @@
+
+
+ org.eclipse.tm.terminal.connector.process
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
+
+ 1329502082911
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..24dad4464e4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Tue Oct 11 11:53:38 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0d732269684
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.pde.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000000..cf80c8bc5b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..23d416a1ae2
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.process;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Activator: org.eclipse.tm.terminal.connector.process.activator.UIPlugin
+Bundle-Vendor: %providerName
+Import-Package: org.eclipse.cdt.utils.pty;mandatory:=native,
+ org.eclipse.cdt.utils.spawner;mandatory:=native
+Require-Bundle: org.eclipse.cdt.core;bundle-version="5.6.0";resolution:=optional,
+ org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.resources;bundle-version="3.8.1";resolution:=optional,
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.control;bundle-version="4.5.0",
+ org.eclipse.ui;bundle-version="3.8.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tm.terminal.connector.process,
+ org.eclipse.tm.terminal.connector.process.activator;x-internal:=true,
+ org.eclipse.tm.terminal.connector.process.help,
+ org.eclipse.tm.terminal.connector.process.nls;x-internal:=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/p2.inf b/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/p2.inf
new file mode 100644
index 00000000000..103dc2ce7d5
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/META-INF/p2.inf
@@ -0,0 +1,82 @@
+###############################################################################
+# Copyright (c) 2014, 2015 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+# Most of the dependencies exposed here are actually covered in the feature.xml
+# This file ensures that the current bundle has all it needs, even if installed
+# without the enclosing org.eclipse.tm.terminal.view.feature .
+# See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=435150 .
+
+# 1. Make the optional cdt.core dependency non-greedy: Use (or update to proper
+# version!) when installed, but do not install automatically since the newer
+# org.eclipse.cdt.core.native can satisfy the dependency better. We use this
+# trick since CDT 8.3 had no version on export-package yet but we do want
+# a version constraint.
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = org.eclipse.cdt.core
+#requires.0.range = [5.6, 6.0)
+requires.0.greedy = false
+requires.0.optional = true
+
+#requires.1.namespace = org.eclipse.equinox.p2.iu
+#requires.1.name = org.eclipse.cdt.core.native
+#requires.1.range = [5.6, 6.0)
+#requires.1.greedy = true
+#requires.1.optional = true
+
+# 2. Add the required fragments for local terminal support with proper version.
+requires.2.namespace = org.eclipse.equinox.p2.iu
+requires.2.name = org.eclipse.cdt.core.aix
+#requires.2.range = [5.3, 6.0)
+requires.2.filter = (osgi.os=aix)
+
+requires.3.namespace = org.eclipse.equinox.p2.iu
+requires.3.name = org.eclipse.cdt.core.linux
+#requires.3.range = [5.2, 6.0)
+requires.3.filter = (osgi.os=linux)
+
+requires.4.namespace = org.eclipse.equinox.p2.iu
+requires.4.name = org.eclipse.cdt.core.linux.ppc64
+#requires.4.range = [5.1, 6.0)
+requires.4.filter = (&(osgi.os=linux)(osgi.arch=ppc64))
+
+#requires.5.namespace = org.eclipse.equinox.p2.iu
+#requires.5.name = org.eclipse.cdt.core.linux.x86
+#requires.5.range = [5.2, 6.0)
+#requires.5.filter = (&(osgi.os=linux)(osgi.arch=x86))
+
+requires.6.namespace = org.eclipse.equinox.p2.iu
+requires.6.name = org.eclipse.cdt.core.linux.x86_64
+#requires.6.range = [5.2, 6.0)
+requires.6.filter = (&(osgi.os=linux)(osgi.arch=x86_64))
+
+requires.7.namespace = org.eclipse.equinox.p2.iu
+requires.7.name = org.eclipse.cdt.core.macosx
+#requires.7.range = [5.2, 6.0)
+requires.7.filter = (osgi.os=macosx)
+
+requires.8.namespace = org.eclipse.equinox.p2.iu
+requires.8.name = org.eclipse.cdt.core.solaris
+#requires.8.range = [5.2, 6.0)
+requires.8.filter = (&(osgi.os=solaris)(osgi.arch=sparc))
+
+requires.9.namespace = org.eclipse.equinox.p2.iu
+requires.9.name = org.eclipse.cdt.core.win32
+#requires.9.range = [5.3, 6.0)
+requires.9.filter = (osgi.os=win32)
+
+#requires.10.namespace = org.eclipse.equinox.p2.iu
+#requires.10.name = org.eclipse.cdt.core.win32.x86
+#requires.10.range = [5.2, 6.0)
+#requires.10.filter = (&(osgi.os=win32)(osgi.arch=x86))
+
+requires.11.namespace = org.eclipse.equinox.p2.iu
+requires.11.name = org.eclipse.cdt.core.win32.x86_64
+#requires.11.range = [5.2, 6.0)
+requires.11.filter = (&(osgi.os=win32)(osgi.arch=x86_64))
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.process/about.html
new file mode 100644
index 00000000000..fe4ae3f5b94
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
May 24, 2012
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.process/build.properties
new file mode 100644
index 00000000000..41ee77d01c1
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/build.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.properties
new file mode 100644
index 00000000000..4d5750b57e4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.properties
@@ -0,0 +1,24 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Terminal Process Connector
+providerName = Eclipse.org - Target Management
+
+# ----- Terminal Connectors -----
+
+TerminalConnector.process=Process Connector (hidden)
+
+# ----- Terminal Launcher Delegates -----
+
+ProcessLauncherDelegate.label=Streams Terminal
+
+# ----- Commands and Menu contributions -----
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.xml
new file mode 100644
index 00000000000..4b981ff8272
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/plugin.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.process/pom.xml
new file mode 100644
index 00000000000..e51c0e0e903
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.process
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessConnector.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessConnector.java
new file mode 100644
index 00000000000..a297da9cd9a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessConnector.java
@@ -0,0 +1,318 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Kaloyan Raev - Bug 485658 - NPE prevents displaying the actual error
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StreamTokenizer;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.tm.internal.terminal.emulator.VT100Emulator;
+import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.NullSettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.terminal.connector.process.nls.Messages;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ILineSeparatorConstants;
+import org.eclipse.tm.terminal.view.core.utils.Env;
+import org.eclipse.tm.terminal.view.ui.manager.ConsoleManager;
+import org.eclipse.tm.terminal.view.ui.streams.AbstractStreamsConnector;
+
+/**
+ * Process connector implementation.
+ */
+@SuppressWarnings("restriction")
+public class ProcessConnector extends AbstractStreamsConnector {
+ // Reference to the process settings
+ private final ProcessSettings settings;
+
+ // Reference to the PTY instance.
+ private PTY pty;
+ // Reference to the launched process instance.
+ private Process process;
+ // Reference to the process monitor
+ private ProcessMonitor monitor;
+
+ // The terminal width and height. Initially unknown.
+ private int width = -1;
+ private int height = -1;
+
+ /**
+ * Constructor.
+ */
+ public ProcessConnector() {
+ this(new ProcessSettings());
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param settings The process settings. Must not be null
+ */
+ public ProcessConnector(ProcessSettings settings) {
+ super();
+
+ Assert.isNotNull(settings);
+ this.settings = settings;
+ }
+
+ /**
+ * Returns the process object or null if the
+ * connector is connector.
+ *
+ * @return The process object or null.
+ */
+ public Process getProcess() {
+ return process;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#connect(org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl)
+ */
+ @Override
+ public void connect(ITerminalControl control) {
+ Assert.isNotNull(control);
+ super.connect(control);
+
+ pty = null;
+ width = -1;
+ height = -1;
+
+ try {
+ boolean isAnsiTerminal = false;
+
+ // Try to determine process and PTY instance from the process settings
+ process = settings.getProcess();
+ pty = settings.getPTY();
+
+ // No process -> create PTY on supported platforms and execute
+ // process image.
+ if (process == null) {
+ if (PTY.isSupported(PTY.Mode.TERMINAL)) {
+ try {
+ pty = new PTY(PTY.Mode.TERMINAL);
+
+ // Initialize the terminal size
+ VT100Emulator text = ((VT100TerminalControl)control).getTerminalText();
+ text.fontChanged();
+ } catch (IOException e) {
+ // PTY not supported
+ }
+ }
+
+ // Build up the command
+ StringBuilder command = new StringBuilder(settings.getImage());
+ String arguments = settings.getArguments();
+ if (arguments != null && !"".equals(arguments.trim())) { //$NON-NLS-1$
+ // Append to the command now
+ command.append(" "); //$NON-NLS-1$
+ command.append(arguments.trim());
+ }
+
+ File workingDir =null;
+ if (settings.getWorkingDir()!=null){
+ workingDir = new File(settings.getWorkingDir());
+ }
+
+ String[] envp = null;
+ if (settings.getEnvironment()!=null){
+ envp = settings.getEnvironment();
+ }
+
+ if (settings.isMergeWithNativeEnvironment()) {
+ envp = Env.getEnvironment(envp, true);
+ }
+
+ isAnsiTerminal = getTermVariable(envp).startsWith("ansi"); //$NON-NLS-1$
+
+ if (pty != null) {
+ // A PTY is available -> can use the ProcessFactory.
+
+ // Tokenize the command (ProcessFactory takes an array)
+ StreamTokenizer st = new StreamTokenizer(new StringReader(command.toString()));
+ st.resetSyntax();
+ st.whitespaceChars(0, 32);
+ st.whitespaceChars(0xa0, 0xa0);
+ st.wordChars(33, 255);
+ st.quoteChar('"');
+ st.quoteChar('\'');
+
+ List argv = new ArrayList();
+ int ttype = st.nextToken();
+ while (ttype != StreamTokenizer.TT_EOF) {
+ argv.add(st.sval);
+ ttype = st.nextToken();
+ }
+
+ // Execute the process
+ process = ProcessFactory.getFactory().exec(argv.toArray(new String[argv.size()]), envp, workingDir, pty);
+ } else {
+ // No PTY -> just execute via the standard Java Runtime implementation.
+ process = Runtime.getRuntime().exec(command.toString(), envp, workingDir);
+ }
+ }
+
+ String lineSeparator = settings.getLineSeparator();
+ if (lineSeparator == null && pty == null) {
+ lineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$
+ if ("\r".equals(lineSeparator)) { //$NON-NLS-1$
+ lineSeparator = ILineSeparatorConstants.LINE_SEPARATOR_CR;
+ }
+ else if ("\n".equals(lineSeparator)) { //$NON-NLS-1$
+ lineSeparator = ILineSeparatorConstants.LINE_SEPARATOR_LF;
+ }
+ else {
+ lineSeparator = ILineSeparatorConstants.LINE_SEPARATOR_CRLF;
+ }
+ }
+
+ // Setup the listeners
+ setStdoutListeners(settings.getStdOutListeners());
+ setStderrListeners(settings.getStdErrListeners());
+
+ // Enable VT100 line wrapping if we are connected via pty
+ // And TERM is VT100 compatible
+ if (pty != null && !isAnsiTerminal)
+ control.setVT100LineWrapping(true);
+
+ // connect the streams
+ connectStreams(control, process.getOutputStream(), process.getInputStream(), (pty == null ? process.getErrorStream() : null), settings.isLocalEcho(), lineSeparator);
+
+ // Set the terminal control state to CONNECTED
+ control.setState(TerminalState.CONNECTED);
+
+ // Create the process monitor
+ monitor = new ProcessMonitor(this);
+ monitor.startMonitoring();
+ } catch (IOException e) {
+ // Disconnect right away
+ disconnect();
+ // Lookup the tab item
+ CTabItem item = ConsoleManager.getInstance().findConsole(control);
+ if (item != null) item.dispose();
+ // Get the error message from the exception
+ String msg = e.getLocalizedMessage() != null ? e.getLocalizedMessage() : ""; //$NON-NLS-1$
+ Assert.isNotNull(msg);
+ // Strip away "Exec_tty error:"
+ msg = msg.replace("Exec_tty error:", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
+ // Repackage into a more user friendly error
+ msg = NLS.bind(Messages.ProcessConnector_error_creatingProcess, settings.getImage(), msg);
+ // Open an error dialog
+ MessageDialog.openError(control.getShell(), Messages.ProcessConnector_error_title, msg);
+ }
+ }
+
+ private static String getTermVariable(String[] envp) {
+ if (envp != null && !Platform.OS_WIN32.equals(Platform.getOS()))
+ for (String var : envp)
+ if (var.startsWith("TERM=")) //$NON-NLS-1$
+ return var.substring(5);
+ return "xterm"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#isLocalEcho()
+ */
+ @Override
+ public boolean isLocalEcho() {
+ return settings.isLocalEcho();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.streams.AbstractStreamsConnector#doDisconnect()
+ */
+ @Override
+ public void doDisconnect() {
+ // Stop monitoring the process
+ if (monitor != null) {
+ monitor.dispose();
+ }
+
+ boolean isWindows = Platform.OS_WIN32.equals(Platform.getOS());
+
+ if (!isWindows) {
+ // Destroy the process first, except on windows (Bug 465674)
+ if (process != null) { process.destroy(); process = null; }
+ }
+
+ // Dispose the streams
+ super.doDisconnect();
+
+ if (isWindows) {
+ // On Windows destroy the process after closing streams
+ if (process != null) { process.destroy(); process = null; }
+ }
+
+ // Set the terminal control state to CLOSED.
+ fControl.setState(TerminalState.CLOSED);
+ }
+
+ // ***** Process Connector settings handling *****
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#setDefaultSettings()
+ */
+ @Override
+ public void setDefaultSettings() {
+ settings.load(new NullSettingsStore());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getSettingsSummary()
+ */
+ @Override
+ public String getSettingsSummary() {
+ return settings.getImage() != null ? settings.getImage() : ""; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#load(org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore)
+ */
+ @Override
+ public void load(ISettingsStore store) {
+ settings.load(store);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#save(org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore)
+ */
+ @Override
+ public void save(ISettingsStore store) {
+ settings.save(store);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#setTerminalSize(int, int)
+ */
+ @Override
+ public void setTerminalSize(int newWidth, int newHeight) {
+ if (width != newWidth || height != newHeight) {
+ width = newWidth;
+ height = newHeight;
+ if (pty != null) {
+ pty.setTerminalSize(newWidth, newHeight);
+ }
+ }
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessLauncherDelegate.java
new file mode 100644
index 00000000000..bc9e067f29d
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessLauncherDelegate.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process;
+
+import java.util.Map;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalServiceOutputStreamMonitorListener;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+
+/**
+ * Process launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class ProcessLauncherDelegate extends AbstractLauncherDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#getPanel(org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map properties, ITerminalService.Done done) {
+ Assert.isNotNull(properties);
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String)properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) connectorId = "org.eclipse.tm.terminal.connector.process.ProcessConnector"; //$NON-NLS-1$
+
+ // Extract the process properties
+ String image = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH);
+ String arguments = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ARGS);
+ Process process = (Process)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_OBJ);
+ PTY pty = (PTY)properties.get(ITerminalsConnectorConstants.PROP_PTY_OBJ);
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO);
+ boolean localEcho = value instanceof Boolean ? ((Boolean)value).booleanValue() : false;
+ String lineSeparator = (String)properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR);
+ ITerminalServiceOutputStreamMonitorListener[] stdoutListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDOUT_LISTENERS);
+ ITerminalServiceOutputStreamMonitorListener[] stderrListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDERR_LISTENERS);
+ String workingDir = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR);
+
+ String[] envp = null;
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) != null &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) instanceof String[]){
+ envp = (String[])properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT);
+ }
+
+ Assert.isTrue(image != null || process != null);
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the process settings
+ ProcessSettings processSettings = new ProcessSettings();
+ processSettings.setImage(image);
+ processSettings.setArguments(arguments);
+ processSettings.setProcess(process);
+ processSettings.setPTY(pty);
+ processSettings.setLocalEcho(localEcho);
+ processSettings.setLineSeparator(lineSeparator);
+ processSettings.setStdOutListeners(stdoutListeners);
+ processSettings.setStdErrListeners(stderrListeners);
+ processSettings.setWorkingDir(workingDir);
+ processSettings.setEnvironment(envp);
+
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT)) {
+ value = properties.get(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT);
+ processSettings.setMergeWithNativeEnvironment(value instanceof Boolean ? ((Boolean)value).booleanValue() : false);
+ }
+
+ // And save the settings to the store
+ processSettings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessMonitor.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessMonitor.java
new file mode 100644
index 00000000000..ad509ca1b50
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessMonitor.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process;
+
+import org.eclipse.core.runtime.Assert;
+
+
+/**
+ * Process monitor implementation.
+ */
+public class ProcessMonitor {
+ // Reference to the parent process connector
+ private final ProcessConnector processConnector;
+ // Reference to the monitored process
+ private final Process process;
+ // Reference to the monitor thread
+ private Thread thread;
+ // Flag to mark the monitor disposed
+ private boolean disposed;
+
+
+ /**
+ * Constructor.
+ *
+ * @param processConnector The parent process connector. Must not be null.
+ */
+ public ProcessMonitor(ProcessConnector processConnector) {
+ super();
+
+ Assert.isNotNull(processConnector);
+ this.processConnector = processConnector;
+
+ // Query the monitored process for easier access
+ this.process = processConnector.getProcess();
+ }
+
+ /**
+ * Dispose the process monitor.
+ */
+ public void dispose() {
+ // Set the disposed status
+ disposed = true;
+ // Not initialized -> return immediately
+ if (thread == null) return;
+
+ // Copy the reference
+ final Thread oldThread = thread;
+ // Unlink the monitor from the thread
+ thread = null;
+ // And interrupt the writer thread
+ oldThread.interrupt();
+ }
+
+ /**
+ * Starts the terminal output stream monitor.
+ */
+ public void startMonitoring() {
+ // If already initialized -> return immediately
+ if (thread != null) return;
+
+ // Create a new runnable which is constantly reading from the stream
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ monitorProcess();
+ }
+ };
+
+ // Create the monitor thread
+ thread = new Thread(runnable, "Terminal Process Monitor Thread"); //$NON-NLS-1$
+
+ // Configure the monitor thread
+ thread.setDaemon(true);
+
+ // Start the processing
+ thread.start();
+ }
+
+ /**
+ * Monitors the associated system process, waiting for it to terminate,
+ * and notifies the associated process monitor's.
+ */
+ public void monitorProcess() {
+ // If already disposed -> return immediately
+ if (disposed) return;
+
+ try {
+ // Wait for the monitored process to terminate
+ process.waitFor();
+ } catch (InterruptedException ie) {
+ // clear interrupted state
+ Thread.interrupted();
+ } finally {
+ // Dispose the parent process connector
+ if (!disposed)
+ processConnector.disconnect();
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettings.java
new file mode 100644
index 00000000000..4d74734df74
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettings.java
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalServiceOutputStreamMonitorListener;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+
+/**
+ * Process connector settings implementation.
+ */
+@SuppressWarnings("restriction")
+public class ProcessSettings {
+ // Reference to the process image
+ private String image;
+ // Reference to the process arguments (space separated string)
+ private String arguments;
+ // Reference to the process object
+ private Process process;
+ // Reference to the pseudo terminal object
+ private PTY pty;
+ // Flag to control the local echo (defaults to true if
+ // the PTY is not supported on the current host platform)
+ private boolean localEcho = !PTY.isSupported();
+ // The line separator setting
+ private String lineSeparator = null;
+ // The list of stdout output listeners
+ private ITerminalServiceOutputStreamMonitorListener[] stdoutListeners = null;
+ // The list of stderr output listeners
+ private ITerminalServiceOutputStreamMonitorListener[] stderrListeners = null;
+ // working directory for process
+ private String workingDir;
+ // environment
+ private String[] environment;
+ // Flag to control if the provided environment is
+ // automatically merged with the native process environment.
+ // Defaults to "true".
+ private boolean mergeWithNativeEnvironment = true;
+
+ /**
+ * Sets the process image.
+ *
+ * @param image The process image or null.
+ */
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ /**
+ * Returns the process image.
+ *
+ * @return The process image or null.
+ */
+ public String getImage() {
+ return image;
+ }
+
+ /**
+ * Sets the process arguments.
+ *
+ * The arguments are space separated. The caller is responsible for
+ * correct quoting.
+ *
+ * @param arguments The process arguments or null.
+ */
+ public void setArguments(String arguments) {
+ this.arguments = arguments;
+ }
+
+ /**
+ * Returns the process arguments.
+ *
+ * @return The process arguments as space separated list or null.
+ */
+ public String getArguments() {
+ return arguments;
+ }
+
+ /**
+ * Sets the process object.
+ *
+ * @param image The process object or null.
+ */
+ public void setProcess(Process process) {
+ this.process = process;
+ }
+
+ /**
+ * Returns the process object.
+ *
+ * @return The process object or null.
+ */
+ public Process getProcess() {
+ return process;
+ }
+
+ /**
+ * Sets the pseudo terminal object.
+ *
+ * @param pty The pseudo terminal or null.
+ */
+ public void setPTY(PTY pty) {
+ this.pty = pty;
+ // If the PTY is set to "null", the local echo will be set to "true"
+ if (pty == null) setLocalEcho(true);
+ }
+
+ /**
+ * Returns the pseudo terminal object.
+ *
+ * @return The pseudo terminal or null.
+ */
+ public PTY getPTY() {
+ return pty;
+ }
+
+ /**
+ * Sets if the process requires a local echo from the
+ * terminal widget.
+ *
+ * @param value Specify true to enable the local echo, false otherwise.
+ */
+ public void setLocalEcho(boolean value) {
+ this.localEcho = value;
+ }
+
+ /**
+ * Returns true if the process requires a local echo
+ * from the terminal widget.
+ *
+ * @return True if local echo is enabled, false otherwise.
+ */
+ public boolean isLocalEcho() {
+ return localEcho;
+ }
+
+ /**
+ * Sets the process line separator.
+ *
+ * @param separator The process line separator null.
+ */
+ public void setLineSeparator(String separator) {
+ this.lineSeparator = separator;
+ }
+
+ /**
+ * Returns the process line separator.
+ *
+ * @return The process line separator or null.
+ */
+ public String getLineSeparator() {
+ return lineSeparator;
+ }
+
+ /**
+ * Sets the list of stdout listeners.
+ *
+ * @param listeners The list of stdout listeners or null.
+ */
+ public void setStdOutListeners(ITerminalServiceOutputStreamMonitorListener[] listeners) {
+ this.stdoutListeners = listeners;
+ }
+
+ /**
+ * Returns the list of stdout listeners.
+ *
+ * @return The list of stdout listeners or null.
+ */
+ public ITerminalServiceOutputStreamMonitorListener[] getStdOutListeners() {
+ return stdoutListeners;
+ }
+
+ /**
+ * Sets the list of stderr listeners.
+ *
+ * @param listeners The list of stderr listeners or null.
+ */
+ public void setStdErrListeners(ITerminalServiceOutputStreamMonitorListener[] listeners) {
+ this.stderrListeners = listeners;
+ }
+
+ /**
+ * Returns the list of stderr listeners.
+ *
+ * @return The list of stderr listeners or null.
+ */
+ public ITerminalServiceOutputStreamMonitorListener[] getStdErrListeners() {
+ return stderrListeners;
+ }
+
+ /**
+ * Returns the working directory
+ *
+ * @return
+ */
+ public String getWorkingDir() {
+ return this.workingDir;
+ }
+
+ /**
+ * Sets the working directory of the process
+ *
+ * @param workingDir the absolute path of the working directory
+ */
+ public void setWorkingDir(String workingDir) {
+ this.workingDir = workingDir;
+ }
+
+ /**
+ * Get the process environment
+ *
+ * @return
+ */
+ public String[] getEnvironment() {
+ return environment;
+ }
+
+ /**
+ * Sets the process environment
+ *
+ * @param environment - will be added to the "parent" environment of the process
+ */
+ public void setEnvironment(String[] environment) {
+ this.environment = environment;
+ }
+
+ /**
+ * Returns if or if not the provided environment is merged with
+ * the native process environment.
+ *
+ * @return True if the provided environment is merged with the native process environment, false otherwise.
+ */
+ public boolean isMergeWithNativeEnvironment() {
+ return mergeWithNativeEnvironment;
+ }
+
+ /**
+ * Sets if or if not the provided environment is merged with the
+ * native process environment.
+ *
+ * @param value True if the provided environment is merged with the native process environment, false otherwise.
+ */
+ public void setMergeWithNativeEnvironment(boolean value) {
+ this.mergeWithNativeEnvironment = value;
+ }
+
+ /**
+ * Loads the process settings from the given settings store.
+ *
+ * @param store The settings store. Must not be null.
+ */
+ public void load(ISettingsStore store) {
+ Assert.isNotNull(store);
+ image = store.get("Path", null);//$NON-NLS-1$
+ arguments = store.get("Arguments", null); //$NON-NLS-1$
+ localEcho = Boolean.parseBoolean(store.get("LocalEcho", Boolean.FALSE.toString())); //$NON-NLS-1$
+ mergeWithNativeEnvironment = Boolean.parseBoolean(store.get("MergeWithNativeEnvironment", Boolean.FALSE.toString())); //$NON-NLS-1$
+ lineSeparator = store.get("LineSeparator", null); //$NON-NLS-1$
+ workingDir = store.get("WorkingDir", null); //$NON-NLS-1$
+ if (store instanceof SettingsStore) {
+ process = (Process)((SettingsStore)store).getSettings().get("Process"); //$NON-NLS-1$
+ pty = (PTY)((SettingsStore)store).getSettings().get("PTY"); //$NON-NLS-1$
+ stdoutListeners = (ITerminalServiceOutputStreamMonitorListener[])((SettingsStore)store).getSettings().get("StdOutListeners"); //$NON-NLS-1$
+ stderrListeners = (ITerminalServiceOutputStreamMonitorListener[])((SettingsStore)store).getSettings().get("StdErrListeners"); //$NON-NLS-1$
+ environment = (String[])((SettingsStore)store).getSettings().get("Environment"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Saves the process settings to the given settings store.
+ *
+ * @param store The settings store. Must not be null.
+ */
+ public void save(ISettingsStore store) {
+ Assert.isNotNull(store);
+ store.put("Path", image);//$NON-NLS-1$
+ store.put("Arguments", arguments); //$NON-NLS-1$
+ store.put("LocalEcho", Boolean.toString(localEcho)); //$NON-NLS-1$
+ store.put("MergeWithNativeEnvironment", Boolean.toString(mergeWithNativeEnvironment)); //$NON-NLS-1$
+ store.put("LineSeparator", lineSeparator); //$NON-NLS-1$
+ store.put("WorkingDir", workingDir); //$NON-NLS-1$
+ if (store instanceof SettingsStore) {
+ ((SettingsStore)store).getSettings().put("Process", process); //$NON-NLS-1$
+ ((SettingsStore)store).getSettings().put("PTY", pty); //$NON-NLS-1$
+ ((SettingsStore)store).getSettings().put("StdOutListeners", stdoutListeners); //$NON-NLS-1$
+ ((SettingsStore)store).getSettings().put("StdErrListeners", stderrListeners); //$NON-NLS-1$
+ ((SettingsStore)store).getSettings().put("Environment", environment); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettingsPage.java
new file mode 100644
index 00000000000..3b734e318b4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/ProcessSettingsPage.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.eclipse.tm.terminal.view.ui.nls.Messages;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.Bundle;
+
+/**
+ * Process connector settings page implementation.
+ */
+@SuppressWarnings("restriction")
+public class ProcessSettingsPage extends AbstractSettingsPage {
+ private Text processImageSelectorControl;
+ private Button processImageSelectorControlButton;
+ private Text processArgumentsControl;
+ private Button localEchoSelectorControl;
+ private Text processWorkingDirControl;
+
+ private final ProcessSettings settings;
+
+ /**
+ * Constructor.
+ *
+ * @param settings
+ */
+ public ProcessSettingsPage(ProcessSettings settings) {
+ super();
+
+ Assert.isNotNull(settings);
+ this.settings = settings;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // The entry fields shall be properly aligned
+ Composite panel = new Composite(composite, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginWidth = 0; layout.marginHeight = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Create the process image selector control
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ProcessSettingsPage_processImagePathSelectorControl_label);
+
+ // Text field and browse button are aligned it their own panel
+ Composite innerPanel = new Composite(panel, SWT.NONE);
+ layout = new GridLayout(2, false);
+ layout.marginWidth = 0; layout.marginHeight = 0;
+ innerPanel.setLayout(layout);
+ innerPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ processImageSelectorControl = new Text(innerPanel, SWT.SINGLE | SWT.BORDER);
+ processImageSelectorControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ processImageSelectorControlButton = new Button(innerPanel, SWT.PUSH);
+ processImageSelectorControlButton.setText(Messages.ProcessSettingsPage_processImagePathSelectorControl_button);
+ processImageSelectorControlButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ onBrowseButtonSelected(e);
+ }
+ });
+
+ // Create the process arguments control
+ label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ProcessSettingsPage_processArgumentsControl_label);
+
+ processArgumentsControl = new Text(panel, SWT.SINGLE | SWT.BORDER);
+ processArgumentsControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Create the process arguments control
+ label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ProcessSettingsPage_processWorkingDirControl_label);
+
+ processWorkingDirControl = new Text(panel, SWT.SINGLE | SWT.BORDER);
+ processWorkingDirControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Create the local echo check box
+ localEchoSelectorControl = new Button(composite, SWT.CHECK);
+ localEchoSelectorControl.setText(Messages.ProcessSettingsPage_localEchoSelectorControl_label);
+ localEchoSelectorControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ localEchoSelectorControl.setSelection(!PTY.isSupported());
+
+ // Initialize the control content
+ loadSettings();
+ }
+
+ /**
+ * Called once the user pressed the browse button.
+ *
+ * @param e The selection event or null.
+ */
+ protected void onBrowseButtonSelected(SelectionEvent e) {
+ // Determine the shell
+ Shell shell = e != null ? e.widget.getDisplay().getActiveShell() : PlatformUI.getWorkbench().getDisplay().getActiveShell();
+
+ // create a standard file dialog
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setText(Messages.ProcessSettingsPage_dialogTitle);
+
+ // the dialog should open within the directory of the currently selected
+ // file. If no file has been currently selected, it should open within the
+ // last browsed directory.
+ String selectedFile = processImageSelectorControl.getText();
+ if (selectedFile != null && selectedFile.trim().length() > 0) {
+ IPath filePath = new Path(selectedFile);
+ // If the selected file points to an directory, use the directory as is
+ IPath filterPath = filePath.toFile().isDirectory() ? filePath : filePath.removeLastSegments(1);
+ String filterFileName = filePath.toFile().isDirectory() || !filePath.toFile().exists() ? null : filePath.lastSegment();
+
+ if (!filterPath.isEmpty()) {
+ dialog.setFilterPath(filterPath.toString());
+ }
+ if (filterFileName != null) {
+ dialog.setFileName(filterFileName);
+ }
+ } else {
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && bundle.getState() != Bundle.UNINSTALLED && bundle.getState() != Bundle.STOPPING) {
+ dialog.setFilterPath(org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
+ }
+ }
+
+ // Open the dialog
+ selectedFile = dialog.open();
+ if (selectedFile != null) {
+ processImageSelectorControl.setText(selectedFile);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#saveSettings()
+ */
+ @Override
+ public void saveSettings() {
+ settings.setImage(processImageSelectorControl.getText());
+ settings.setArguments(processArgumentsControl.getText());
+ settings.setLocalEcho(localEchoSelectorControl.getSelection());
+ settings.setWorkingDir(processWorkingDirControl.getText());
+ settings.setProcess(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#loadSettings()
+ */
+ @Override
+ public void loadSettings() {
+ processImageSelectorControl.setText(settings.getImage());
+ processArgumentsControl.setText(settings.getArguments());
+ localEchoSelectorControl.setSelection(settings.isLocalEcho());
+ processWorkingDirControl.setText(settings.getWorkingDir());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#validateSettings()
+ */
+ @Override
+ public boolean validateSettings() {
+ // The settings are considered valid if the selected process image can be read.
+ String selectedFile = processImageSelectorControl.getText();
+ return selectedFile != null && !"".equals(selectedFile.trim()) && new Path(selectedFile).toFile().canRead(); //$NON-NLS-1$
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/activator/UIPlugin.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/activator/UIPlugin.java
new file mode 100644
index 00000000000..bf236afcf2e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/activator/UIPlugin.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process.activator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tm.terminal.view.core.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tm.terminal.connector.process"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ super.initializeImageRegistry(registry);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the Image object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The Image object instance or null.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the ImageDescriptor object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The ImageDescriptor object instance or null.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/help/IContextHelpIds.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/help/IContextHelpIds.java
new file mode 100644
index 00000000000..2d042f346d7
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/help/IContextHelpIds.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process.help;
+
+import org.eclipse.tm.terminal.connector.process.activator.UIPlugin;
+
+
+/**
+ * Context help id definitions.
+ */
+public interface IContextHelpIds {
+
+ /**
+ * UI plug-in common context help id prefix.
+ */
+ public final static String PREFIX = UIPlugin.getUniqueIdentifier() + "."; //$NON-NLS-1$
+
+ // ***** Message dialog boxes *****
+
+ /**
+ * Process connector: Create process failed
+ */
+ public final static String MESSAGE_CREATE_PROCESS_FAILED = PREFIX + ".status.messageCreateProcessFailed"; //$NON-NLS-1$
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.java
new file mode 100644
index 00000000000..9e53c53460b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.process.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Process terminal connector plug-in externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tm.terminal.connector.process.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String ProcessConnector_error_title;
+ public static String ProcessConnector_error_creatingProcess;
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.properties
new file mode 100644
index 00000000000..21f4086135e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.process/src/org/eclipse/tm/terminal/connector/process/nls/Messages.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+ProcessConnector_error_title=Error
+ProcessConnector_error_creatingProcess=Failed to execute ''{0}''.\n\nPossibly caused by:\n{1}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.cvsignore
new file mode 100644
index 00000000000..ba077a4031a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.project
new file mode 100644
index 00000000000..da3152ba6b3
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.project
@@ -0,0 +1,34 @@
+
+
+ org.eclipse.tm.terminal.connector.remote
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..94637dfe13b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,61 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0b831f584d6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Dec 07 03:43:08 CET 2006
+eclipse.preferences.version=1
+internal.default.compliance=user
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..e39aae0d49b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.remote;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.tm.terminal.control,
+ org.eclipse.remote.core,
+ org.eclipse.remote.ui,
+ org.eclipse.core.resources,
+ org.eclipse.swt,
+ org.eclipse.jface,
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.core.expressions
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.tm.terminal.connector.remote,
+ org.eclipse.tm.terminal.connector.remote.controls,
+ org.eclipse.tm.terminal.connector.remote.internal;x-internal:=true,
+ org.eclipse.tm.terminal.connector.remote.internal.preferences;x-internal:=true,
+ org.eclipse.tm.terminal.connector.remote.launcher,
+ org.eclipse.tm.terminal.connector.remote.nls;x-internal:=true
+Bundle-Activator: org.eclipse.tm.terminal.connector.remote.internal.Activator
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.ide
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/about.html
new file mode 100644
index 00000000000..62cf4ee7eb8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
June 5, 2007
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/build.properties
new file mode 100644
index 00000000000..e6c3165b15a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.properties
new file mode 100644
index 00000000000..567c4642d8d
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2015, 2018 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+pluginName = Terminal via Remote API Connector
+providerName = Eclipse.org - Target Management
+connectionName = Remote Services
+RemoteTerminalPage.name = Remote Terminal
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.xml
new file mode 100644
index 00000000000..db974b30030
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/plugin.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/pom.xml
new file mode 100644
index 00000000000..c820a1d1594
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.remote
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/schema/parsers.exsd b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/schema/parsers.exsd
new file mode 100644
index 00000000000..ec8f1d9f32e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/schema/parsers.exsd
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+ Extension point that allows a parser to be added to the terminal view. The parser is intended to process output generated by the remote shell and perform an action based on the content.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unique identifier for this parser
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Enter the first release in which this extension point appears.]
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ [Enter API information here.]
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteSettings.java
new file mode 100644
index 00000000000..e0c4671e641
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteSettings.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote;
+
+public interface IRemoteSettings {
+ public static final String CONNECTION_NAME = "ConnectionName"; //$NON-NLS-1$
+ public static final String CONNECTION_TYPE_ID = "ConnectionTypeId"; //$NON-NLS-1$
+
+ /**
+ * Get the connection type ID for the connection (e.g. local, ssh, etc.)
+ *
+ * @return connection type ID.
+ */
+ String getConnectionTypeId();
+
+ /**
+ * Get the connection name for the target system.
+ *
+ * @return connection name
+ */
+ String getConnectionName();
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalConstants.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalConstants.java
new file mode 100644
index 00000000000..b58bc867fa6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalConstants.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote;
+
+public interface IRemoteTerminalConstants {
+ public static final String PREF_TERMINAL_SHELL_COMMAND = "TERMINAL_SHELL_COMMAND"; //$NON-NLS-1$
+ public static final String PREF_TERMINAL_TYPE = "TERMINAL_TYPE"; //$NON-NLS-1$
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalParser.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalParser.java
new file mode 100644
index 00000000000..dd8670059dc
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalParser.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote;
+
+import java.io.IOException;
+
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.remote.core.IRemoteProcess;
+
+public interface IRemoteTerminalParser {
+ /**
+ * Initialize the remote shell. This method will be called after the connection has been initialized. Implementors can assume
+ * that the connection is open when this is called.
+ *
+ * @param connection
+ * terminal shell connection
+ * @return IRemoteProcess a remote process corresponding to the remote shell
+ * @throws IOException
+ * if the remote shell fails to start for some reason
+ */
+ IRemoteProcess initialize(IRemoteConnection connection) throws IOException;
+
+ /**
+ * Parse the input stream. This method will be called with a buffer of characters read from the input stream. If the method
+ * returns true, the characters will be displayed in the terminal view, otherwise they will be ignored.
+ *
+ * @param buf
+ * buffer containing characters from the terminal input stream
+ * @return true if the characters should be displayed in the terminal
+ */
+ boolean parse(byte[] buf);
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/controls/RemoteWizardConfigurationPanel.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/controls/RemoteWizardConfigurationPanel.java
new file mode 100644
index 00000000000..5a8853f3d87
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/controls/RemoteWizardConfigurationPanel.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.controls;
+
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
+import org.eclipse.tm.terminal.connector.remote.IRemoteSettings;
+import org.eclipse.tm.terminal.connector.remote.internal.RemoteConnector;
+import org.eclipse.tm.terminal.connector.remote.internal.RemoteSettings;
+import org.eclipse.tm.terminal.connector.remote.internal.RemoteSettingsPage;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel;
+
+/**
+ * Remote wizard configuration panel implementation.
+ */
+@SuppressWarnings("restriction")
+public class RemoteWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
+
+ private RemoteSettings remoteSettings;
+ private ISettingsPage remoteSettingsPage;
+
+ /**
+ * Constructor.
+ *
+ * @param container
+ * The configuration panel container or null.
+ */
+ public RemoteWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ panel.setLayoutData(data);
+
+ RemoteConnector conn = new RemoteConnector();
+ remoteSettings = (RemoteSettings) conn.getRemoteSettings();
+
+ remoteSettingsPage = new RemoteSettingsPage(remoteSettings);
+ if (remoteSettingsPage instanceof AbstractSettingsPage) {
+ ((AbstractSettingsPage) remoteSettingsPage).setHasControlDecoration(true);
+ }
+ remoteSettingsPage.createControl(panel);
+
+ // Add the listener to the settings page
+ remoteSettingsPage.addListener(new ISettingsPage.Listener() {
+
+ @Override
+ public void onSettingsPageChanged(Control control) {
+ if (getContainer() != null) {
+ getContainer().validate();
+ }
+ }
+ });
+
+ // Create the encoding selection combo
+ createEncodingUI(panel, true);
+
+ setControl(panel);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#setupData(java.util.Map)
+ */
+ @Override
+ public void setupData(Map data) {
+ if (data == null || remoteSettings == null || remoteSettingsPage == null) {
+ return;
+ }
+
+ String value = (String) data.get(IRemoteSettings.CONNECTION_TYPE_ID);
+ if (value != null) {
+ remoteSettings.setConnectionTypeId(value);
+ }
+
+ value = (String) data.get(IRemoteSettings.CONNECTION_NAME);
+ if (value != null) {
+ remoteSettings.setConnectionName(value);
+ }
+
+ value = (String) data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) {
+ setEncoding(value);
+ }
+
+ remoteSettingsPage.loadSettings();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#extractData(java.util.Map)
+ */
+ @Override
+ public void extractData(Map data) {
+ if (data == null) {
+ return;
+ }
+
+ // set the terminal connector id for remote
+ data.put(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID,
+ "org.eclipse.tm.terminal.connector.remote.RemoteConnector"); //$NON-NLS-1$
+
+ remoteSettingsPage.saveSettings();
+
+ data.put(IRemoteSettings.CONNECTION_TYPE_ID, remoteSettings.getConnectionTypeId());
+ data.put(IRemoteSettings.CONNECTION_NAME, remoteSettings.getConnectionName());
+ if (getEncoding() != null) {
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
+ */
+ @Override
+ protected void fillSettingsForHost(String host) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
+ @Override
+ protected void saveSettingsForHost(boolean add) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid() {
+ return isEncodingValid() && remoteSettingsPage.validateSettings();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.
+ * IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ saveSettingsForHost(true);
+ super.doSaveWidgetValues(settings, idPrefix);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
+ */
+ @Override
+ protected String getHostFromSettings() {
+ remoteSettingsPage.saveSettings();
+ return null;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/Activator.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/Activator.java
new file mode 100644
index 00000000000..4ab951914e8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/Activator.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.tm.terminal.connector.remote.nls.Messages;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.tm.terminal.remote"; //$NON-NLS-1$
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ super();
+ plugin = this;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Create log entry from an IStatus
+ *
+ * @param status
+ * status to log
+ */
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ /**
+ * Create log entry from a string
+ *
+ * @param msg
+ * message to log
+ */
+ public static void log(String msg) {
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, msg, null));
+ }
+
+ /**
+ * Create log entry from a Throwable
+ *
+ * @param e
+ * throwable to log
+ */
+ public static void log(Throwable e) {
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, Messages.TERMINAL_EXCEPTION, e));
+ }
+
+ // Get rid of edu.lsu.cct tags
+
+ /**
+ * Generate a unique identifier
+ *
+ * @return unique identifier string
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() == null) {
+ // If the default instance is not yet initialized,
+ // return a static identifier. This identifier must
+ // match the plugin id defined in plugin.xml
+ return PLUGIN_ID;
+ }
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+ /**
+ * Return the OSGi service with the given service interface.
+ *
+ * @param service
+ * service interface
+ * @return the specified service or null if it's not registered
+ */
+ public static T getService(Class service) {
+ final BundleContext context = plugin.getBundle().getBundleContext();
+ final ServiceReference ref = context.getServiceReference(service);
+ return ref != null ? context.getService(ref) : null;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/ArgumentParser.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/ArgumentParser.java
new file mode 100644
index 00000000000..59d647b9ef6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/ArgumentParser.java
@@ -0,0 +1,363 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import java.text.CharacterIterator;
+import java.text.StringCharacterIterator;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Utility class for managing command line arguments.
+ */
+public class ArgumentParser {
+ private final List tokens;
+
+ /**
+ * Create a command line representation from the string with a shell command
+ * line. The command line is parsed and split on spaces. Quoted or escaped
+ * spaces are preserved..
+ */
+ public ArgumentParser(String commandline) {
+ this.tokens = parseCommandline(commandline);
+ }
+
+ /**
+ * Create a command line representation from an array of strings. The first
+ * element of the array is assumed to be the command, the remaining, the
+ * arguments. The elements are not parsed not (un)escaped., but taked as the
+ * are.
+ */
+ public ArgumentParser(String tokenArray[]) {
+ this(Arrays.asList(tokenArray));
+ }
+
+ /**
+ * Create a command line representation from an array of strings. The first
+ * element of the list is assumed to be the command, the remaining, the
+ * arguments. The elements are not parsed not (un)escaped., but taked as the
+ * are.
+ */
+ public ArgumentParser(List tokenList) {
+ this.tokens = new ArrayList(tokenList);
+ }
+
+ /**
+ * Create a command line representation from the command and an array of
+ * parameters. The elements are not parsed not (un)escaped., but taked as
+ * the are.
+ */
+ public ArgumentParser(String command, String parameterArray[]) {
+ this(command, Arrays.asList(parameterArray));
+ }
+
+ /**
+ * Create a command line representation from the command and an list of
+ * parameters. The elements are not parsed not (un)escaped., but taked as
+ * the are.
+ */
+ public ArgumentParser(String command, List parameterList) {
+ this.tokens = new ArrayList();
+ this.tokens.add(command);
+ this.tokens.addAll(parameterList);
+ }
+
+ private static List parseCommandline(String commandline) {
+ ArrayList result = new ArrayList();
+ StringCharacterIterator iterator = new StringCharacterIterator(commandline);
+
+ for (iterator.first(); iterator.current() != CharacterIterator.DONE; iterator.next()) {
+
+ // Restart to skip white space
+ if (Character.isWhitespace(iterator.current())) {
+ continue;
+ }
+
+ // Read token
+ StringBuffer buffer = new StringBuffer();
+ token_reader: for (; iterator.current() != CharacterIterator.DONE; iterator.next()) {
+ char tokenChar = iterator.current();
+
+ // A white space terminates the token
+ if (Character.isWhitespace(tokenChar)) {
+ break token_reader;
+ }
+
+ // Handle character that composes the token
+ switch (tokenChar) {
+ case '"': {
+ /*
+ * Read all text within double quotes or until end of
+ * string. Allows escaping.
+ */
+ iterator.next(); // Skip quote
+ quoted_reader: while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '"')) {
+ char innerChar = iterator.current();
+ switch (innerChar) {
+ case '\\':
+ char nextChar = iterator.next();
+ switch (nextChar) {
+ case CharacterIterator.DONE:
+ break quoted_reader;
+ case '"':
+ // Add the character, but remove the escape
+ buffer.append(nextChar);
+ iterator.next();
+ continue quoted_reader;
+ default:
+ // Add the character and keep escape
+ buffer.append(innerChar);
+ buffer.append(nextChar);
+ iterator.next();
+ continue quoted_reader;
+ }
+ default:
+ buffer.append(innerChar);
+ iterator.next();
+ continue quoted_reader;
+ }
+ }
+ continue token_reader;
+ }
+ case '\'': {
+ /*
+ * Read all text within single quotes or until end of
+ * string. No escaping.
+ */
+ iterator.next(); // Skip the quote
+ while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '\'')) {
+ buffer.append(iterator.current());
+ iterator.next();
+ }
+ continue token_reader;
+ }
+ case '\\': {
+ /*
+ * Read escaped char.
+ */
+ char nextChar = iterator.next();
+ switch (nextChar) {
+ case CharacterIterator.DONE:
+ break token_reader;
+ case '\n':
+ // Ignore newline. Both lines are concatenated.
+ continue token_reader;
+ default:
+ // Add the character, but remove the escape
+ buffer.append(nextChar);
+ continue token_reader;
+ }
+ }
+ default:
+ /*
+ * Any other char, add to the buffer.
+ */
+ buffer.append(tokenChar);
+ continue token_reader;
+ }
+ }
+ result.add(buffer.toString());
+ }
+
+ return result;
+ }
+
+ /**
+ * Convert all tokens in a full command line that can be executed in a
+ * shell.
+ *
+ * @param fullEscape
+ * If every special character shall be escaped. If false, only
+ * white spaces are escaped and the shell will interpret the
+ * special chars. If true, then all special chars are quoted.
+ */
+ public String getCommandLine(boolean fullEscape) {
+ StringBuffer buffer = new StringBuffer();
+ Iterator iterator = this.tokens.iterator();
+ boolean first = true;
+ while (iterator.hasNext()) {
+ String token = iterator.next();
+ if (!first) {
+ buffer.append(' ');
+ } else {
+ first = false;
+ }
+ buffer.append(escapeToken(token, fullEscape));
+ }
+ return buffer.toString();
+ }
+
+ private StringBuffer escapeToken(String token, boolean fullEscape) {
+ StringBuffer buffer = new StringBuffer();
+ StringCharacterIterator iter = new StringCharacterIterator(token);
+ for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
+ if (Character.isWhitespace(c)) {
+ buffer.append('\\');
+ buffer.append(c);
+ continue;
+ }
+ switch (c) {
+ case '(':
+ case ')':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '|':
+ case '\\':
+ case '*':
+ case '&':
+ case '^':
+ case '%':
+ case '$':
+ case '#':
+ case '@':
+ case '!':
+ case '~':
+ case '`':
+ case '\'':
+ case '"':
+ case ':':
+ case ';':
+ case '?':
+ case '>':
+ case '<':
+ case '\n':
+ if (fullEscape) {
+ buffer.append('\\');
+ }
+ buffer.append(c);
+ continue;
+ case ' ':
+ buffer.append('\\');
+ buffer.append(c);
+ continue;
+ default:
+ buffer.append(c);
+ continue;
+ }
+ }
+ return buffer;
+ }
+
+ /**
+ * Returns a List of all entries of the command line.
+ *
+ * @return The Array
+ */
+ public String[] getTokenArray() {
+ return this.tokens.toArray(new String[this.tokens.size()]);
+ }
+
+ /**
+ * Returns a List of all entries of the command line.
+ *
+ * @return The List
+ */
+ public List getTokenList() {
+ return new ArrayList(this.tokens);
+ }
+
+ /**
+ * Returns the command of the command line, assuming that the first entry is
+ * always the command.
+ *
+ * @return The command or null if the command lines has no command nor
+ * arguments.
+ */
+ public String getCommand() {
+ if (this.tokens.size() == 0) {
+ return null;
+ }
+ return this.tokens.get(0);
+ }
+
+ /**
+ * Returns the command of the command line, assuming that the first entry is
+ * always the command.
+ *
+ * @return The command or null if the command lines has no command nor
+ * arguments.
+ * @param fullEscape
+ * If every special character shall be escaped. If false, only
+ * white spaces are escaped and the shell will interpret the
+ * special chars. If true, then all special chars are quoted.
+ */
+ public String getEscapedCommand(boolean fullEscape) {
+ if (this.tokens.size() == 0) {
+ return null;
+ }
+ return escapeToken(this.tokens.get(0), fullEscape).toString();
+ }
+
+ /**
+ * Returns a list of all arguments, assuming that the first entry is the
+ * command name.
+ *
+ * @return The Array or null if the command lines has no command nor
+ * arguments.
+ */
+ public String[] getParameterArray() {
+ if (this.tokens.size() == 0) {
+ return null;
+ }
+ return this.tokens.subList(1, this.tokens.size()).toArray(new String[this.tokens.size() - 1]);
+ }
+
+ /**
+ * Returns a list of all arguments, assuming that the first entry is the
+ * command name.
+ *
+ * @return The List or null if the command lines has no command nor
+ * arguments.
+ */
+ public List getParameterList() {
+ if (this.tokens.size() == 0) {
+ return null;
+ }
+ return new ArrayList(this.tokens.subList(1, this.tokens.size()));
+ }
+
+ /**
+ * Returns the total number of entries.
+ *
+ * @return the total number of entries
+ */
+ public int getSize() {
+ return this.tokens.size();
+ }
+
+ /**
+ * Returns a representation of the command line for debug purposes.
+ */
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<"); //$NON-NLS-1$
+ Iterator iterator = this.tokens.iterator();
+ boolean first = true;
+ while (iterator.hasNext()) {
+ String token = iterator.next();
+ if (!first) {
+ buffer.append('\n');
+ } else {
+ first = false;
+ }
+ buffer.append(token);
+ }
+ buffer.append(">"); //$NON-NLS-1$
+ return buffer.toString();
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnectionManager.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnectionManager.java
new file mode 100644
index 00000000000..93279eadf3b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnectionManager.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2015,2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.remote.core.IRemoteCommandShellService;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteProcess;
+import org.eclipse.remote.core.IRemoteProcessBuilder;
+import org.eclipse.remote.core.IRemoteProcessService;
+import org.eclipse.remote.core.IRemoteProcessTerminalService;
+import org.eclipse.remote.core.IRemoteServicesManager;
+import org.eclipse.remote.core.exception.RemoteConnectionException;
+import org.eclipse.tm.internal.terminal.emulator.VT100Emulator;
+import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.terminal.connector.remote.IRemoteTerminalConstants;
+import org.eclipse.tm.terminal.connector.remote.IRemoteTerminalParser;
+import org.eclipse.tm.terminal.connector.remote.nls.Messages;
+
+@SuppressWarnings("restriction")
+public class RemoteConnectionManager extends Job {
+ private final static String PARSERS_EXTENSION_POINT = "parsers"; //$NON-NLS-1$
+ private final static String PARSER_ELEMENT = "parser"; //$NON-NLS-1$
+
+ private static int fgNo;
+
+ private final ITerminalControl control;
+ private final RemoteConnector connector;
+
+ private IRemoteTerminalParser parser;
+ private IRemoteProcess remoteProcess;
+
+ protected RemoteConnectionManager(RemoteConnector conn, ITerminalControl control) {
+ super("Remote Terminal-" + fgNo++); //$NON-NLS-1$
+ this.control = control;
+ this.connector = conn;
+ setSystem(true);
+ loadParserExtension();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IRemoteConnection remoteConnection = null;
+
+ try {
+ IRemoteServicesManager svcMgr = Activator.getService(IRemoteServicesManager.class);
+ String connTypeId = connector.getRemoteSettings().getConnectionTypeId();
+ IRemoteConnectionType connType = svcMgr.getConnectionType(connTypeId);
+ if (connType != null) {
+ remoteConnection = connType.getConnection(connector.getRemoteSettings().getConnectionName());
+ }
+ if (remoteConnection == null) {
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(),
+ NLS.bind(Messages.RemoteConnectionManager_0, connector.getRemoteSettings().getConnectionName()));
+ }
+
+ if (!remoteConnection.isOpen()) {
+ remoteConnection.open(monitor);
+ if (!remoteConnection.isOpen()) {
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(),
+ NLS.bind(Messages.RemoteConnectionManager_1, connector.getRemoteSettings().getConnectionName()));
+ }
+ }
+
+ if (parser != null) {
+ remoteProcess = parser.initialize(remoteConnection);
+ }
+
+ if (remoteProcess == null) {
+ /*
+ * Check the terminal shell command preference. If the preference is empty and we support a command shell,
+ * just use that. Otherwise use the preference value if it is set, or fall back to a default if not.
+ */
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(Activator.getUniqueIdentifier());
+ String terminalShellCommand = prefs.get(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, ""); //$NON-NLS-1$
+ if ("".equals(terminalShellCommand) //$NON-NLS-1$
+ && remoteConnection.hasService(IRemoteCommandShellService.class)) {
+ IRemoteCommandShellService cmdShellSvc = remoteConnection.getService(IRemoteCommandShellService.class);
+ synchronized (this) {
+ remoteProcess = cmdShellSvc.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
+ }
+ } else if (remoteConnection.hasService(IRemoteProcessService.class)) {
+ if ("".equals(terminalShellCommand)) { //$NON-NLS-1$
+ terminalShellCommand = "/bin/bash -l"; //$NON-NLS-1$
+ }
+ IRemoteProcessService procSvc = remoteConnection.getService(IRemoteProcessService.class);
+ IRemoteProcessBuilder processBuilder = procSvc
+ .getProcessBuilder(new ArgumentParser(terminalShellCommand).getTokenList());
+ remoteProcess = processBuilder.start(IRemoteProcessBuilder.ALLOCATE_PTY);
+ } else {
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), Messages.RemoteConnectionManager_2);
+ }
+ }
+
+ control.setVT100LineWrapping(true);
+ connector.setInputStream(remoteProcess.getInputStream());
+ control.setState(TerminalState.CONNECTED);
+ control.setTerminalTitle(remoteConnection.getName());
+ connector.setOutputStream(remoteProcess.getOutputStream());
+ // Initialize terminal size
+ VT100Emulator text = ((VT100TerminalControl) control).getTerminalText();
+ text.fontChanged();
+
+ // read data until the connection gets terminated
+ readData(connector.getInputStream());
+ } catch (IOException e) {
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getMessage());
+ } catch (RemoteConnectionException e) {
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getMessage());
+ } finally {
+ // make sure the terminal is disconnected when the thread ends
+ connector.disconnect();
+ }
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ protected void canceling() {
+ super.canceling();
+ synchronized (this) {
+ if (remoteProcess != null && !remoteProcess.isCompleted()) {
+ remoteProcess.destroy();
+ }
+ }
+ }
+
+ public void setTerminalSize(int cols, int rows, int width, int height) {
+ if (remoteProcess != null) {
+ IRemoteProcessTerminalService termSvc = remoteProcess.getService(IRemoteProcessTerminalService.class);
+ if (termSvc != null) {
+ termSvc.setTerminalSize(cols, rows, width, height);
+ }
+ }
+ }
+
+ /**
+ * Read the data from the connection and display it in the terminal.
+ *
+ * @param in
+ * @throws IOException
+ */
+ private void readData(InputStream in) throws IOException {
+ byte[] buf = new byte[32 * 1024];
+ int n;
+ while ((n = in.read(buf, 0, buf.length)) >= 0) {
+ if (n != 0 && (parser == null || parser.parse(buf))) {
+ control.getRemoteToTerminalOutputStream().write(buf, 0, n);
+ }
+ }
+ }
+
+ private void loadParserExtension() {
+ IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(Activator.getUniqueIdentifier(),
+ PARSERS_EXTENSION_POINT);
+ if (point != null) {
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for (IConfigurationElement element : elements) {
+ if (PARSER_ELEMENT.equals(element.getName())) {
+ try {
+ parser = (IRemoteTerminalParser) element.createExecutableExtension("class"); //$NON-NLS-1$
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnector.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnector.java
new file mode 100644
index 00000000000..18b3ec59acc
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteConnector.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.NullSettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
+import org.eclipse.tm.terminal.connector.remote.IRemoteSettings;
+
+@SuppressWarnings("restriction")
+public class RemoteConnector extends TerminalConnectorImpl {
+ private OutputStream fOutputStream;
+ private InputStream fInputStream;
+ private RemoteConnectionManager fConnection;
+ private int fWidth;
+ private int fHeight;
+ private final RemoteSettings fSettings;
+
+ public RemoteConnector() {
+ this(new RemoteSettings());
+ }
+
+ public RemoteConnector(RemoteSettings settings) {
+ fSettings = settings;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#connect(org.eclipse.tm.internal.terminal.
+ * provisional.api.ITerminalControl)
+ */
+ @Override
+ public void connect(ITerminalControl control) {
+ super.connect(control);
+ fControl.setState(TerminalState.CONNECTING);
+ fConnection = new RemoteConnectionManager(this, control);
+ fConnection.schedule();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#doDisconnect()
+ */
+ @Override
+ public synchronized void doDisconnect() {
+ fConnection.cancel();
+ }
+
+ public InputStream getInputStream() {
+ return fInputStream;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getSettingsSummary()
+ */
+ @Override
+ public String getSettingsSummary() {
+ return fSettings.getSummary();
+ }
+
+ /**
+ * Return the Remote Settings.
+ *
+ * @return the settings for a concrete connection.
+ */
+ public IRemoteSettings getRemoteSettings() {
+ return fSettings;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getTerminalToRemoteStream()
+ */
+ @Override
+ public OutputStream getTerminalToRemoteStream() {
+ return fOutputStream;
+ }
+
+ @Override
+ public void load(ISettingsStore store) {
+ fSettings.load(store);
+ }
+
+ @Override
+ public void setDefaultSettings() {
+ fSettings.load(new NullSettingsStore());
+ }
+
+ @Override
+ public void save(ISettingsStore store) {
+ fSettings.save(store);
+ }
+
+ public void setInputStream(InputStream inputStream) {
+ fInputStream = inputStream;
+ }
+
+ public void setOutputStream(OutputStream outputStream) {
+ fOutputStream = outputStream;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#setTerminalSize(int, int)
+ */
+ @Override
+ public void setTerminalSize(int newWidth, int newHeight) {
+ if (fConnection != null && (newWidth != fWidth || newHeight != fHeight)) {
+ // avoid excessive communications due to change size requests by caching previous size
+ fConnection.setTerminalSize(newWidth, newHeight, 8 * newWidth, 8 * newHeight);
+ fWidth = newWidth;
+ fHeight = newHeight;
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettings.java
new file mode 100644
index 00000000000..37dae29bf91
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettings.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.terminal.connector.remote.IRemoteSettings;
+
+@SuppressWarnings("restriction")
+public class RemoteSettings implements IRemoteSettings {
+ protected String connectionTypeId;
+ protected String connectionName;
+
+ public RemoteSettings() {
+ }
+
+ @Override
+ public String getConnectionName() {
+ return connectionName;
+ }
+
+ @Override
+ public String getConnectionTypeId() {
+ return connectionTypeId;
+ }
+
+ public String getSummary() {
+ return "Remote:" + getConnectionTypeId() + '_' + getConnectionName(); //$NON-NLS-1$
+ }
+
+ @Override
+ public String toString() {
+ return getSummary();
+ }
+
+ /**
+ * Load information into the RemoteSettings object.
+ */
+ public void load(ISettingsStore store) {
+ connectionTypeId = store.get(CONNECTION_TYPE_ID, ""); //$NON-NLS-1$
+ connectionName = store.get(CONNECTION_NAME, ""); //$NON-NLS-1$
+ }
+
+ /**
+ * Extract information from the RemoteSettings object.
+ */
+ public void save(ISettingsStore store) {
+ store.put(CONNECTION_TYPE_ID, connectionTypeId);
+ store.put(CONNECTION_NAME, connectionName);
+ }
+
+ public void setConnectionName(String name) {
+ connectionName = name;
+ }
+
+ public void setConnectionTypeId(String id) {
+ connectionTypeId = id;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettingsPage.java
new file mode 100644
index 00000000000..8a5958027da
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/RemoteSettingsPage.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2015,2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal;
+
+import java.util.List;
+
+import org.eclipse.remote.core.IRemoteCommandShellService;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteServicesManager;
+import org.eclipse.remote.ui.widgets.RemoteConnectionWidget;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+@SuppressWarnings("restriction")
+public class RemoteSettingsPage extends AbstractSettingsPage {
+ private final RemoteSettings fTerminalSettings;
+ private RemoteConnectionWidget fRemoteConnectionWidget;
+
+ public RemoteSettingsPage(RemoteSettings settings) {
+ fTerminalSettings = settings;
+ }
+
+ @Override
+ public void saveSettings() {
+ if (fTerminalSettings != null && fRemoteConnectionWidget != null && !fRemoteConnectionWidget.isDisposed()) {
+ if (fRemoteConnectionWidget.getConnection() != null) {
+ if (fRemoteConnectionWidget.getConnection().getConnectionType() != null) {
+ fTerminalSettings.setConnectionTypeId(fRemoteConnectionWidget.getConnection().getConnectionType().getId());
+ }
+ fTerminalSettings.setConnectionName(fRemoteConnectionWidget.getConnection().getName());
+ }
+ }
+ }
+
+ @Override
+ public void loadSettings() {
+ if (fTerminalSettings != null && fRemoteConnectionWidget != null && !fRemoteConnectionWidget.isDisposed()) {
+ fRemoteConnectionWidget.setConnection(fTerminalSettings.getConnectionTypeId(), fTerminalSettings.getConnectionName());
+ }
+ }
+
+ String get(String value, String def) {
+ if (value == null || value.length() == 0) {
+ return def;
+ }
+ return value;
+ }
+
+ @Override
+ public boolean validateSettings() {
+ if (fRemoteConnectionWidget == null || fRemoteConnectionWidget.isDisposed()
+ || fRemoteConnectionWidget.getConnection() == null) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+
+ composite.setLayout(gridLayout);
+ composite.setLayoutData(gridData);
+
+ BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
+ ServiceReference ref = context.getServiceReference(IRemoteServicesManager.class);
+ IRemoteServicesManager manager = context.getService(ref);
+ @SuppressWarnings("unchecked")
+ List types = manager.getConnectionTypesSupporting(IRemoteCommandShellService.class);
+
+ fRemoteConnectionWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0, types);
+ fRemoteConnectionWidget.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fireListeners(fRemoteConnectionWidget);
+ }
+ });
+ loadSettings();
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferenceInitializer.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferenceInitializer.java
new file mode 100644
index 00000000000..d8a159c8e47
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferenceInitializer.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.tm.terminal.connector.remote.IRemoteTerminalConstants;
+import org.eclipse.tm.terminal.connector.remote.internal.Activator;
+
+public class RemoteTerminalPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ public RemoteTerminalPreferenceInitializer() {
+ }
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences defaultPrefs = DefaultScope.INSTANCE.getNode(Activator.getUniqueIdentifier());
+ defaultPrefs.put(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, ""); //$NON-NLS-1$
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferencePage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferencePage.java
new file mode 100644
index 00000000000..615611aedfd
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/internal/preferences/RemoteTerminalPreferencePage.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tm.terminal.connector.remote.IRemoteTerminalConstants;
+import org.eclipse.tm.terminal.connector.remote.internal.Activator;
+import org.eclipse.tm.terminal.connector.remote.nls.Messages;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+public class RemoteTerminalPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ @Override
+ protected void createFieldEditors() {
+ Composite parent = getFieldEditorParent();
+ addField(new StringFieldEditor(IRemoteTerminalConstants.PREF_TERMINAL_TYPE, "Terminal Type", parent));
+ addField(new StringFieldEditor(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND,
+ Messages.RemoteTerminalPreferencePage_0, parent));
+ }
+
+ @Override
+ public IPreferenceStore doGetPreferenceStore() {
+ return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.getUniqueIdentifier());
+ }
+
+ @Override
+ public void init(IWorkbench workbench) {
+ // Nothing
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteLauncherDelegate.java
new file mode 100644
index 00000000000..32fb70edb39
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteLauncherDelegate.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2015,2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.launcher;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteServicesManager;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.connector.remote.IRemoteSettings;
+import org.eclipse.tm.terminal.connector.remote.controls.RemoteWizardConfigurationPanel;
+import org.eclipse.tm.terminal.connector.remote.internal.Activator;
+import org.eclipse.tm.terminal.connector.remote.internal.RemoteSettings;
+import org.eclipse.tm.terminal.connector.remote.nls.Messages;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+
+/**
+ * Remote launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class RemoteLauncherDelegate extends AbstractLauncherDelegate {
+ // The Remote terminal connection memento handler
+ private final IMementoHandler mementoHandler = new RemoteMementoHandler();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#getPanel(org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new RemoteWizardConfigurationPanel(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map properties, ITerminalService.Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String terminalTitle = getTerminalTitle(properties);
+ if (terminalTitle != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
+ }
+
+ // Force a new terminal tab each time it is launched, if not set otherwise from outside
+ // TODO need a command shell service routing to get this
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /**
+ * Returns the terminal title string.
+ *
+ * The default implementation constructs a title like "SSH @ host (Start time) ".
+ *
+ * @return The terminal title string or null.
+ */
+ private String getTerminalTitle(Map properties) {
+ // Try to see if the user set a title explicitly via the properties map.
+ String title = getDefaultTerminalTitle(properties);
+ if (title != null) return title;
+
+ String connection = (String) properties.get(IRemoteSettings.CONNECTION_NAME);
+
+ if (connection != null) {
+ DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
+ String date = format.format(new Date(System.currentTimeMillis()));
+ return NLS.bind(Messages.RemoteLauncherDelegate_terminalTitle, new String[] { connection, date });
+ }
+
+ return Messages.RemoteLauncherDelegate_terminalTitle_default;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IMementoHandler.class.equals(adapter)) {
+ return mementoHandler;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String) properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) {
+ connectorId = "org.eclipse.tm.terminal.connector.remote.RemoteConnector"; //$NON-NLS-1$
+ }
+
+ // Extract the remote properties
+ String connTypeId = (String) properties.get(IRemoteSettings.CONNECTION_TYPE_ID);
+ String connName = (String) properties.get(IRemoteSettings.CONNECTION_NAME);
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the remote settings
+ RemoteSettings remoteSettings = new RemoteSettings();
+ remoteSettings.setConnectionTypeId(connTypeId);
+ remoteSettings.setConnectionName(connName);
+ // And save the settings to the store
+ remoteSettings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_ENCODING)) {
+ IRemoteServicesManager svcMgr = Activator.getService(IRemoteServicesManager.class);
+
+ IRemoteConnectionType connType = svcMgr.getConnectionType(connTypeId);
+ if (connType != null) {
+ IRemoteConnection remoteConnection = connType.getConnection(connName);
+ if (remoteConnection != null && remoteConnection.isOpen()) {
+ properties.put(ITerminalsConnectorConstants.PROP_ENCODING,
+ remoteConnection.getProperty(IRemoteConnection.LOCALE_CHARMAP_PROPERTY));
+ }
+ }
+ }
+
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, "/tmp"); //$NON-NLS-1$
+
+ return connector;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteMementoHandler.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteMementoHandler.java
new file mode 100644
index 00000000000..9b478cbc5c1
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/launcher/RemoteMementoHandler.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.launcher;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.terminal.connector.remote.IRemoteSettings;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Telnet terminal connection memento handler implementation.
+ */
+public class RemoteMementoHandler implements IMementoHandler {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void saveState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Do not write the terminal title to the memento -> needs to
+ // be recreated at the time of restoration.
+ memento.putString(IRemoteSettings.CONNECTION_NAME, (String) properties.get(IRemoteSettings.CONNECTION_NAME));
+ memento.putString(IRemoteSettings.CONNECTION_TYPE_ID, (String) properties.get(IRemoteSettings.CONNECTION_TYPE_ID));
+ memento.putString(ITerminalsConnectorConstants.PROP_ENCODING,
+ (String) properties.get(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#restoreState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void restoreState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Restore the terminal properties from the memento
+ properties.put(IRemoteSettings.CONNECTION_NAME, memento.getString(IRemoteSettings.CONNECTION_NAME));
+ properties.put(IRemoteSettings.CONNECTION_TYPE_ID, memento.getString(IRemoteSettings.CONNECTION_TYPE_ID));
+ properties.put(ITerminalsConnectorConstants.PROP_ENCODING, memento.getString(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.java
new file mode 100644
index 00000000000..5a209c22383
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.remote.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tm.terminal.connector.remote.nls.Messages"; //$NON-NLS-1$
+
+ public static String RemoteConnectionManager_0;
+
+ public static String RemoteConnectionManager_1;
+
+ public static String RemoteConnectionManager_2;
+
+ public static String RemoteTerminalPreferencePage_0;
+
+ public static String TERMINAL_EXCEPTION;
+
+ public static String RemoteLauncherDelegate_terminalTitle;
+ public static String RemoteLauncherDelegate_terminalTitle_default;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.properties
new file mode 100644
index 00000000000..35df892f056
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/nls/Messages.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2015, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+RemoteConnectionManager_0=Unable to create connection: {0}
+RemoteConnectionManager_1=Unable to to open connection: {0}
+RemoteConnectionManager_2=Connection type does not support the required services
+RemoteTerminalPreferencePage_0=Initial Shell Command
+TERMINAL_EXCEPTION=Remote Terminal Exception
+
+RemoteLauncherDelegate_terminalTitle={0} ({1})
+RemoteLauncherDelegate_terminalTitle_default=Remote Terminal
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.options b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.options
new file mode 100644
index 00000000000..8ec18dafab2
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.options
@@ -0,0 +1 @@
+org.eclipse.tm.terminal.connector.ssh/debugmode = 0
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.project
new file mode 100644
index 00000000000..be963dbfb21
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.project
@@ -0,0 +1,45 @@
+
+
+ org.eclipse.tm.terminal.connector.ssh
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
+
+ 1329502091181
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..4754bba05f6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Wed Oct 19 12:10:57 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0d732269684
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.pde.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000000..cf80c8bc5b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..983b7c46c0b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.ssh;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Activator: org.eclipse.tm.terminal.connector.ssh.activator.UIPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.equinox.security;bundle-version="1.1.100",
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.control;bundle-version="4.5.0",
+ org.eclipse.ui;bundle-version="3.8.0",
+ com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)",
+ org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tm.terminal.connector.ssh.activator;x-internal:=true,
+ org.eclipse.tm.terminal.connector.ssh.connector,
+ org.eclipse.tm.terminal.connector.ssh.controls,
+ org.eclipse.tm.terminal.connector.ssh.launcher,
+ org.eclipse.tm.terminal.connector.ssh.nls;x-internal:=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/about.html
new file mode 100644
index 00000000000..fe4ae3f5b94
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
May 24, 2012
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/build.properties
new file mode 100644
index 00000000000..1c3465df7d0
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/build.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.properties
new file mode 100644
index 00000000000..8cbdd29dbcc
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.properties
@@ -0,0 +1,22 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Terminal SSH Connector
+providerName = Eclipse.org - Target Management
+
+# ----- Terminal Connector -----
+
+SshConnector.label=SSH
+
+# ----- Terminal Launcher Delegates -----
+
+SshLauncherDelegate.label=SSH Terminal
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.xml
new file mode 100644
index 00000000000..5c9ea94f3c4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/plugin.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/pom.xml
new file mode 100644
index 00000000000..ee95330809b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.ssh
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/activator/UIPlugin.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/activator/UIPlugin.java
new file mode 100644
index 00000000000..45b7e429d76
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/activator/UIPlugin.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.activator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jsch.core.IJSchService;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tm.terminal.connector.ssh.connector.SshConnection;
+import org.eclipse.tm.terminal.view.core.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ // ServiceTracker for IJschService
+ private ServiceTracker tracker;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tm.terminal.connector.ssh"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ //---------------------------------------------------------------------------
+ //
+ //---------------------------------------------------------------------------
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null);
+ tracker.open();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ try {
+ SshConnection.shutdown();
+ tracker.close();
+ } finally {
+ plugin = null;
+ super.stop(context);
+ }
+ }
+
+ /**
+ * Returns an instance of IJSchService from the OSGi Registry.
+ * @return An instance of IJSchService, or null if no
+ * IJschService service is available.
+ */
+ public IJSchService getJSchService() {
+ return (IJSchService)tracker.getService();
+ }
+
+ //---------------------------------------------------------------------------
+ //
+ //---------------------------------------------------------------------------
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the Image object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The Image object instance or null.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the ImageDescriptor object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The ImageDescriptor object instance or null.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshConstants.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshConstants.java
new file mode 100644
index 00000000000..2bcc30b4681
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshConstants.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Martin Oberhuber (Wind River) - extracted from various team.cvs plugins
+ * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+
+/**
+ * Defines the constants used by the terminal.ssh Plugin
+ */
+public interface ISshConstants {
+
+ // These are from cvs.ui.IHelpContextIds
+ public static final String CVSUIPREFIX = "org.eclipse.team.cvs.ui."; //$NON-NLS-1$
+ public static final String HELP_USER_VALIDATION_DIALOG = CVSUIPREFIX + "user_validation_dialog_context"; //$NON-NLS-1$
+ public static final String HELP_KEYBOARD_INTERACTIVE_DIALOG = CVSUIPREFIX + "keyboard_interactive_dialog_context"; //$NON-NLS-1$
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshSettings.java
new file mode 100644
index 00000000000..939addb8116
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/ISshSettings.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+
+public interface ISshSettings {
+
+ public static int DEFAULT_SSH_PORT = 22;
+
+ /**
+ * Get the host name or IP address of remote system to connect.
+ * @return host name or IP address of the remote system.
+ */
+ String getHost();
+
+ /**
+ * Get the login name for connecting to the remote system.
+ * @return remote login name
+ */
+ String getUser();
+
+ /**
+ * Get the password for connecting to the remote system.
+ * May be empty if connecting via SSH public key authentication
+ * (with or without passphrase).
+ * @return password to use
+ */
+ String getPassword();
+
+ /**
+ * Get the timeout (in seconds) after which the SSH connection is assumed dead.
+ * @return timeout (in seconds) for the SSH connection.
+ */
+ int getTimeout();
+
+ /**
+ * Get the keepalive interval (in seconds).
+ * After this time of inactivity, the SSH connector will send a message to the
+ * remote system in order to avoid timeouts on the remote. A maximum of 6
+ * keepalive messages will be sent if enabled. When set to 0, the keepalive
+ * feature is disabled.
+ * @return interval (in seconds) for keepalive messages.
+ */
+ int getKeepalive();
+
+ /**
+ * Get the TCP/IP port on the remote system to use.
+ * @return TCP/IP port on the remote system to use.
+ */
+ int getPort();
+
+ /**
+ * Return a human-readable String summarizing all relevant connection data.
+ * This String can be displayed in the Terminal caption, for instance.
+ * @return a human-readable String summarizing relevant connection data.
+ */
+ String getSummary();
+
+ /**
+ * Load connection data from a settings store.
+ * @param store the settings store to access.
+ */
+ void load(ISettingsStore store);
+
+ /**
+ * Store connection data into a settings store.
+ * @param store the settings store to access.
+ */
+ void save(ISettingsStore store);
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/KeyboardInteractiveDialog.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/KeyboardInteractiveDialog.java
new file mode 100644
index 00000000000..8e45799ff72
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/KeyboardInteractiveDialog.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation.
+ * IBM Corporation - ongoing maintenance
+ * Martin Oberhuber (Wind River) - copied and adapted from team.cvs.ui
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * A dialog for keyboad-interactive authentication for the ssh2 connection.
+ */
+public class KeyboardInteractiveDialog extends TrayDialog {
+ // widgets
+ private Text[] texts;
+
+ protected String domain;
+ protected String destination;
+ protected String name;
+ protected String instruction;
+ protected String lang;
+ protected String[] prompt;
+ protected boolean[] echo;
+ private String message;
+ private String[] result;
+
+ /**
+ * Creates a nwe KeyboardInteractiveDialog.
+ *
+ * @param parentShell the parent shell
+ * @param connectionId an id for the connection
+ * @param destination the location
+ * @param name the name
+ * @param instruction the instruction
+ * @param prompt the titles for textfields
+ * @param echo '*' should be used or not
+ */
+ public KeyboardInteractiveDialog(Shell parentShell,
+ String connectionId,
+ String destination,
+ String name,
+ String instruction,
+ String[] prompt,
+ boolean[] echo){
+ super(parentShell);
+ this.domain=connectionId;
+ this.destination=destination;
+ this.name=name;
+ this.instruction=instruction;
+ this.prompt=prompt;
+ this.echo=echo;
+ this.message=NLS.bind(SshMessages.KeyboardInteractiveDialog_message, new String[] { destination+(name!=null && name.length()>0 ? ": "+name : "") }); //NON-NLS-1$ //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ /**
+ * @see Window#configureShell
+ */
+ @Override
+protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(message);
+ }
+ /**
+ * @see Window#create
+ */
+ @Override
+public void create() {
+ super.create();
+ if(texts.length>0){
+ texts[0].setFocus();
+ }
+ }
+ /**
+ * @see Dialog#createDialogArea
+ */
+ @Override
+protected Control createDialogArea(Composite parent) {
+ Composite main=new Composite(parent, SWT.NONE);
+ GridLayout layout=new GridLayout();
+ layout.numColumns=3;
+ main.setLayout(layout);
+ main.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // set F1 help
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(main, ISshConstants.HELP_KEYBOARD_INTERACTIVE_DIALOG);
+
+ if (message!=null) {
+ Label messageLabel=new Label(main, SWT.WRAP);
+ messageLabel.setText(message);
+ GridData data=new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan=3;
+ messageLabel.setLayoutData(data);
+ }
+ if(domain!=null){
+ Label label = new Label(main, SWT.WRAP);
+ label.setText(NLS.bind(SshMessages.KeyboardInteractiveDialog_labelConnection, new String[] { domain }));
+ GridData data=new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan=3;
+ label.setLayoutData(data);
+ }
+ if (instruction!=null && instruction.length()>0) {
+ Label messageLabel=new Label(main, SWT.WRAP);
+ messageLabel.setText(instruction);
+ GridData data=new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan=3;
+ messageLabel.setLayoutData(data);
+ }
+ createPasswordFields(main);
+ return main;
+ }
+ /**
+ * Creates the widgets that represent the entry area.
+ *
+ * @param parent the parent of the widgets
+ */
+ @SuppressWarnings("unused")
+protected void createPasswordFields(Composite parent) {
+ texts=new Text[prompt.length];
+
+ for(int i=0; i
+ * The default implementation of this framework method sets
+ * this dialog's return code to Window.OK
+ * and closes the dialog. Subclasses may override.
+ *
+ */
+ @Override
+protected void okPressed() {
+ result=new String[prompt.length];
+ for(int i=0; i
+ * The default implementation of this framework method sets
+ * this dialog's return code to Window.CANCEL
+ * and closes the dialog. Subclasses may override.
+ *
+ */
+ @Override
+protected void cancelPressed() {
+ result=null;
+ super.cancelPressed();
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnection.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnection.java
new file mode 100644
index 00000000000..954b76aa4ba
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnection.java
@@ -0,0 +1,373 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2015 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API
+ * - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM)
+ * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected
+ * Mikhail Kalugin - [201864] Fix Terminal SSH keyboard interactive authentication
+ * Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection
+ * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+ * Martin Oberhuber (Wind River) - [225792] Rename SshConnector.getTelnetSettings() to getSshSettings()
+ * Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox
+ * Martin Oberhuber (Wind River) - [205674][ssh] Terminal remains "connecting" when authentication is cancelled
+ * Michael Scharf (Wind River) - 240420: [terminal][ssh]Channel is not closed when the connection is closed with the close button
+ * Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting
+ * Andrei Sobolev (Xored) - [250456] Ssh banner message causes IllegalArgumentException popup
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InterruptedIOException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jsch.core.IJSchService;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.terminal.connector.ssh.activator.UIPlugin;
+
+import com.jcraft.jsch.ChannelShell;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.UIKeyboardInteractive;
+import com.jcraft.jsch.UserInfo;
+
+public class SshConnection extends Thread {
+ private static int fgNo;
+ /* default */ final ITerminalControl fControl;
+ private final SshConnector fConn;
+ private Session fSession;
+ private boolean fDisconnectHasBeenCalled;
+ protected SshConnection(SshConnector conn,ITerminalControl control) {
+ super("SshConnection-"+fgNo++); //$NON-NLS-1$
+ fControl = control;
+ fConn = conn;
+ fControl.setState(TerminalState.CONNECTING);
+ }
+
+ //----------------------------------------------------------------------
+ //
+ //----------------------------------------------------------------------
+
+ /**
+ * Create a Jsch session.
+ * Subclasses can override in order to replace the UserInfo wrapper
+ * (for non-interactive usage, for instance), or in order to change
+ * the Jsch config (for instance, in order to switch off strict
+ * host key checking or in order to add specific ciphers).
+ */
+ protected Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException {
+ IJSchService service = UIPlugin.getDefault().getJSchService();
+ if (service == null)
+ return null;
+ Session session = service.createSession(hostname, port, username);
+ //session.setTimeout(getSshTimeoutInMillis());
+ session.setTimeout(0); //never time out on the session
+ session.setServerAliveCountMax(6); //give up after 6 tries (remote will be dead after 30 min)
+ if (password != null)
+ session.setPassword(password);
+ session.setUserInfo(wrapperUI);
+ return session;
+ }
+
+ public static void shutdown() {
+ //TODO: Store all Jsch sessions in a pool and disconnect them on shutdown
+ }
+
+ //----------------------------------------------------------------------
+ //
+ //----------------------------------------------------------------------
+
+ @Override
+ public void run() {
+ boolean connectSucceeded = false;
+ String host = ""; //$NON-NLS-1$
+ int port = ISshSettings.DEFAULT_SSH_PORT;
+ try {
+ int nTimeout = fConn.getSshSettings().getTimeout() * 1000;
+ int nKeepalive = fConn.getSshSettings().getKeepalive() * 1000;
+ host = fConn.getSshSettings().getHost();
+ String user = fConn.getSshSettings().getUser();
+ String password = fConn.getSshSettings().getPassword();
+ port = fConn.getSshSettings().getPort();
+
+ UserInfo ui=new MyUserInfo(null, user, password);
+
+ Session session = createSession(user, password, host, port,
+ ui, new NullProgressMonitor());
+ synchronized (this) {
+ fSession = session;
+ }
+
+ //java.util.Hashtable config=new java.util.Hashtable();
+ //config.put("StrictHostKeyChecking", "no");
+ //session.setConfig(config);
+ //ui.aboutToConnect();
+ if (nKeepalive > 0) {
+ session.setServerAliveInterval(nKeepalive); //default is 5 minutes
+ }
+ // dont try to connect if disconnect has been requested already
+ synchronized (this) {
+ if (fDisconnectHasBeenCalled)
+ return;
+ }
+
+ session.connect(nTimeout); // making connection with timeout.
+ // if we got disconnected, do not continue
+ if(!isSessionConnected())
+ return;
+ ChannelShell channel=(ChannelShell) session.openChannel("shell"); //$NON-NLS-1$
+ channel.setPtyType("xterm"); //$NON-NLS-1$
+ // TERM=xterm implies VT100 line wrapping mode
+ fControl.setVT100LineWrapping(true);
+ channel.connect();
+
+ // maybe the terminal was disconnected while we were connecting
+ if (isSessionConnected() && channel.isConnected()) {
+ connectSucceeded = true;
+ fConn.setInputStream(channel.getInputStream());
+ fConn.setOutputStream(channel.getOutputStream());
+ fConn.setChannel(channel);
+ fControl.setState(TerminalState.CONNECTED);
+ try {
+ // read data until the connection gets terminated
+ readDataForever(fConn.getInputStream());
+ } catch (InterruptedIOException e) {
+ // we got interrupted: we are done...
+ }
+ }
+ } catch (Exception e) {
+ Throwable cause = e;
+ while (cause.getCause() != null) {
+ cause = cause.getCause();
+ }
+ String origMsg = cause.getMessage();
+ String msg = SshMessages.getMessageFor(cause);
+ if ((cause instanceof JSchException) && origMsg != null && origMsg.startsWith("Auth")) { //$NON-NLS-1$
+ if (origMsg.indexOf("cancel") >= 0) { //$NON-NLS-1$
+ msg = SshMessages.SSH_AUTH_CANCEL;
+ } else if (origMsg.indexOf("fail") >= 0) { //$NON-NLS-1$
+ msg = SshMessages.SSH_AUTH_FAIL;
+ }
+ }
+ if (!connectSucceeded) {
+ String hostPort = host;
+ if (port != ISshSettings.DEFAULT_SSH_PORT) {
+ hostPort = hostPort + ':' + port;
+ }
+ msg = NLS.bind(SshMessages.ERROR_CONNECTING, hostPort, msg);
+ }
+ connectFailed(msg, msg);
+ } finally {
+ // make sure the terminal is disconnected when the thread ends
+ try {
+ disconnect();
+ } finally {
+ // when reading is done, we set the state to closed
+ fControl.setState(TerminalState.CLOSED);
+ }
+ }
+ }
+
+ /* default */ synchronized boolean isSessionConnected() {
+ return !fDisconnectHasBeenCalled && fSession != null && fSession.isConnected();
+ }
+
+ /**
+ * disconnect the ssh session
+ */
+ void disconnect() {
+ interrupt();
+ synchronized (this) {
+ fDisconnectHasBeenCalled=true;
+ if(fSession!=null) {
+ try {
+ fSession.disconnect();
+ } catch (Exception e) {
+ // Ignore NPE due to bug in JSch if disconnecting
+ // while not yet authenticated
+ }
+ fSession=null;
+ }
+ }
+ }
+ /**
+ * Read the data from the ssh connection and display it in the terminal.
+ * @param in
+ * @throws IOException
+ */
+ private void readDataForever(InputStream in) throws IOException {
+ // read the data
+ byte bytes[]=new byte[32*1024];
+ int n;
+ // read until the thread gets interrupted....
+ while( (n=in.read(bytes))!=-1) {
+ fControl.getRemoteToTerminalOutputStream().write(bytes,0,n);
+ }
+ }
+
+ protected static Display getStandardDisplay() {
+ Display display = Display.getCurrent();
+ if( display==null ) {
+ display = Display.getDefault();
+ }
+ return display;
+ }
+
+ private class MyUserInfo implements UserInfo, UIKeyboardInteractive {
+ /* default */ final String fConnectionId;
+ /* default */ final String fUser;
+ private String fPassword;
+ private String fPassphrase;
+ private int fAttemptCount;
+
+ public MyUserInfo(String connectionId, String user, String password) {
+ fConnectionId = connectionId;
+ fUser = user;
+ fPassword = password;
+ }
+ @Override
+ public String getPassword() {
+ return fPassword;
+ }
+ @Override
+ public boolean promptYesNo(final String str) {
+ //need to switch to UI thread for prompting
+ final boolean[] retval = new boolean[1];
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ // [168197] Replace JFace MessagDialog by SWT MessageBox
+ //retval[0] = MessageDialog.openQuestion(null, SshMessages.WARNING, str);
+ if (isSessionConnected()) {
+ MessageBox mb = new MessageBox(fControl.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
+ mb.setText(SshMessages.WARNING);
+ mb.setMessage(str);
+ retval[0] = (mb.open() == SWT.YES);
+ } else {
+ retval[0] = false;
+ }
+ }
+ });
+ return retval[0];
+ }
+ private String promptSecret(final String message) {
+ final String[] retval = new String[1];
+ getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isSessionConnected()) {
+ UserValidationDialog uvd = new UserValidationDialog(null, fConnectionId, fUser, message);
+ uvd.setUsernameMutable(false);
+ if (uvd.open() == Window.OK) {
+ retval[0] = uvd.getPassword();
+ } else {
+ retval[0] = null;
+ }
+ } else {
+ retval[0] = null;
+ }
+ }
+ });
+ return retval[0];
+ }
+ @Override
+ public String getPassphrase() {
+ return fPassphrase;
+ }
+ @Override
+ public boolean promptPassphrase(String message) {
+ fPassphrase = promptSecret(message);
+ return (fPassphrase!=null);
+ }
+ @Override
+ public boolean promptPassword(final String message) {
+ String _password = promptSecret(message);
+ if (_password!=null) {
+ fPassword=_password;
+ return true;
+ }
+ return false;
+ }
+ @Override
+ public void showMessage(final String message) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ // [168197] Replace JFace MessagDialog by SWT MessageBox
+ // MessageDialog.openInformation(null, SshMessages.INFO, message);
+ if (isSessionConnected()) {
+ MessageBox mb = new MessageBox(fControl.getShell(), SWT.ICON_INFORMATION | SWT.OK);
+ mb.setText(SshMessages.INFO);
+ mb.setMessage(message);
+ mb.open();
+ }
+ }
+ });
+ }
+ @Override
+ public String[] promptKeyboardInteractive(final String destination,
+ final String name, final String instruction,
+ final String[] prompt, final boolean[] echo)
+ {
+ if (prompt.length == 0) {
+ // No need to prompt, just return an empty String array
+ return new String[0];
+ }
+ try{
+ if (fAttemptCount == 0 && fPassword != null && prompt.length == 1 && prompt[0].trim().equalsIgnoreCase("password:")) { //$NON-NLS-1$
+ // Return the provided password the first time but always prompt on subsequent tries
+ fAttemptCount++;
+ return new String[] { fPassword };
+ }
+ final String[][] finResult = new String[1][];
+ getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isSessionConnected()) {
+ KeyboardInteractiveDialog dialog = new KeyboardInteractiveDialog(null, fConnectionId, destination, name, instruction, prompt, echo);
+ dialog.open();
+ finResult[0] = dialog.getResult();
+ } else {
+ finResult[0] = null; // indicate cancel to JSch
+ }
+ }
+ });
+ String[] result=finResult[0];
+ if (result == null)
+ return null; // cancelled
+ if (result.length == 1 && prompt.length == 1 && prompt[0].trim().equalsIgnoreCase("password:")) { //$NON-NLS-1$
+ fPassword = result[0];
+ }
+ fAttemptCount++;
+ return result;
+ }
+ catch(OperationCanceledException e){
+ return null;
+ }
+ }
+ }
+
+ private void connectFailed(String terminalText, String msg) {
+ Logger.log(terminalText);
+ fControl.displayTextInTerminal(terminalText);
+ // fControl.setMsg(msg);
+ }
+
+}
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnector.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnector.java
new file mode 100644
index 00000000000..e940feafdb3
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshConnector.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Martin Oberhuber (Wind River) - [225792] Rename SshConnector.getTelnetSettings() to getSshSettings()
+ * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.NullSettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
+
+import com.jcraft.jsch.ChannelShell;
+import com.jcraft.jsch.JSch;
+
+public class SshConnector extends TerminalConnectorImpl {
+ private OutputStream fOutputStream;
+ private InputStream fInputStream;
+ private JSch fJsch;
+ private ChannelShell fChannel;
+ private SshConnection fConnection;
+ private final SshSettings fSettings;
+ private int fWidth;
+ private int fHeight;
+ public SshConnector() {
+ this(new SshSettings());
+ }
+ public SshConnector(SshSettings settings) {
+ fSettings=settings;
+ }
+ @Override
+ public void initialize() throws Exception {
+ fJsch=new JSch();
+ }
+ @Override
+ public void connect(ITerminalControl control) {
+ super.connect(control);
+ fConnection = new SshConnection(this,control);
+ fConnection.start();
+ }
+ @Override
+ synchronized public void doDisconnect() {
+ fConnection.disconnect();
+ if (getInputStream() != null) {
+ try {
+ getInputStream().close();
+ } catch (Exception exception) {
+ Logger.logException(exception);
+ }
+ }
+
+ if (getTerminalToRemoteStream() != null) {
+ try {
+ getTerminalToRemoteStream().close();
+ } catch (Exception exception) {
+ Logger.logException(exception);
+ }
+ }
+ }
+ @Override
+ public void setTerminalSize(int newWidth, int newHeight) {
+ if(fChannel!=null && (newWidth!=fWidth || newHeight!=fHeight)) {
+ //avoid excessive communications due to change size requests by caching previous size
+ fChannel.setPtySize(newWidth, newHeight, 8*newWidth, 8*newHeight);
+ fWidth=newWidth;
+ fHeight=newHeight;
+ }
+ }
+ public InputStream getInputStream() {
+ return fInputStream;
+ }
+ @Override
+ public OutputStream getTerminalToRemoteStream() {
+ return fOutputStream;
+ }
+ void setInputStream(InputStream inputStream) {
+ fInputStream = inputStream;
+ }
+ void setOutputStream(OutputStream outputStream) {
+ fOutputStream = outputStream;
+ }
+ /**
+ * Return the SSH Settings.
+ *
+ * @return the settings for a concrete connection.
+ * @since org.eclipse.tm.terminal.ssh 2.0 renamed from getTelnetSettings()
+ */
+ public ISshSettings getSshSettings() {
+ return fSettings;
+ }
+ @Override
+ public void setDefaultSettings() {
+ fSettings.load(new NullSettingsStore());
+ }
+ @Override
+ public String getSettingsSummary() {
+ return fSettings.getSummary();
+ }
+ @Override
+ public void load(ISettingsStore store) {
+ fSettings.load(store);
+ }
+ @Override
+ public void save(ISettingsStore store) {
+ fSettings.save(store);
+ }
+ protected JSch getJsch() {
+ return fJsch;
+ }
+ ChannelShell getChannel() {
+ return fChannel;
+ }
+ void setChannel(ChannelShell channel) {
+ fChannel = channel;
+ fWidth=-1;
+ fHeight=-1;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.java
new file mode 100644
index 00000000000..74f0334e6e8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+ * Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting (Adopting code from org.eclipse.team.cvs.core)
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SshMessages extends NLS {
+ static {
+ NLS.initializeMessages(SshMessages.class.getName(), SshMessages.class);
+ }
+ public static String USER;
+ public static String HOST;
+ public static String PORT;
+ public static String PASSWORD;
+ public static String TIMEOUT;
+ public static String KEEPALIVE;
+ public static String KEEPALIVE_Tooltip;
+ public static String WARNING;
+ public static String INFO;
+
+ //These are from org.eclipse.team.cvs.ui.CVSUIMessages
+ public static String UserValidationDialog_required;
+ public static String UserValidationDialog_labelUser;
+ public static String UserValidationDialog_labelPassword;
+ public static String UserValidationDialog_password;
+ public static String UserValidationDialog_user;
+ public static String UserValidationDialog_5;
+ public static String UserValidationDialog_6;
+ public static String UserValidationDialog_7;
+
+ public static String KeyboardInteractiveDialog_message;
+ public static String KeyboardInteractiveDialog_labelConnection;
+
+ public static String ERROR_CONNECTING;
+ public static String TerminalCommunicationException_io;
+ public static String SSH_AUTH_CANCEL;
+ public static String SSH_AUTH_FAIL;
+ public static String com_jcraft_jsch_JSchException;
+ public static String java_io_IOException;
+ public static String java_io_EOFException;
+ public static String java_io_InterruptedIOException;
+ public static String java_net_UnknownHostException;
+ public static String java_net_ConnectException;
+ public static String java_net_SocketException;
+ public static String java_net_NoRouteToHostException;
+
+ //
+
+ public static String getMessageFor(Throwable throwable) {
+ String message = getMessage(getMessageKey(throwable));
+ if (message == null) {
+ message = NLS.bind(SshMessages.TerminalCommunicationException_io, (new Object[] { throwable.toString() }));
+ } else {
+ message = NLS.bind(message, (new Object[] { throwable.getMessage() }));
+ }
+ return message;
+ }
+
+ private static String getMessageKey(Throwable t) {
+ String name = t.getClass().getName();
+ name = name.replace('.', '_');
+ return name;
+ }
+
+ //
+ //
+
+ public static String getMessage(String key) {
+ try {
+ Field f = SshMessages.class.getDeclaredField(key);
+ Object o = f.get(null);
+ if (o instanceof String)
+ return (String) o;
+ } catch (SecurityException e) {
+ } catch (NoSuchFieldException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException e) {
+ }
+ return null;
+ }
+
+ //
+
+ }
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.properties
new file mode 100644
index 00000000000..70588e272be
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshMessages.properties
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2000, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Michael Scharf (Wind River) - initial API and implementation
+# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+# Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+# Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting (Adopting code from org.eclipse.team.cvs.core)
+###############################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+
+HOST = Host
+USER = User
+PORT = Port
+PASSWORD = Password
+TIMEOUT = Timeout (sec)
+KEEPALIVE = KeepAlive (sec)
+KEEPALIVE_Tooltip=Interval for sending keepalive messages in case of inactivity. Enter 0 to disable keepalives.
+WARNING = Warning
+INFO = Info
+
+#These are from cvs.ui/messages.properties
+UserValidationDialog_required=Password Required
+UserValidationDialog_labelUser={0}
+UserValidationDialog_labelPassword={1}
+UserValidationDialog_password=&Password:
+UserValidationDialog_user=&User name:
+UserValidationDialog_5=Connection:
+UserValidationDialog_6=&Save password
+UserValidationDialog_7=Saved passwords are stored on your computer in a file that is difficult, but not impossible, for an intruder to read.
+
+KeyboardInteractiveDialog_message=Keyboard Interactive authentication for {0}
+KeyboardInteractiveDialog_labelConnection=Enter values for the following connection: {0}
+
+# from org.eclipse.team.cvs.core/messages.properties (c) IBM 2000, 2007
+ERROR_CONNECTING=Error connecting {0} : {1}
+TerminalCommunicationException_io=Communication error: {0}
+SSH_AUTH_CANCEL=SSH Authentication cancelled.
+SSH_AUTH_FAIL=SSH Authentication failed.
+com_jcraft_jsch_JSchException=SSH client error: {0}
+java_io_IOException=I/O exception occurred: {0}
+java_io_EOFException=End of file encountered: {0}
+java_io_InterruptedIOException=I/O has been interrupted.
+java_net_UnknownHostException=Cannot locate host: {0}
+java_net_ConnectException=Cannot connect to host: {0}
+java_net_SocketException=Socket Exception: {0}
+java_net_NoRouteToHostException={0}
+# from org.eclipse.team.cvs.core
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettings.java
new file mode 100644
index 00000000000..f39e8c6460f
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettings.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Mikhail Kalugin - [201867] Improve Terminal SSH connection summary string
+ * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+ * Bryan Hunt - [313991] cannot programatically pass password to SshConnector
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+
+public class SshSettings implements ISshSettings {
+ protected String fHost;
+ protected String fUser;
+ protected String fPassword;
+ protected String fPort;
+ protected String fTimeout;
+ protected String fKeepalive;
+ @Override
+ public String getHost() {
+ return fHost;
+ }
+
+ public void setHost(String strHost) {
+ fHost = strHost;
+ }
+
+ @Override
+ public String getSummary() {
+ String settings = getUser()+'@'+getHost();
+ if(getPort()!=ISshSettings.DEFAULT_SSH_PORT) {
+ settings += ":" + getPort(); //$NON-NLS-1$
+ }
+ return settings;
+ }
+
+ @Override
+ public void load(ISettingsStore store) {
+ fHost = store.get("Host", "");//$NON-NLS-1$ //$NON-NLS-2$
+ fUser = store.get("User", "");//$NON-NLS-1$ //$NON-NLS-2$
+ // ISettingsStore providers have to make sure that
+ // the password is not saved in some as plain text
+ // on disk. [bug 313991]
+ fPassword = store.get("Password", "");//$NON-NLS-1$ //$NON-NLS-2$
+ fPort = store.get("Port", String.valueOf(ISshSettings.DEFAULT_SSH_PORT));//$NON-NLS-1$
+ fTimeout = store.get("Timeout", "0");//$NON-NLS-1$ //$NON-NLS-2$
+ fKeepalive = store.get("Keepalive", "300");//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public void save(ISettingsStore store) {
+ store.put("Host", fHost);//$NON-NLS-1$
+ store.put("User", fUser);//$NON-NLS-1$
+ store.put("Port", fPort);//$NON-NLS-1$
+ // We do *not* store the password in the settings because
+ // this can cause the password to be stored as plain text
+ // in some settings file
+ store.put("Timeout", fTimeout);//$NON-NLS-1$
+ store.put("Keepalive", fKeepalive);//$NON-NLS-1$
+ }
+
+
+ @Override
+ public int getTimeout() {
+ try {
+ return Integer.parseInt(fTimeout);
+ } catch (NumberFormatException numberFormatException) {
+ return 10;
+ }
+ }
+ public String getTimeoutString() {
+ return fTimeout;
+ }
+
+ public void setTimeout(String timeout) {
+ fTimeout = timeout;
+ }
+
+ @Override
+ public int getKeepalive() {
+ try {
+ return Integer.parseInt(fKeepalive);
+ } catch (NumberFormatException numberFormatException) {
+ return 300;
+ }
+ }
+ public String getKeepaliveString() {
+ return fKeepalive;
+ }
+
+ public void setKeepalive(String keepalive) {
+ fKeepalive = keepalive;
+ }
+
+ @Override
+ public String getUser() {
+ return fUser;
+ }
+
+ public void setUser(String user) {
+ fUser = user;
+ }
+ @Override
+ public int getPort() {
+ try {
+ return Integer.parseInt(fPort);
+ } catch (NumberFormatException numberFormatException) {
+ return ISshSettings.DEFAULT_SSH_PORT;
+ }
+ }
+
+ public String getPortString() {
+ return fPort;
+ }
+
+ public void setPort(String port) {
+ fPort = port;
+ }
+
+ @Override
+ public String getPassword() {
+ return fPassword;
+ }
+
+ public void setPassword(String password) {
+ fPassword = password;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettingsPage.java
new file mode 100644
index 00000000000..02b9428e9a8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/SshSettingsPage.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives
+ * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+
+public class SshSettingsPage extends AbstractSettingsPage {
+ private Text fHostText;
+ private Text fUser;
+ private Text fTimeout;
+ private Text fKeepalive;
+ private final SshSettings fTerminalSettings;
+ private Text fPort;
+ private Text fPassword;
+
+ public SshSettingsPage(SshSettings settings) {
+ fTerminalSettings=settings;
+ }
+ @Override
+ public void saveSettings() {
+ fTerminalSettings.setHost(fHostText.getText());
+ fTerminalSettings.setUser(fUser.getText());
+ fTerminalSettings.setPassword(fPassword.getText());
+ fTerminalSettings.setPort(fPort.getText());
+ fTerminalSettings.setTimeout(fTimeout.getText());
+ fTerminalSettings.setKeepalive(fKeepalive.getText());
+ }
+
+ @Override
+ public void loadSettings() {
+ if(fTerminalSettings!=null) {
+ fHostText.setText(get(fTerminalSettings.getHost(),""));//$NON-NLS-1$
+ fTimeout.setText(get(fTerminalSettings.getTimeoutString(),"0"));//$NON-NLS-1$
+ fKeepalive.setText(get(fTerminalSettings.getKeepaliveString(),"300"));//$NON-NLS-1$
+ fUser.setText(get(fTerminalSettings.getUser(),""));//$NON-NLS-1$
+ fPort.setText(get(fTerminalSettings.getPortString(), String.valueOf(ISshSettings.DEFAULT_SSH_PORT)));
+ fPassword.setText(get(fTerminalSettings.getPassword(),""));//$NON-NLS-1$
+ }
+ }
+ String get(String value, String def) {
+ if(value==null || value.length()==0)
+ return def;
+ return value;
+ }
+ @Override
+ public boolean validateSettings() {
+ String message = null;
+ int messageType = IMessageProvider.NONE;
+ boolean valid = true;
+
+ if (fHostText.getText().trim().length() == 0) {
+ String m = "Please enter a host IP or name."; //$NON-NLS-1$
+ int mt = IMessageProvider.INFORMATION;
+ updateControlDecoration(fHostText, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fHostText, null, IMessageProvider.NONE);
+ }
+ if (fUser.getText().trim().length() == 0) {
+ String m = "Please enter a username."; //$NON-NLS-1$
+ int mt = IMessageProvider.INFORMATION;
+ updateControlDecoration(fUser, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fUser, null, IMessageProvider.NONE);
+ }
+ try {
+ int p = Integer.parseInt(fPort.getText().trim());
+ if (p <= 0 || p > 65535) {
+ String m = "Invalid network port. Must be between 0 and 65535."; //$NON-NLS-1$
+ int mt = IMessageProvider.ERROR;
+ updateControlDecoration(fPort, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fPort, null, IMessageProvider.NONE);
+ }
+ p = Integer.parseInt(fTimeout.getText().trim());
+ if (p < 0) {
+ String m = "Invalid timeout. Must be greater than 0."; //$NON-NLS-1$
+ int mt = IMessageProvider.ERROR;
+ updateControlDecoration(fTimeout, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fTimeout, null, IMessageProvider.NONE);
+ }
+ p = Integer.parseInt(fKeepalive.getText().trim());
+ if (p < 0) {
+ String m = "Invalid keep alive. Must be greater than 0."; //$NON-NLS-1$
+ int mt = IMessageProvider.ERROR;
+ updateControlDecoration(fKeepalive, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fKeepalive, null, IMessageProvider.NONE);
+ }
+ } catch (Exception e) {
+ valid = false;
+ }
+
+ setMessage(message, messageType);
+ return valid;
+ }
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
+
+ composite.setLayout(gridLayout);
+ composite.setLayoutData(gridData);
+
+ fHostText = createTextField(composite, SshMessages.HOST);
+ fUser = createTextField(composite, SshMessages.USER);
+ fPassword = createTextField(composite, SshMessages.PASSWORD,SWT.PASSWORD);
+ fTimeout = createTextField(composite, SshMessages.TIMEOUT);
+ fKeepalive = createTextField(composite, SshMessages.KEEPALIVE);
+ fKeepalive.setToolTipText(SshMessages.KEEPALIVE_Tooltip);
+ fPort = createTextField(composite, SshMessages.PORT);
+ loadSettings();
+ }
+ private Text createTextField(Composite composite, String labelTxt, int textOptions) {
+ GridData gridData;
+ // Add label
+ Label ctlLabel = new Label(composite, SWT.RIGHT);
+ ctlLabel.setText(labelTxt + ":"); //$NON-NLS-1$
+
+ // Add control
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ final Text text= new Text(composite, SWT.BORDER | textOptions);
+ text.setLayoutData(gridData);
+ text.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ fireListeners(text);
+ }
+ });
+ createControlDecoration(text);
+ return text;
+ }
+ private Text createTextField(Composite composite, String labelTxt) {
+ return createTextField(composite, labelTxt, 0);
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/UserValidationDialog.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/UserValidationDialog.java
new file mode 100644
index 00000000000..ba862db7d15
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/connector/UserValidationDialog.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Martin Oberhuber (Wind River) - copied from org.eclipse.team.cvs.ui
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.connector;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * A dialog for prompting for a username and password
+ */
+public class UserValidationDialog extends TrayDialog {
+ // widgets
+ protected Text usernameField;
+ protected Text passwordField;
+ protected Button allowCachingButton;
+
+ protected String domain;
+ protected String defaultUsername;
+ protected String password = null;
+ protected boolean allowCaching = false;
+ protected Image keyLockImage;
+
+ // whether or not the username can be changed
+ protected boolean isUsernameMutable = true;
+ protected String username = null;
+ protected String message = null;
+
+ /**
+ * Creates a new UserValidationDialog.
+ *
+ * @param parentShell the parent shell
+ * @param location the location
+ * @param defaultName the default user name
+ * @param message a mesage to display to the user
+ */
+ public UserValidationDialog(Shell parentShell, String location, String defaultName, String message) {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ this.defaultUsername = defaultName;
+ this.domain = location;
+ this.message = message;
+ }
+ /**
+ * @see Window#configureShell
+ */
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(SshMessages.UserValidationDialog_required);
+ // set F1 help
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, ISshConstants.HELP_USER_VALIDATION_DIALOG);
+ }
+ /**
+ * @see Window#create
+ */
+ @Override
+ public void create() {
+ super.create();
+ // add some default values
+ usernameField.setText(defaultUsername);
+
+ if (isUsernameMutable) {
+ // give focus to username field
+ usernameField.selectAll();
+ usernameField.setFocus();
+ } else {
+ usernameField.setEditable(false);
+ passwordField.setFocus();
+ }
+ }
+
+ /**
+ * @see Dialog#createDialogArea
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+
+ top.setLayout(layout);
+ top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite imageComposite = new Composite(top, SWT.NONE);
+ layout = new GridLayout();
+ imageComposite.setLayout(layout);
+ imageComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+
+ Composite main = new Composite(top, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 3;
+ main.setLayout(layout);
+ main.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label imageLabel = new Label(imageComposite, SWT.NONE);
+ //keyLockImage = TeamImages.getImageDescriptor(ITeamUIImages.IMG_KEY_LOCK).createImage();
+ //imageLabel.setImage(keyLockImage);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ imageLabel.setLayoutData(data);
+
+ if (message != null) {
+ Label messageLabel = new Label(main, SWT.WRAP);
+ messageLabel.setText(message);
+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ data.horizontalSpan = 3;
+ data.widthHint = 300;
+ messageLabel.setLayoutData(data);
+ }
+ if (domain != null) {
+ Label d = new Label(main, SWT.WRAP);
+ d.setText(SshMessages.UserValidationDialog_5);
+ data = new GridData();
+ d.setLayoutData(data);
+ Label label = new Label(main, SWT.WRAP);
+ if (isUsernameMutable) {
+ label.setText(NLS.bind(SshMessages.UserValidationDialog_labelUser, new String[] { domain }));
+ } else {
+ label.setText(NLS.bind(SshMessages.UserValidationDialog_labelPassword, (new Object[]{defaultUsername, domain})));
+ }
+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.widthHint = 300;
+ label.setLayoutData(data);
+ }
+ createUsernameFields(main);
+ createPasswordFields(main);
+
+ if(domain != null) {
+ allowCachingButton = new Button(main, SWT.CHECK);
+ allowCachingButton.setText(SshMessages.UserValidationDialog_6);
+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ data.horizontalSpan = 3;
+ allowCachingButton.setLayoutData(data);
+ allowCachingButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ allowCaching = allowCachingButton.getSelection();
+ }
+ });
+ Composite warningComposite = new Composite(main, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginHeight = 0;
+ warningComposite.setLayout(layout);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 3;
+ warningComposite.setLayoutData(data);
+ Label warningLabel = new Label(warningComposite, SWT.NONE);
+ warningLabel.setImage(getImage(DLG_IMG_MESSAGE_WARNING));
+ warningLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING));
+ Label warningText = new Label(warningComposite, SWT.WRAP);
+ warningText.setText(SshMessages.UserValidationDialog_7);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = 300;
+ warningText.setLayoutData(data);
+ }
+
+ Dialog.applyDialogFont(parent);
+
+ return main;
+ }
+
+ /**
+ * Creates the three widgets that represent the password entry area.
+ *
+ * @param parent the parent of the widgets
+ */
+ protected void createPasswordFields(Composite parent) {
+ new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_password);
+
+ passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
+ passwordField.setLayoutData(data);
+ }
+ /**
+ * Creates the three widgets that represent the user name entry area.
+ *
+ * @param parent the parent of the widgets
+ */
+ protected void createUsernameFields(Composite parent) {
+ new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_user);
+
+ usernameField = new Text(parent, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
+ usernameField.setLayoutData(data);
+ }
+
+ /**
+ * Returns the password entered by the user, or null
+ * if the user cancelled.
+ *
+ * @return the entered password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Returns the username entered by the user, or null
+ * if the user cancelled.
+ *
+ * @return the entered username
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * Returns true if the save password checkbox was selected.
+ * @return true if the save password checkbox was selected and false
+ * otherwise.
+ */
+ public boolean getAllowCaching() {
+ return allowCaching;
+ }
+
+ /**
+ * Notifies that the ok button of this dialog has been pressed.
+ *
+ * The default implementation of this framework method sets
+ * this dialog's return code to Window.OK
+ * and closes the dialog. Subclasses may override.
+ *
+ */
+ @Override
+ protected void okPressed() {
+ password = passwordField.getText();
+ username = usernameField.getText();
+
+ super.okPressed();
+ }
+ /**
+ * Sets whether or not the username field should be mutable.
+ * This method must be called before create(), otherwise it
+ * will be ignored.
+ *
+ * @param value whether the username is mutable
+ */
+ public void setUsernameMutable(boolean value) {
+ isUsernameMutable = value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#close()
+ */
+ @Override
+ public boolean close() {
+ if(keyLockImage != null) {
+ keyLockImage.dispose();
+ }
+ return super.close();
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/controls/SshWizardConfigurationPanel.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/controls/SshWizardConfigurationPanel.java
new file mode 100644
index 00000000000..779b4c718d0
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/controls/SshWizardConfigurationPanel.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [361352] [TERMINALS][SSH] Add SSH terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.controls;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
+import org.eclipse.tm.terminal.connector.ssh.connector.SshConnector;
+import org.eclipse.tm.terminal.connector.ssh.connector.SshSettings;
+import org.eclipse.tm.terminal.connector.ssh.connector.SshSettingsPage;
+import org.eclipse.tm.terminal.connector.ssh.nls.Messages;
+import org.eclipse.tm.terminal.view.core.TerminalContextPropertiesProviderFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalContextPropertiesProvider;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.IContextPropertiesConstants;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel;
+
+/**
+ * SSH wizard configuration panel implementation.
+ */
+public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
+
+ private static final String SAVE_USER = "saveUser"; //$NON-NLS-1$
+ private static final String SAVE_PASSWORD = "savePassword"; //$NON-NLS-1$
+
+ private SshSettings sshSettings;
+ private ISettingsPage sshSettingsPage;
+ private Button userButton;
+ private Button passwordButton;
+
+ /**
+ * Constructor.
+ *
+ * @param container The configuration panel container or null.
+ */
+ public SshWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ panel.setLayoutData(data);
+
+ // Create the host selection combo
+ if (isWithoutSelection()) createHostsUI(panel, true);
+
+ SshConnector conn = new SshConnector();
+ sshSettings = (SshSettings) conn.getSshSettings();
+ sshSettings.setHost(getSelectionHost());
+ sshSettings.setUser(getDefaultUser());
+
+ sshSettingsPage = new SshSettingsPage(sshSettings);
+ if (sshSettingsPage instanceof AbstractSettingsPage) {
+ ((AbstractSettingsPage)sshSettingsPage).setHasControlDecoration(true);
+ }
+ sshSettingsPage.createControl(panel);
+
+ // Add the listener to the settings page
+ sshSettingsPage.addListener(new ISettingsPage.Listener() {
+ @Override
+ public void onSettingsPageChanged(Control control) {
+ if (getContainer() != null) getContainer().validate();
+ }
+ });
+
+ // Create the encoding selection combo
+ createEncodingUI(panel, true);
+
+ // if user and password for host should be saved or not
+ createSaveButtonsUI(panel, true);
+
+ setControl(panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#setupData(java.util.Map)
+ */
+ @Override
+ public void setupData(Map data) {
+ if (data == null || sshSettings == null || sshSettingsPage == null) return;
+
+ String value = (String)data.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+ if (value != null) sshSettings.setHost(value);
+
+ Object v = data.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ value = v != null ? v.toString() : null;
+ if (value != null) sshSettings.setPort(value);
+
+ v = data.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ value = v != null ? v.toString() : null;
+ if (value != null) sshSettings.setTimeout(value);
+
+ v = data.get(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE);
+ value = v != null ? v.toString() : null;
+ if (value != null) sshSettings.setKeepalive(value);
+
+ value = (String)data.get(ITerminalsConnectorConstants.PROP_SSH_PASSWORD);
+ if (value != null) sshSettings.setPassword(value);
+
+ value = (String)data.get(ITerminalsConnectorConstants.PROP_SSH_USER);
+ if (value != null) sshSettings.setUser(value);
+
+ value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) setEncoding(value);
+
+ sshSettingsPage.loadSettings();
+ }
+
+ /**
+ * Returns the default user name.
+ *
+ * @return The default user name.
+ */
+ private String getDefaultUser() {
+ ISelection selection = getSelection();
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ ITerminalContextPropertiesProvider provider = TerminalContextPropertiesProviderFactory.getProvider(element);
+ if (provider != null) {
+ Object user = provider.getProperty(element, IContextPropertiesConstants.PROP_DEFAULT_USER);
+ if (user instanceof String) return ((String) user).trim();
+ }
+ }
+
+ return System.getProperty("user.name"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#extractData(java.util.Map)
+ */
+ @Override
+ public void extractData(Map data) {
+ if (data == null) return;
+
+ // set the terminal connector id for ssh
+ data.put(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID, "org.eclipse.tm.terminal.connector.ssh.SshConnector"); //$NON-NLS-1$
+
+ sshSettingsPage.saveSettings();
+ data.put(ITerminalsConnectorConstants.PROP_IP_HOST,sshSettings.getHost());
+ data.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.valueOf(sshSettings.getPort()));
+ data.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.valueOf(sshSettings.getTimeout()));
+ data.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, Integer.valueOf(sshSettings.getKeepalive()));
+ data.put(ITerminalsConnectorConstants.PROP_SSH_PASSWORD, sshSettings.getPassword());
+ data.put(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
+ */
+ @Override
+ protected void fillSettingsForHost(String host) {
+ boolean saveUser = true;
+ boolean savePassword = false;
+ if (host != null && host.length() != 0){
+ if (hostSettingsMap.containsKey(host)){
+ Map hostSettings = hostSettingsMap.get(host);
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST) != null) {
+ sshSettings.setHost(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_IP_PORT) != null) {
+ sshSettings.setPort(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_PORT));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT) != null) {
+ sshSettings.setTimeout(hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE) != null) {
+ sshSettings.setKeepalive(hostSettings.get(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_SSH_USER) != null) {
+ sshSettings.setUser(hostSettings.get(ITerminalsConnectorConstants.PROP_SSH_USER));
+ }
+ if (hostSettings.get(SAVE_PASSWORD) != null) {
+ savePassword = new Boolean(hostSettings.get(SAVE_PASSWORD)).booleanValue();
+ }
+ if (!savePassword){
+ sshSettings.setPassword(""); //$NON-NLS-1$
+ } else {
+ String password = accessSecurePassword(sshSettings.getHost());
+ if (password != null) {
+ sshSettings.setPassword(password);
+ }
+ }
+
+ String encoding = hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (encoding == null || "null".equals(encoding)) { //$NON-NLS-1$
+ String defaultEncoding = getSelectionEncoding();
+ encoding = defaultEncoding != null && !"".equals(defaultEncoding.trim()) ? defaultEncoding.trim() : "ISO-8859-1"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ setEncoding(encoding);
+ } else {
+ sshSettings.setHost(getSelectionHost());
+ sshSettings.setUser(getDefaultUser());
+ saveUser = true;
+ savePassword = false;
+ }
+ // set settings in page
+ sshSettingsPage.loadSettings();
+ userButton.setSelection(saveUser);
+ passwordButton.setSelection(savePassword);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ saveSettingsForHost(true);
+ super.doSaveWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
+ @Override
+ protected void saveSettingsForHost(boolean add) {
+ boolean saveUser = userButton.getSelection();
+ boolean savePassword = passwordButton.getSelection();
+ String host = getHostFromSettings();
+ if (host != null && host.length() != 0) {
+ if (hostSettingsMap.containsKey(host)){
+ Map hostSettings = hostSettingsMap.get(host);
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, sshSettings.getHost());
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(sshSettings.getPort()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(sshSettings.getTimeout()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, Integer.toString(sshSettings.getKeepalive()));
+ if (saveUser) {
+ if (sshSettings.getUser() != null) {
+ hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ } else {
+ hostSettings.remove(ITerminalsConnectorConstants.PROP_SSH_USER);
+ }
+ }
+ else {
+ hostSettings.remove(ITerminalsConnectorConstants.PROP_SSH_USER);
+ }
+
+ String encoding = getEncoding();
+ if (encoding != null) {
+ String defaultEncoding = getSelectionEncoding();
+ if (defaultEncoding != null && defaultEncoding.trim().equals(encoding)) {
+ encoding = null;
+ }
+ }
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, encoding);
+ hostSettings.put(SAVE_USER, Boolean.toString(saveUser));
+ hostSettings.put(SAVE_PASSWORD, Boolean.toString(savePassword));
+
+ if (savePassword && sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
+ saveSecurePassword(host, sshSettings.getPassword());
+ }
+
+ // maybe unchecked the password button - so try to remove a saved password - if any
+ if (!savePassword) removeSecurePassword(host);
+ } else if (add) {
+ Map hostSettings = new HashMap();
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, sshSettings.getHost());
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(sshSettings.getPort()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(sshSettings.getTimeout()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, Integer.toString(sshSettings.getKeepalive()));
+ if (saveUser) {
+ if (sshSettings.getUser() != null) {
+ hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ }
+ }
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ hostSettings.put(SAVE_USER, Boolean.toString(saveUser));
+ hostSettings.put(SAVE_PASSWORD, Boolean.toString(savePassword));
+ hostSettingsMap.put(host, hostSettings);
+
+ if (savePassword && sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
+ saveSecurePassword(host, sshSettings.getPassword());
+ }
+ }
+ }
+ }
+
+ /**
+ * Save the password to the secure storage.
+ *
+ * @param host The host. Must not be null.
+ * @param password The password. Must not be null.
+ */
+ private void saveSecurePassword(String host, String password) {
+ Assert.isNotNull(host);
+ Assert.isNotNull(password);
+
+ // To access the secure storage, we need the preference instance
+ ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
+ if (preferences != null) {
+ // Construct the secure preferences node key
+ String nodeKey = "/Target Explorer SSH Password/" + host; //$NON-NLS-1$
+ ISecurePreferences node = preferences.node(nodeKey);
+ if (node != null) {
+ try {
+ node.put("password", password, true); //$NON-NLS-1$
+ }
+ catch (StorageException ex) { /* ignored on purpose */ }
+ }
+ }
+ }
+
+ /**
+ * Reads the password from the secure storage.
+ *
+ * @param host The host. Must not be null.
+ * @return The password or null.
+ */
+ private String accessSecurePassword(String host) {
+ Assert.isNotNull(host);
+
+ // To access the secure storage, we need the preference instance
+ ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
+ if (preferences != null) {
+ // Construct the secure preferences node key
+ String nodeKey = "/Target Explorer SSH Password/" + host; //$NON-NLS-1$
+ ISecurePreferences node = preferences.node(nodeKey);
+ if (node != null) {
+ String password = null;
+ try {
+ password = node.get("password", null); //$NON-NLS-1$
+ }
+ catch (StorageException ex) { /* ignored on purpose */ }
+
+ return password;
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#removeSecurePassword(java.lang.String)
+ */
+ @Override
+ protected void removeSecurePassword(String host) {
+ Assert.isNotNull(host);
+
+ // To access the secure storage, we need the preference instance
+ ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
+ if (preferences != null) {
+ // Construct the secure preferences node key
+ String nodeKey = "/Target Explorer SSH Password/" + host; //$NON-NLS-1$
+ ISecurePreferences node = preferences.node(nodeKey);
+ if (node != null) {
+ node.remove("password"); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid(){
+ return isEncodingValid() && sshSettingsPage.validateSettings();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
+ */
+ @Override
+ protected String getHostFromSettings() {
+ sshSettingsPage.saveSettings();
+ return sshSettings.getHost();
+ }
+
+ private void createSaveButtonsUI(final Composite parent, boolean separator) {
+ Assert.isNotNull(parent);
+
+ if (separator) {
+ Label sep = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
+ sep.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ }
+
+ Composite panel = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ userButton = new Button(panel, SWT.CHECK);
+ userButton.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false));
+ userButton.setText(Messages.SshWizardConfigurationPanel_saveUser);
+
+ passwordButton = new Button(panel, SWT.CHECK);
+ passwordButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ passwordButton.setText(Messages.SshWizardConfigurationPanel_savePassword);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshLauncherDelegate.java
new file mode 100644
index 00000000000..9de83a43739
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshLauncherDelegate.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [361352] [TERMINALS][SSH] Add SSH terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.launcher;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.connector.ssh.connector.ISshSettings;
+import org.eclipse.tm.terminal.connector.ssh.connector.SshSettings;
+import org.eclipse.tm.terminal.connector.ssh.controls.SshWizardConfigurationPanel;
+import org.eclipse.tm.terminal.connector.ssh.nls.Messages;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+
+/**
+ * SSH launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class SshLauncherDelegate extends AbstractLauncherDelegate {
+ // The SSH terminal connection memento handler
+ private final IMementoHandler mementoHandler = new SshMementoHandler();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#getPanel(org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new SshWizardConfigurationPanel(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map properties, ITerminalService.Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String terminalTitle = getTerminalTitle(properties);
+ if (terminalTitle != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
+ }
+
+ // For SSH terminals, force a new terminal tab each time it is launched,
+ // if not set otherwise from outside
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /**
+ * Returns the terminal title string.
+ *
+ * The default implementation constructs a title like "SSH @ host (Start time) ".
+ *
+ * @return The terminal title string or null.
+ */
+ private String getTerminalTitle(Map properties) {
+ // Try to see if the user set a title explicitly via the properties map.
+ String title = getDefaultTerminalTitle(properties);
+ if (title != null) return title;
+
+ //No title,try to calculate the title
+ String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+ String user = (String)properties.get(ITerminalsConnectorConstants.PROP_SSH_USER);
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ String port = value != null ? value.toString() : null;
+
+ if (host != null && user!= null) {
+ DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
+ String date = format.format(new Date(System.currentTimeMillis()));
+ if (port != null && Integer.valueOf(port).intValue() != ISshSettings.DEFAULT_SSH_PORT) {
+ return NLS.bind(Messages.SshLauncherDelegate_terminalTitle_port, new String[]{user, host, port, date});
+ }
+ return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, new String[]{user, host, date});
+ }
+
+ return Messages.SshLauncherDelegate_terminalTitle_default;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IMementoHandler.class.equals(adapter)) {
+ return mementoHandler;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String)properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) connectorId = "org.eclipse.tm.terminal.connector.ssh.SshConnector"; //$NON-NLS-1$
+
+ // Extract the ssh properties
+ String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ String port = value != null ? value.toString() : null;
+ value = properties.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ String timeout = value != null ? value.toString() : null;
+ value = properties.get(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE);
+ String keepAlive = value != null ? value.toString() : null;
+ String password = (String)properties.get(ITerminalsConnectorConstants.PROP_SSH_PASSWORD);
+ String user = (String)properties.get(ITerminalsConnectorConstants.PROP_SSH_USER);
+
+ int portOffset = 0;
+ if (properties.get(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET) instanceof Integer) {
+ portOffset = ((Integer)properties.get(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET)).intValue();
+ if (portOffset < 0) portOffset = 0;
+ }
+
+ // The real port to connect to is port + portOffset
+ if (port != null) {
+ port = Integer.toString(Integer.decode(port).intValue() + portOffset);
+ }
+
+ // Construct the ssh settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the telnet settings
+ SshSettings sshSettings = new SshSettings();
+ sshSettings.setHost(host);
+ sshSettings.setPort(port);
+ sshSettings.setTimeout(timeout);
+ sshSettings.setKeepalive(keepAlive);
+ sshSettings.setPassword(password);
+ sshSettings.setUser(user);
+
+ // And save the settings to the store
+ sshSettings.save(store);
+
+ // MWE TODO make sure this is NOT passed outside as this is plain text
+ store.put("Password", password); //$NON-NLS-1$
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshMementoHandler.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshMementoHandler.java
new file mode 100644
index 00000000000..76cf961d282
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/launcher/SshMementoHandler.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.launcher;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.ui.IMemento;
+
+/**
+ * SSH terminal connection memento handler implementation.
+ */
+public class SshMementoHandler implements IMementoHandler {
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void saveState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Do not write the terminal title to the memento -> needs to
+ // be recreated at the time of restoration.
+ memento.putString(ITerminalsConnectorConstants.PROP_IP_HOST, (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST));
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ memento.putInteger(ITerminalsConnectorConstants.PROP_IP_PORT, value instanceof Integer ? ((Integer)value).intValue() : -1);
+ value = properties.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ memento.putInteger(ITerminalsConnectorConstants.PROP_TIMEOUT, value instanceof Integer ? ((Integer)value).intValue() : -1);
+ value = properties.get(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE);
+ memento.putInteger(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, value instanceof Integer ? ((Integer)value).intValue() : -1);
+ memento.putString(ITerminalsConnectorConstants.PROP_SSH_USER, (String)properties.get(ITerminalsConnectorConstants.PROP_SSH_USER));
+ memento.putString(ITerminalsConnectorConstants.PROP_ENCODING, (String)properties.get(ITerminalsConnectorConstants.PROP_ENCODING));
+
+ // The password is stored within the Eclipse secure preferences -> no need to store it to the memento
+ //
+ // If ever needed, this is an example on how to encrypt the password using 3DES. Do not remove!
+
+ /*
+ String password = properties.getStringProperty(ITerminalsConnectorConstants.PROP_SSH_PASSWORD);
+ if (password != null) {
+ try {
+ // Generate a temporary key. In practice, you would save this key.
+ // See also Encrypting with DES Using a Pass Phrase.
+ // SecretKey key = KeyGenerator.getInstance("DESede").generateKey();
+
+ SecretKeyFactory factory = SecretKeyFactory.getInstance("DESede"); //$NON-NLS-1$
+ SecretKey key = factory.generateSecret(new DESKeySpec((ITerminalsConnectorConstants.PROP_SSH_PASSWORD + ".SshMementoHandler").getBytes("UTF-8"))); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); //$NON-NLS-1$
+ cipher.init(Cipher.ENCRYPT_MODE, key);
+
+ String encrypedPwd = new String(Base64.encode(cipher.doFinal(password.getBytes("UTF-8")))); //$NON-NLS-1$
+ memento.putString(ITerminalsConnectorConstants.PROP_SSH_PASSWORD, encrypedPwd);
+ }
+ catch (Exception e) {
+ if (Platform.inDebugMode()) e.printStackTrace();
+ }
+ }
+ */
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#restoreState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void restoreState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Restore the terminal properties from the memento
+ properties.put(ITerminalsConnectorConstants.PROP_IP_HOST, memento.getString(ITerminalsConnectorConstants.PROP_IP_HOST));
+ properties.put(ITerminalsConnectorConstants.PROP_IP_PORT, memento.getInteger(ITerminalsConnectorConstants.PROP_IP_PORT));
+ properties.put(ITerminalsConnectorConstants.PROP_TIMEOUT, memento.getInteger(ITerminalsConnectorConstants.PROP_TIMEOUT));
+ properties.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, memento.getInteger(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE));
+ properties.put(ITerminalsConnectorConstants.PROP_SSH_USER, memento.getString(ITerminalsConnectorConstants.PROP_SSH_USER));
+ properties.put(ITerminalsConnectorConstants.PROP_ENCODING, memento.getString(ITerminalsConnectorConstants.PROP_ENCODING));
+
+ // The password is stored within the Eclipse secure preferences -> restore it from there
+ // To access the secure storage, we need the preference instance
+ String password = null;
+ ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
+ if (preferences != null && (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST) != null) {
+ // Construct the secure preferences node key
+ String nodeKey = "/Target Explorer SSH Password/" + (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST); //$NON-NLS-1$
+ ISecurePreferences node = preferences.node(nodeKey);
+ if (node != null) {
+ try {
+ password = node.get("password", null); //$NON-NLS-1$
+ }
+ catch (StorageException ex) { /* ignored on purpose */ }
+ }
+ }
+
+ // Example of restoring the password from an 3DES encrypted string. Do not remove!
+ /*
+ String encrypedPwd = memento.getString(ITerminalsConnectorConstants.PROP_SSH_PASSWORD);
+ if (encrypedPwd != null) {
+ try {
+ SecretKeyFactory factory = SecretKeyFactory.getInstance("DESede"); //$NON-NLS-1$
+ SecretKey key = factory.generateSecret(new DESKeySpec((ITerminalsConnectorConstants.PROP_SSH_PASSWORD + ".SshMementoHandler").getBytes("UTF-8"))); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); //$NON-NLS-1$
+ cipher.init(Cipher.DECRYPT_MODE, key);
+
+ byte[] encBytes = Base64.decode(encrypedPwd.getBytes("UTF-8")); //$NON-NLS-1$
+ byte[] decBytes = cipher.doFinal(encBytes);
+
+ password = new String(decBytes);
+ }
+ catch (Exception e) {
+ if (Platform.inDebugMode()) e.printStackTrace();
+ }
+ }
+ */
+
+ properties.put(ITerminalsConnectorConstants.PROP_SSH_PASSWORD, password);
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.java
new file mode 100644
index 00000000000..61978ceb6df
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [361352] [TERMINALS][SSH] Add SSH terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.ssh.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tm.terminal.connector.ssh.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String SshLauncherDelegate_terminalTitle;
+ public static String SshLauncherDelegate_terminalTitle_port;
+ public static String SshLauncherDelegate_terminalTitle_default;
+ public static String SshWizardConfigurationPanel_saveUser;
+ public static String SshWizardConfigurationPanel_savePassword;
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.properties
new file mode 100644
index 00000000000..5a5b7efec5c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.ssh/src/org/eclipse/tm/terminal/connector/ssh/nls/Messages.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+SshLauncherDelegate_terminalTitle=SSH {0}@{1} ({2})
+SshLauncherDelegate_terminalTitle_port=SSH {0}@{1}:{2} ({3})
+SshLauncherDelegate_terminalTitle_default=SSH Terminal
+SshWizardConfigurationPanel_saveUser=Save user
+SshWizardConfigurationPanel_savePassword=Save password
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.classpath b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.options b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.options
new file mode 100644
index 00000000000..77c6a134ddd
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.options
@@ -0,0 +1 @@
+org.eclipse.tm.terminal.connector.telnet/debugmode = 0
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.project b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.project
new file mode 100644
index 00000000000..83045227a60
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.project
@@ -0,0 +1,45 @@
+
+
+ org.eclipse.tm.terminal.connector.telnet
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
+
+ 1329502098231
+
+ 10
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-name-matches-false-false-target
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..4754bba05f6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Wed Oct 19 12:10:57 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0d732269684
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.pde.prefs b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000000..cf80c8bc5b8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..9cf0892c24c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.connector.telnet;singleton:=true
+Bundle-Version: 4.5.100.qualifier
+Bundle-Activator: org.eclipse.tm.terminal.connector.telnet.activator.UIPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.equinox.security;bundle-version="1.1.100",
+ org.eclipse.tm.terminal.view.core;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.view.ui;bundle-version="4.5.0";resolution:=optional,
+ org.eclipse.tm.terminal.control;bundle-version="4.5.0",
+ org.eclipse.ui;bundle-version="3.8.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tm.terminal.connector.telnet.activator;x-internal:=true,
+ org.eclipse.tm.terminal.connector.telnet.connector,
+ org.eclipse.tm.terminal.connector.telnet.controls,
+ org.eclipse.tm.terminal.connector.telnet.launcher,
+ org.eclipse.tm.terminal.connector.telnet.nls;x-internal:=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/about.html b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/about.html
new file mode 100644
index 00000000000..fe4ae3f5b94
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
May 24, 2012
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/build.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/build.properties
new file mode 100644
index 00000000000..1c3465df7d0
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/build.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.properties
new file mode 100644
index 00000000000..8e74cc83e2f
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.properties
@@ -0,0 +1,22 @@
+##################################################################################
+# Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Terminal Telnet Connector
+providerName = Eclipse.org - Target Management
+
+# ----- Terminal Connector -----
+
+TelnetConnector.label=Telnet
+
+# ----- Terminal Launcher Delegates -----
+
+TelnetLauncherDelegate.label=Telnet Terminal
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.xml
new file mode 100644
index 00000000000..dc9d728cb06
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/plugin.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/pom.xml
new file mode 100644
index 00000000000..a6f4f6cdc21
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/pom.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+
+ org.eclipse.tm.terminal.connector.telnet
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/activator/UIPlugin.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/activator/UIPlugin.java
new file mode 100644
index 00000000000..0f7a167df9c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/activator/UIPlugin.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [366374] [TERMINALS][TELNET] Add Telnet terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.activator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tm.terminal.view.core.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tm.terminal.connector.telnet"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the Image object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The Image object instance or null.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the ImageDescriptor object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The ImageDescriptor object instance or null.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/ITelnetSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/ITelnetSettings.java
new file mode 100644
index 00000000000..901f06ac34b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/ITelnetSettings.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+
+/**
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ */
+public interface ITelnetSettings {
+ /**
+ * @since 4.2
+ */
+ static final String EOL_CRNUL = "CR+NUL"; //$NON-NLS-1$
+ /**
+ * @since 4.2
+ */
+ static final String EOL_CRLF = "CR+LF"; //$NON-NLS-1$
+
+ String getHost();
+ int getNetworkPort();
+ int getTimeout();
+ /**
+ * @since 4.2
+ */
+ String getEndOfLine();
+ String getSummary();
+ void load(ISettingsStore store);
+ void save(ISettingsStore store);
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/NetworkPortMap.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/NetworkPortMap.java
new file mode 100644
index 00000000000..87687c231de
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/NetworkPortMap.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalNetworkPortMap
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class NetworkPortMap {
+ public static final String PROP_NAMETGTCONS = "tgtcons"; //$NON-NLS-1$
+ public static final String PROP_NAMETELNET = "telnet"; //$NON-NLS-1$
+ public static final String PROP_VALUENET = "1233"; //$NON-NLS-1$
+ public static final String PROP_VALUETGTCONS = "1232"; //$NON-NLS-1$
+ public static final String PROP_VALUETELNET = "23"; //$NON-NLS-1$
+
+ String[][] fPortMap=new String[][] {
+ // portName, port
+ {PROP_NAMETGTCONS, PROP_VALUETGTCONS},
+ {PROP_NAMETELNET, PROP_VALUETELNET}
+ };
+
+ public String getDefaultNetworkPort() {
+ return PROP_VALUETELNET;
+ }
+
+ public String findPortName(String strPort) {
+ for (int i = 0; i < fPortMap.length; i++) {
+ if(fPortMap[i][1].equals(strPort))
+ return fPortMap[i][0];
+ }
+ return null;
+ }
+
+ public String findPort(String strPortName) {
+ for (int i = 0; i < fPortMap.length; i++) {
+ if(fPortMap[i][0].equals(strPortName))
+ return fPortMap[i][1];
+ }
+ return null;
+ }
+
+ public List getNameTable() {
+ List names=new ArrayList();
+ for (int i = 0; i < fPortMap.length; i++) {
+ names.add(fPortMap[i][0]);
+ }
+ return names;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetCodes.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetCodes.java
new file mode 100644
index 00000000000..1d60c75a080
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetCodes.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Fran Litterio (Wind River) - initial API and implementation
+ * Helmut Haigermoser (Wind River) - repackaged
+ * Ted Williams (Wind River) - repackaged into org.eclipse namespace
+ * Michael Scharf (Wind River) - split into core, view and connector plugins
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+/**
+ * This interface defines symbolic constants for numeric TELNET protocol command and
+ * option codes. Any class that needs to use these constants must implement this
+ * interface. The meanings of these constants are defined in the various TELNET RFCs
+ * (RFC 854 to RFC 861, and others).
+ */
+interface TelnetCodes
+{
+ /** Command code: Subnegotiation End. */
+ static final byte TELNET_SE = (byte)240;
+
+ /** Command code: No-op. */
+ static final byte TELNET_NOP = (byte)241;
+
+ /** Command code: Data Mark. */
+ static final byte TELNET_DM = (byte)242;
+
+ /** Command code: Break. */
+ static final byte TELNET_BREAK = (byte)243;
+
+ /** Command code: Interrupt Process. */
+ static final byte TELNET_IP = (byte)244;
+
+ /** Command code: Abort Output. */
+ static final byte TELNET_AO = (byte)245;
+
+ /** Command code: Are You There. */
+ static final byte TELNET_AYT = (byte)246;
+
+ /** Command code: Erase Character. */
+ static final byte TELNET_EC = (byte)247;
+
+ /** Command code: Erase Line. */
+ static final byte TELNET_EL = (byte)248;
+
+ /** Command code: Go Ahead. */
+ static final byte TELNET_GA = (byte)249;
+
+ /** Command code: Subnegotiation Begin. */
+ static final byte TELNET_SB = (byte)250;
+
+ /** Command code: Will. */
+ static final byte TELNET_WILL = (byte)251;
+
+ /** Command code: Won't. */
+ static final byte TELNET_WONT = (byte)252;
+
+ /** Command code: Do. */
+ static final byte TELNET_DO = (byte)253;
+
+ /** Command code: Don't. */
+ static final byte TELNET_DONT = (byte)254;
+
+ /** Command code: Interpret As Command. */
+ static final byte TELNET_IAC = (byte)255;
+
+ /** Command code: IS. */
+ static final byte TELNET_IS = 0;
+
+ /** Command code: SEND. */
+ static final byte TELNET_SEND = 1;
+
+
+ /** Option code: Transmit Binary option. */
+ static final byte TELNET_OPTION_TRANSMIT_BINARY = 0;
+
+ /** Option code: Echo option. */
+ static final byte TELNET_OPTION_ECHO = 1;
+
+ /** Option code: Suppress Go Ahead option. */
+ static final byte TELNET_OPTION_SUPPRESS_GA = 3;
+
+ /** Option code: Terminal Type */
+ static final byte TELNET_OPTION_TERMINAL_TYPE = 24;
+
+ /** Option code: Negotitate About Window Size (NAWS) */
+ static final byte TELNET_OPTION_NAWS = 31;
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnectWorker.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnectWorker.java
new file mode 100644
index 00000000000..330e31c1de1
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnectWorker.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalControl
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Uwe Stieber (Wind River) - [287158][terminal][telnet] Connect worker is giving up to early
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.net.ConnectException;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+
+class TelnetConnectWorker extends Thread {
+ private final ITerminalControl fControl;
+ private final TelnetConnector fConn;
+ protected TelnetConnectWorker(TelnetConnector conn,ITerminalControl control) {
+ fControl = control;
+ fConn = conn;
+ fControl.setState(TerminalState.CONNECTING);
+ }
+ @Override
+ public void run() {
+ // Retry the connect with after a little pause in case the
+ // remote telnet server isn't ready. ConnectExceptions might
+ // happen if the telnet server process did not initialized itself.
+ // This is seen especially if the telnet server is a process
+ // providing it's input and output via a built in telnet server.
+ int remaining = 10;
+
+ while (remaining >= 0) {
+ // Pause before we re-try if the remaining tries are less than the initial value
+ if (remaining < 10) try { Thread.sleep(500); } catch (InterruptedException e) { /* ignored on purpose */ }
+
+ try {
+ int nTimeout = fConn.getTelnetSettings().getTimeout() * 1000;
+ String strHost = fConn.getTelnetSettings().getHost();
+ int nPort = fConn.getTelnetSettings().getNetworkPort();
+ InetSocketAddress address = new InetSocketAddress(strHost, nPort);
+ Socket socket=new Socket();
+
+ socket.connect(address, nTimeout);
+
+ // If we get to this point, the connect succeeded and we will
+ // force the remaining counter to be 0.
+ remaining = 0;
+
+ // This next call causes reads on the socket to see TCP urgent data
+ // inline with the rest of the non-urgent data. Without this call, TCP
+ // urgent data is silently dropped by Java. This is required for
+ // TELNET support, because when the TELNET server sends "IAC DM", the
+ // IAC byte is TCP urgent data. If urgent data is silently dropped, we
+ // only see the DM, which looks like an ISO Latin-1 '�' character.
+
+ socket.setOOBInline(true);
+
+ fConn.setSocket(socket);
+
+ TelnetConnection connection=new TelnetConnection(fConn, socket);
+ socket.setKeepAlive(true);
+ fConn.setTelnetConnection(connection);
+ connection.start();
+ fControl.setState(TerminalState.CONNECTED);
+
+ } catch (UnknownHostException ex) {
+ // No re-try in case of UnknownHostException, there is no indication that
+ // the DNS will fix itself
+ remaining = 0;
+ //Construct error message and signal failed
+ String txt="Unknown host: " + ex.getMessage(); //$NON-NLS-1$
+ connectFailed(txt,"Unknown host: " + ex.getMessage() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (SocketTimeoutException socketTimeoutException) {
+ // Time out occurred. No re-try in this case either. Time out can
+ // be increased by the user. Multiplying the timeout with the remaining
+ // counter is not desired.
+ remaining = 0;
+ // Construct error message and signal failed
+ connectFailed(socketTimeoutException.getMessage(), "Connection Error!\n" + socketTimeoutException.getMessage()); //$NON-NLS-1$
+ } catch (ConnectException connectException) {
+ // In case of a ConnectException, do a re-try. The server could have been
+ // simply not ready yet and the worker would give up to early. If the terminal
+ // control is already closed (disconnected), don't print "Connection refused" errors
+ if (remaining == 0 && TerminalState.CLOSED != fControl.getState()) {
+ connectFailed(connectException.getMessage(),"Connection refused!"); //$NON-NLS-1$
+ }
+ } catch (Exception exception) {
+ // Any other exception on connect. No re-try in this case either
+ remaining = 0;
+ // Log the exception
+ Logger.logException(exception);
+ // And signal failed
+ connectFailed(exception.getMessage(),""); //$NON-NLS-1$
+ } finally {
+ remaining--;
+ }
+ }
+ }
+
+ private void connectFailed(String terminalText, String msg) {
+ Logger.log(terminalText);
+ fControl.displayTextInTerminal(terminalText);
+ fConn.cleanSocket();
+ fControl.setState(TerminalState.CLOSED);
+ fControl.setMsg(msg);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnection.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnection.java
new file mode 100644
index 00000000000..67c1e1a2b2c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnection.java
@@ -0,0 +1,697 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Fran Litterio (Wind River) - initial API and implementation
+ * Helmut Haigermoser (Wind River) - repackaged
+ * Ted Williams (Wind River) - repackaged into org.eclipse namespace
+ * Michael Scharf (Wind River) - split into core, view and connector plugins
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal
+ * Alex Panchenko (Xored) - [277061] TelnetConnection.isConnected() should check if socket was not closed
+ * Uwe Stieber (Wind River) - [281329] Telnet connection not handling "SocketException: Connection reset" correct
+ * Nils Hagge (Siemens AG) - [276023] close socket streams after connection is disconnected
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.net.SocketException;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+
+/**
+ * This class encapsulates a TELNET connection to a remote server. It processes
+ * incoming TELNET protocol data and generates outbound TELNET protocol data. It
+ * also manages two sets of TelnetOption objects: one for the local endpoint and
+ * one for the remote endpoint.
+ *
+ *
+ * IMPORTANT: Understanding this code requires understanding the TELNET protocol
+ * and TELNET option processing, as defined in the RFCs listed below.
+ *
+ *
+ * @author Fran Litterio (francis.litterio@windriver.com)
+ *
+ * @see RFC 854
+ * @see RFC 855
+ * @see RFC 856
+ * @see RFC 857
+ * @see RFC 858
+ * @see RFC 859
+ * @see RFC 860
+ * @see RFC 861
+ * @see RFC 1091
+ * @see RFC 1096
+ * @see RFC 1073
+ * @see RFC 1079
+ * @see RFC 1143
+ * @see RFC 1572
+ */
+public class TelnetConnection extends Thread implements TelnetCodes {
+ /**
+ * TELNET connection state: Initial state.
+ */
+ protected static final int STATE_INITIAL = 0;
+
+ /**
+ * TELNET connection state: Last byte processed was IAC code. code.
+ */
+ protected static final int STATE_IAC_RECEIVED = 1;
+
+ /**
+ * TELNET connection state: Last byte processed was WILL code. code.
+ */
+ protected static final int STATE_WILL_RECEIVED = 2;
+
+ /**
+ * TELNET connection state: Last byte processed was WONT code.
+ */
+ protected static final int STATE_WONT_RECEIVED = 3;
+
+ /**
+ * TELNET connection state: Last byte processed was DO code.
+ */
+ protected static final int STATE_DO_RECEIVED = 4;
+
+ /**
+ * TELNET connection state: Last byte processed was DONT code.
+ */
+ protected static final int STATE_DONT_RECEIVED = 5;
+
+ /**
+ * TELNET connection state: Last byte processed was SB.
+ */
+ protected static final int STATE_SUBNEGOTIATION_STARTED = 6;
+
+ /**
+ * TELNET connection state: Currently receiving sub-negotiation data.
+ */
+ protected static final int STATE_RECEIVING_SUBNEGOTIATION = 7;
+
+ /**
+ * Size of buffer for processing data received from remote endpoint.
+ */
+ protected static final int BUFFER_SIZE = 2048;
+
+ /**
+ * Holds raw bytes received from the remote endpoint, prior to any TELNET
+ * protocol processing.
+ */
+ protected byte[] rawBytes = new byte[BUFFER_SIZE];
+
+ /**
+ * Holds incoming network data after the TELNET protocol bytes have been
+ * processed and removed.
+ */
+ protected byte[] processedBytes = new byte[BUFFER_SIZE];
+
+ /**
+ * This field holds a StringBuffer containing text recently received from
+ * the remote endpoint (after all TELNET protocol bytes have been processed
+ * and removed).
+ */
+ protected StringBuffer processedStringBuffer = new StringBuffer(BUFFER_SIZE);
+
+ /**
+ * Holds the current state of the TELNET protocol processor.
+ */
+ protected int telnetState = STATE_INITIAL;
+
+ /**
+ * This field is true if the remote endpoint is a TELNET server, false if
+ * not. We set this to true if and only if the remote endpoint sends
+ * recognizable TELNET protocol data. We do not assume that the remote
+ * endpoint is a TELNET server just because it is listening on port 23. This
+ * allows us to successfully connect to a TELNET server listening on a port
+ * other than 23.
+ *
+ *
+ * When this field first changes from false to true, we send all WILL or DO
+ * commands to the remote endpoint.
+ *
+ *
+ * @see #telnetServerDetected()
+ */
+ protected boolean remoteIsTelnetServer = false;
+
+ /**
+ * An array of TelnetOption objects representing the local endpoint's TELNET
+ * options. The array is indexed by the numeric TELNET option code.
+ */
+ protected TelnetOption[] localOptions = new TelnetOption[256];
+
+ /**
+ * An array of TelnetOption objects representing the remote endpoint's
+ * TELNET options. The array is indexed by the numeric TELNET option code.
+ */
+ protected TelnetOption[] remoteOptions = new TelnetOption[256];
+
+ /**
+ * An array of bytes that holds the TELNET subnegotiation command most
+ * recently received from the remote endpoint. This array does _not_ include
+ * the leading IAC SB bytes, nor does it include the trailing IAC SE bytes.
+ * The first byte of this array is always a TELNET option code.
+ */
+ protected byte[] receivedSubnegotiation = new byte[128];
+
+ /**
+ * This field holds the index into array {@link #receivedSubnegotiation} of
+ * the next unused byte. This is used by method
+ * {@link #processTelnetProtocol(int)} when the state machine is in states
+ * {@link #STATE_SUBNEGOTIATION_STARTED} and {@link
+ * #STATE_RECEIVING_SUBNEGOTIATION}.
+ */
+ protected int nextSubnegotiationByteIndex = 0;
+
+ /**
+ * This field is true if an error occurs while processing a subnegotiation
+ * command.
+ *
+ * @see #processTelnetProtocol(int)
+ */
+ protected boolean ignoreSubnegotiation = false;
+
+ /**
+ * This field holds the width of the Terminal screen in columns.
+ */
+ protected int width = 0;
+
+ /**
+ * This field holds the height of the Terminal screen in rows.
+ */
+ protected int height = 0;
+
+ /**
+ * This field holds a reference to the {@link ITerminalControl} singleton.
+ */
+ protected TelnetConnector terminalControl;
+
+ /**
+ * This method holds the Socket object for the TELNET connection.
+ */
+ protected Socket socket;
+
+ /**
+ * This field holds a reference to an {@link InputStream} object used to
+ * receive data from the remote endpoint.
+ */
+ protected InputStream inputStream;
+
+ /**
+ * This field holds a reference to an {@link OutputStream} object used to
+ * send data to the remote endpoint.
+ */
+ protected OutputStream outputStream;
+
+ /**
+ * UNDER CONSTRUCTION
+ */
+ protected boolean localEcho = true;
+
+ /**
+ * This constructor just initializes some internal object state from its
+ * arguments.
+ */
+ public TelnetConnection(TelnetConnector terminalControl, Socket socket) throws IOException {
+ super();
+
+ Logger.log("entered"); //$NON-NLS-1$
+
+ this.terminalControl = terminalControl;
+ this.socket = socket;
+
+ inputStream = socket.getInputStream();
+ outputStream = socket.getOutputStream();
+
+ initializeOptions();
+ }
+
+ /**
+ * Returns true if the TCP connection represented by this object is
+ * connected, false otherwise.
+ */
+ public boolean isConnected() {
+ return socket != null && socket.isConnected() && !socket.isClosed();
+ }
+
+ /**
+ * Returns true if the TCP connection represented by this object is
+ * connected and the remote endpoint is a TELNET server, false otherwise.
+ */
+ public boolean isRemoteTelnetServer() {
+ return remoteIsTelnetServer;
+ }
+
+ /**
+ * This method sets the terminal width and height to the supplied values. If
+ * either new value differs from the corresponding old value, we initiate a
+ * NAWS subnegotiation to inform the remote endpoint of the new terminal
+ * size.
+ */
+ public void setTerminalSize(int newWidth, int newHeight) {
+ Logger.log("Setting new size: width = " + newWidth + ", height = " + newHeight); //$NON-NLS-1$ //$NON-NLS-2$
+ if (!isConnected() || !isRemoteTelnetServer())
+ return;
+ boolean sizeChanged = false;
+
+ if (newWidth != width || newHeight != height)
+ sizeChanged = true;
+
+ width = newWidth;
+ height = newHeight;
+
+ if (sizeChanged && remoteIsTelnetServer && localOptions[TELNET_OPTION_NAWS].isEnabled()) {
+ Integer[] sizeData = { Integer.valueOf(width), Integer.valueOf(height) };
+
+ localOptions[TELNET_OPTION_NAWS].sendSubnegotiation(sizeData);
+ }
+ }
+
+ /**
+ * Returns true if local echoing is enabled for this TCP connection, false
+ * otherwise.
+ */
+ public boolean localEcho() {
+ return localEcho;
+ }
+
+ private void displayTextInTerminal(String string) {
+ terminalControl.displayTextInTerminal(string);
+ }
+
+ /**
+ * This method runs in its own thread. It reads raw bytes from the TELNET
+ * connection socket, processes any TELNET protocol bytes (and removes
+ * them), and passes the remaining bytes to a TerminalDisplay object for
+ * display.
+ */
+ @Override
+ public void run() {
+ Logger.log("Entered"); //$NON-NLS-1$
+
+ try {
+ while (socket.isConnected()) {
+ int nRawBytes = inputStream.read(rawBytes);
+
+ if (nRawBytes == -1) {
+ // End of input on inputStream.
+ Logger.log("End of input reading from socket!"); //$NON-NLS-1$
+
+ // Announce to the user that the remote endpoint has closed the
+ // connection.
+
+ displayTextInTerminal(TelnetMessages.CONNECTION_CLOSED_BY_FOREIGN_HOST);
+
+ // Tell the ITerminalControl object that the connection is
+ // closed.
+ terminalControl.setState(TerminalState.CLOSED);
+ break;
+ }
+
+ // Process any TELNET protocol data that we receive. Don't
+ // send any TELNET protocol data until we are sure the remote
+ // endpoint is a TELNET server.
+
+ int nProcessedBytes = processTelnetProtocol(nRawBytes);
+
+ if (nProcessedBytes > 0) {
+ terminalControl.getRemoteToTerminalOutputStream().write(processedBytes, 0, nProcessedBytes);
+ }
+ }
+ } catch (SocketException ex) {
+ String message = ex.getMessage();
+
+ // A "socket closed" exception is normal here. It's caused by the
+ // user clicking the disconnect button on the Terminal view toolbar.
+
+ if (message != null && !message.equalsIgnoreCase("Socket closed") && !message.equalsIgnoreCase("Connection reset")) //$NON-NLS-1$ //$NON-NLS-2$
+ {
+ Logger.logException(ex);
+ }
+
+ } catch (Exception ex) {
+ Logger.logException(ex);
+ } finally {
+ // Tell the ITerminalControl object that the connection is closed.
+ terminalControl.setState(TerminalState.CLOSED);
+ try { inputStream.close(); } catch(IOException ioe) { /*ignore*/ }
+ try { outputStream.close(); } catch(IOException ioe) { /*ignore*/ }
+ }
+ }
+
+ /**
+ * This method initializes the localOptions[] and remoteOptions[] arrays so
+ * that they contain references to TelnetOption objects representing our
+ * desired state for each option. The goal is to achieve server-side
+ * echoing, suppression of Go Aheads, and to send the local terminal type
+ * and size to the remote endpoint.
+ */
+ protected void initializeOptions() {
+ // First, create all the TelnetOption objects in the "undesired" state.
+
+ for (int i = 0; i < localOptions.length; ++i) {
+ localOptions[i] = new TelnetOption((byte) i, false, true, outputStream);
+ }
+
+ for (int i = 0; i < localOptions.length; ++i) {
+ remoteOptions[i] = new TelnetOption((byte) i, false, false, outputStream);
+ }
+
+ // Next, set some of the options to the "desired" state. The options we
+ // desire to be enabled are as follows:
+ //
+ // TELNET Option Desired for Desired for
+ // Name and Code Local Endpoint Remote Endpoint
+ // --------------------- -------------- ---------------
+ // Echo (1) No Yes
+ // Suppress Go Ahead (3) Yes Yes
+ // Terminal Type (24) Yes Yes
+ // NAWS (31) Yes Yes
+ //
+ // All other options remain in the "undesired" state, and thus will be
+ // disabled (since either endpoint can force any option to be disabled by simply
+ // answering WILL with DONT and DO with WONT).
+
+ localOptions[TELNET_OPTION_ECHO].setDesired(false);
+ remoteOptions[TELNET_OPTION_ECHO].setDesired(true);
+
+ localOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true);
+ remoteOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true);
+
+ localOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true);
+ remoteOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true);
+
+ localOptions[TELNET_OPTION_NAWS].setDesired(true);
+ remoteOptions[TELNET_OPTION_NAWS].setDesired(true);
+ }
+
+ /**
+ * Process TELNET protocol data contained in the first count bytes
+ * of rawBytes. This function preserves its state between calls,
+ * because a multi-byte TELNET command might be split between two (or more)
+ * calls to this function. The state is preserved in field telnetState.
+ * This function implements an FSA that recognizes TELNET option codes.
+ * TELNET option sub-negotiation is delegated to instances of TelnetOption.
+ *
+ * @return The number of bytes remaining in the buffer after removing all
+ * TELNET protocol bytes.
+ */
+ //TELNET option state is stored in instances of TelnetOption.
+ protected int processTelnetProtocol(int count) {
+ // This is too noisy to leave on all the time.
+ // Logger.log("Processing " + count + " bytes of data.");
+
+ int nextProcessedByte = 0;
+
+ for (int byteIndex = 0; byteIndex < count; ++byteIndex) {
+ // It is possible for control to flow through the below code such
+ // that nothing happens. This happens when array rawBytes[] contains no
+ // TELNET protocol data.
+
+ byte inputByte = rawBytes[byteIndex];
+ int ubyte = inputByte & 0xFF;
+
+ switch (telnetState) {
+ case STATE_INITIAL:
+ if (inputByte == TELNET_IAC) {
+ telnetState = STATE_IAC_RECEIVED;
+ } else {
+ // It's not an IAC code, so just append it to
+ // processedBytes.
+
+ processedBytes[nextProcessedByte++] = inputByte;
+ }
+ break;
+
+ case STATE_IAC_RECEIVED:
+ switch (inputByte) {
+ case TELNET_IAC:
+ // Two IAC bytes in a row are translated into one byte with
+ // the
+ // value 0xff.
+
+ processedBytes[nextProcessedByte++] = (byte) 0xff;
+ telnetState = STATE_INITIAL;
+ break;
+
+ case TELNET_WILL:
+ telnetState = STATE_WILL_RECEIVED;
+ break;
+
+ case TELNET_WONT:
+ telnetState = STATE_WONT_RECEIVED;
+ break;
+
+ case TELNET_DO:
+ telnetState = STATE_DO_RECEIVED;
+ break;
+
+ case TELNET_DONT:
+ telnetState = STATE_DONT_RECEIVED;
+ break;
+
+ case TELNET_SB:
+ telnetState = STATE_SUBNEGOTIATION_STARTED;
+ break;
+
+ // Commands to consume and ignore.
+
+ // Data Mark (DM). This is sent by a TELNET server following an
+ // IAC sent as TCP urgent data. It should cause the client to
+ // skip all not yet processed non-TELNET-protocol data preceding the
+ // DM byte. However, Java 1.4.x has no way to inform clients of
+ // class Socket that urgent data is available, so we simply ignore the
+ // "IAC DM" command. Since the IAC is sent as TCP urgent data,
+ // the Socket must be put into OOB-inline mode via a call to
+ // setOOBInline(true), otherwise the IAC is silently dropped by
+ // Java and only the DM arrives (leaving the user to see a
+ // spurious ISO Latin-1 character).
+ case TELNET_DM:
+
+ case TELNET_NOP: // No-op.
+ case TELNET_GA: // Go Ahead command. Meaningless on a full-duplex link.
+ case TELNET_IP: // Interupt Process command. Server should never send this.
+ case TELNET_AO: // Abort Output command. Server should never send this.
+ case TELNET_AYT: // Are You There command. Server should never send this.
+ case TELNET_EC: // Erase Character command. Server should never send this.
+ case TELNET_EL: // Erase Line command. Server should never send this.
+ telnetState = STATE_INITIAL;
+ break;
+
+ default:
+ // Unrecognized command! This should never happen.
+ Logger.log("processTelnetProtocol: UNRECOGNIZED TELNET PROTOCOL COMMAND: " + //$NON-NLS-1$
+ ubyte);
+ telnetState = STATE_INITIAL;
+ break;
+ }
+ break;
+
+ // For the next four cases, WILL and WONT commands affect the state
+ // of remote options, and DO and DONT commands affect the state of
+ // local options.
+
+ case STATE_WILL_RECEIVED:
+ Logger.log("Received WILL " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ remoteOptions[ubyte].handleWill();
+ telnetState = STATE_INITIAL;
+ telnetServerDetected();
+ break;
+
+ case STATE_WONT_RECEIVED:
+ Logger.log("Received WONT " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ remoteOptions[ubyte].handleWont();
+ telnetState = STATE_INITIAL;
+ telnetServerDetected();
+ break;
+
+ case STATE_DO_RECEIVED:
+ Logger.log("Received DO " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ localOptions[ubyte].handleDo();
+ telnetState = STATE_INITIAL;
+ telnetServerDetected();
+ break;
+
+ case STATE_DONT_RECEIVED:
+ Logger.log("Received DONT " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ localOptions[ubyte].handleDont();
+ telnetState = STATE_INITIAL;
+ telnetServerDetected();
+ break;
+
+ case STATE_SUBNEGOTIATION_STARTED:
+ Logger.log("Starting subnegotiation for option " + //$NON-NLS-1$
+ localOptions[ubyte].optionName() + "."); //$NON-NLS-1$
+
+ // First, zero out the array of received subnegotiation butes.
+
+ for (int i = 0; i < receivedSubnegotiation.length; ++i)
+ receivedSubnegotiation[i] = 0;
+
+ // Forget about any previous subnegotiation errors.
+
+ ignoreSubnegotiation = false;
+
+ // Then insert this input byte into the array and enter state
+ // STATE_RECEIVING_SUBNEGOTIATION, where we will gather the
+ // remaining subnegotiation bytes.
+
+ nextSubnegotiationByteIndex = 0;
+ receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte;
+ telnetState = STATE_RECEIVING_SUBNEGOTIATION;
+ break;
+
+ case STATE_RECEIVING_SUBNEGOTIATION:
+ if (inputByte == TELNET_IAC) {
+ // Handle double IAC bytes. From RFC 855: "if parameters
+ // in an option 'subnegotiation' include a byte with a value
+ // of 255, it is necessary to double this byte in accordance
+ // the general TELNET rules."
+
+ if (nextSubnegotiationByteIndex > 0
+ && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) {
+ // The last input byte we received in this
+ // subnegotiation was IAC, so this is a double IAC. Leave the previous IAC
+ // in the receivedSubnegotiation[] array and drop the current
+ // one (thus translating a double IAC into a single IAC).
+
+ Logger.log("Double IAC in subnegotiation translated into single IAC."); //$NON-NLS-1$
+ break;
+ }
+
+ // Append the IAC byte to receivedSubnegotiation[]. If there
+ // is no room for the IAC byte, it overwrites the last byte,
+ // because we need to know when the subnegotiation ends, and that is
+ // marked by an "IAC SE" command.
+
+ if (nextSubnegotiationByteIndex < receivedSubnegotiation.length) {
+ receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte;
+ } else {
+ receivedSubnegotiation[receivedSubnegotiation.length - 1] = inputByte;
+ }
+ break;
+ }
+
+ // Handle an "IAC SE" command, which marks the end of the
+ // subnegotiation. An SE byte by itself might be a legitimate
+ // part of the subnegotiation data, so don't do anything unless the SE
+ // is immediately preceded by an IAC.
+
+ if (inputByte == TELNET_SE && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) {
+ Logger.log("Found SE code marking end of subnegotiation."); //$NON-NLS-1$
+
+ // We are done receiving the subnegotiation command. Now
+ // process it. We always use the option object stored in array
+ // localOptions[] to process the received subnegotiation.
+ // This is an arbitrary decision, but it is sufficient for handling
+ // options TERMINAL-TYPE and NAWS, which are the only options that
+ // we subnegotiate (presently). If, in the future,subnegotiations
+ // need to be handled by option objects stored in both
+ // localOptions[] and remoteOptions[], then some mechanism
+ // to choose the correct option object must be implemented.
+ //
+ // Also, if ignoreSubnegotiation is true, there was an error
+ // while receiving the subnegotiation, so we must not process the
+ // command, and instead just return to the initial state.
+
+ if (!ignoreSubnegotiation) {
+ // Remove the trailing IAC byte from
+ // receivedSubnegotiation[].
+
+ receivedSubnegotiation[nextSubnegotiationByteIndex - 1] = 0;
+
+ int subnegotiatedOption = receivedSubnegotiation[0] & 0xFF;
+
+ localOptions[subnegotiatedOption].handleSubnegotiation(receivedSubnegotiation,
+ nextSubnegotiationByteIndex);
+ } else {
+ Logger.log("NOT CALLING handleSubnegotiation() BECAUSE OF ERRORS!"); //$NON-NLS-1$
+ }
+
+ // Return to the initial state.
+
+ telnetState = STATE_INITIAL;
+ }
+
+ // Check whether the receivedSubnegotiation[] array is full.
+
+ if (nextSubnegotiationByteIndex >= receivedSubnegotiation.length) {
+ // This should not happen. Array receivedSubnegotiation can
+ // hold 128 bytes, and no TELNET option that we perform
+ // subnegotiation for requires that many bytes in a subnegotiation command.
+ // In the interest of robustness, we handle this case by ignoring all
+ // remaining subnegotiation bytes until we receive the IAC SE
+ // command that ends the subnegotiation. Also, we set
+ // ignoreSubnegotiation to true to prevent a call to
+ // handleSubnegotiation() when the IAC SE command arrives.
+
+ Logger.log("SUBNEGOTIATION BUFFER FULL!"); //$NON-NLS-1$
+ ignoreSubnegotiation = true;
+ } else {
+ Logger.log("Recording subnegotiation byte " + ubyte); //$NON-NLS-1$
+
+ receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte;
+ }
+ break;
+
+ default:
+ // This should _never_ happen! If it does, it means there is a
+ // bug in this FSA. For robustness, we return to the initial state.
+
+ Logger.log("INVALID TELNET STATE: " + telnetState); //$NON-NLS-1$
+ telnetState = STATE_INITIAL;
+ break;
+ }
+ }
+
+ // Return the number of bytes of processed data (i.e., number of bytes
+ // of raw data minus TELNET control bytes). This value can be zero.
+
+ return nextProcessedByte;
+ }
+
+ /**
+ * This method is called whenever we receive a valid TELNET protocol command
+ * from the remote endpoint. When it is called for the first time for this
+ * connection, we negotiate all options that we desire to be enabled.
+ *
+ *
+ * This method does not negotiate options that we do not desire to be
+ * enabled, because all options are initially disabled.
+ *
+ */
+ protected void telnetServerDetected() {
+ if (!remoteIsTelnetServer) {
+ // This block only executes once per TelnetConnection instance.
+
+ localEcho = false;
+
+ Logger.log("Detected TELNET server."); //$NON-NLS-1$
+
+ remoteIsTelnetServer = true;
+
+ for (int i = 0; i < localOptions.length; ++i) {
+ if (localOptions[i].isDesired()) {
+ localOptions[i].negotiate();
+ }
+ }
+
+ for (int i = 0; i < remoteOptions.length; ++i) {
+ if (remoteOptions[i].isDesired()) {
+ remoteOptions[i].negotiate();
+ }
+ }
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnector.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnector.java
new file mode 100644
index 00000000000..5ac0865364b
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetConnector.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalControl
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
+ * Sean Adams (Cisco) - [231959][terminal][telnet] NPE in TelnetConnector.java
+ * David Sciamma (Anyware-Tech) - [288254][telnet] local echo is always disabled
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.NullSettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
+
+public class TelnetConnector extends TerminalConnectorImpl {
+
+ static final class TelnetOutputStream extends FilterOutputStream {
+ final static byte CR = 13;
+ final static byte LF = 10;
+ final static byte NUL = 0;
+ final static byte[] CRNUL = { CR, NUL };
+ final static byte[] CRLF = { CR, LF };
+ final byte[] EOL;
+
+ public TelnetOutputStream(OutputStream outputStream, String endOfLine) {
+ super(outputStream);
+ if (ITelnetSettings.EOL_CRLF.equals(endOfLine))
+ EOL = CRLF;
+ else
+ EOL = CRNUL;
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ if (b == CR)
+ out.write(EOL);
+ else
+ out.write(b);
+ }
+ }
+
+ private OutputStream fOutputStream;
+ private InputStream fInputStream;
+ private Socket fSocket;
+ private TelnetConnection fTelnetConnection;
+ private final TelnetSettings fSettings;
+ private int fWidth = -1;
+ private int fHeight = -1;
+
+ public TelnetConnector() {
+ this(new TelnetSettings());
+ }
+ public TelnetConnector(TelnetSettings settings) {
+ fSettings=settings;
+ }
+ @Override
+ public void connect(ITerminalControl control) {
+ super.connect(control);
+ fWidth=-1;
+ fHeight=-1;
+ // TERM=xterm implies VT100 line wrapping mode
+ control.setVT100LineWrapping(true);
+ TelnetConnectWorker worker = new TelnetConnectWorker(this,control);
+ worker.start();
+ }
+ @Override
+ public void doDisconnect() {
+ if (getSocket() != null) {
+ try {
+ getSocket().close();
+ } catch (Exception exception) {
+ Logger.logException(exception);
+ }
+ }
+
+ if (getInputStream() != null) {
+ try {
+ getInputStream().close();
+ } catch (Exception exception) {
+ Logger.logException(exception);
+ }
+ }
+
+ if (getTerminalToRemoteStream() != null) {
+ try {
+ getTerminalToRemoteStream().close();
+ } catch (Exception exception) {
+ Logger.logException(exception);
+ }
+ }
+ cleanSocket();
+ }
+ @Override
+ public boolean isLocalEcho() {
+ if(fTelnetConnection==null)
+ return false;
+ return fTelnetConnection.localEcho();
+ }
+ @Override
+ public void setTerminalSize(int newWidth, int newHeight) {
+ if(fTelnetConnection!=null && (newWidth!=fWidth || newHeight!=fHeight)) {
+ //avoid excessive communications due to change size requests by caching previous size
+ fTelnetConnection.setTerminalSize(newWidth, newHeight);
+ fWidth=newWidth;
+ fHeight=newHeight;
+ }
+ }
+ public InputStream getInputStream() {
+ return fInputStream;
+ }
+ @Override
+ public OutputStream getTerminalToRemoteStream() {
+ return fOutputStream;
+ }
+ private void setInputStream(InputStream inputStream) {
+ fInputStream = inputStream;
+ }
+ private void setOutputStream(OutputStream outputStream) {
+ if (outputStream == null) {
+ fOutputStream = null;
+ return;
+ }
+ // translate CR to telnet end-of-line sequence - RFC 854
+ fOutputStream = new TelnetOutputStream(outputStream, fSettings.getEndOfLine());
+ }
+ Socket getSocket() {
+ return fSocket;
+ }
+
+ /**
+ * sets the socket to null
+ */
+ void cleanSocket() {
+ fSocket=null;
+ setInputStream(null);
+ setOutputStream(null);
+ }
+
+ void setSocket(Socket socket) throws IOException {
+ if(socket==null) {
+ cleanSocket();
+ } else {
+ fSocket = socket;
+ setInputStream(socket.getInputStream());
+ setOutputStream(socket.getOutputStream());
+ }
+
+ }
+ public void setTelnetConnection(TelnetConnection connection) {
+ fTelnetConnection=connection;
+ }
+ public void displayTextInTerminal(String text) {
+ fControl.displayTextInTerminal(text);
+ }
+ public OutputStream getRemoteToTerminalOutputStream () {
+ return fControl.getRemoteToTerminalOutputStream();
+ }
+ public void setState(TerminalState state) {
+ fControl.setState(state);
+ }
+ public ITelnetSettings getTelnetSettings() {
+ return fSettings;
+ }
+ @Override
+ public void setDefaultSettings() {
+ fSettings.load(new NullSettingsStore());
+ }
+ @Override
+ public String getSettingsSummary() {
+ return fSettings.getSummary();
+ }
+ @Override
+ public void load(ISettingsStore store) {
+ fSettings.load(store);
+ }
+ @Override
+ public void save(ISettingsStore store) {
+ fSettings.save(store);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.java
new file mode 100644
index 00000000000..ed3ed05dfa4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import org.eclipse.osgi.util.NLS;
+
+public class TelnetMessages extends NLS {
+ static {
+ NLS.initializeMessages(TelnetMessages.class.getName(), TelnetMessages.class);
+ }
+ public static String PORT;
+ public static String HOST;
+ public static String CONNECTION_CLOSED_BY_FOREIGN_HOST;
+ public static String TIMEOUT;
+ /**
+ * @since 4.2
+ */
+ public static String END_OF_LINE;
+
+ }
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.properties
new file mode 100644
index 00000000000..77acc43ec40
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetMessages.properties
@@ -0,0 +1,23 @@
+###############################################################################
+# Copyright (c) 2005, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Initial Contributors:
+# The following Wind River employees contributed to the Terminal component
+# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+# Helmut Haigermoser and Ted Williams.
+#
+# Contributors:
+# Michael Scharf (Wind River) - split into core, view and connector plugins
+# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+###############################################################################
+PORT = Port
+HOST = Host
+CONNECTION_CLOSED_BY_FOREIGN_HOST= Connection closed by foreign host.
+TIMEOUT = Timeout (sec)
+END_OF_LINE = End of Line
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetOption.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetOption.java
new file mode 100644
index 00000000000..e97c9a1baa6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetOption.java
@@ -0,0 +1,701 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - split into core, view and connector plugins
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Martin Oberhuber (Wind River) - [267181] Fix telnet option negotiation loop
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
+
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+
+/**
+ * This class represents a single TELNET protocol option at one endpoint of a TELNET
+ * connection. This class encapsulates the endpoint associated with the option (local
+ * or remote), the current state of the option (enabled or disabled), the desired state
+ * of the option, the current state of the negotiation, an OutputStream that allows
+ * communication with the remote endpoint, and the number of negotiations that have
+ * started within this connection.
+ *
+ * In addition to encapsulating the above state, this class performs option negotiation
+ * to attempt to achieve the desired option state. For some options, this class also
+ * performs option sub-negotiation.
+ *
+ * IMPORTANT: Understanding this code requires understanding the TELNET protocol and
+ * TELNET option processing.
+ *
+ * This constant and the others having similar names represent the states of a
+ * finite state automaton (FSA) that tracks the negotiation state of this option.
+ * The initial state is NEGOTIATION_NOT_STARTED. The state machine is as follows
+ * (with transitions labeled with letters in parentheses):
+ *
+ * Once the FSA leaves state NEGOTIATION_NOT_STARTED, it never returns to that
+ * state. Transition A happens when the local endpoint sends an option command
+ * before receiving a command for the same option from the remote endpoint.
+ *
+ * Transition B happens when the local endpoint receives a reply to an option
+ * command sent earlier by the local endpoint. Receipt of that reply terminates
+ * the negotiation.
+ *
+ * Transition D happens after negotiation is done and "something changes" (see the
+ * RFCs for the definition of "something changes"). Either endpoint can
+ * re-negotiate an option after a previous negotiation, but only if some external
+ * influence (such as the user or the OS) causes it to do so. Re-negotiation must
+ * start more than {@link #NEGOTIATION_IGNORE_DURATION} milliseconds after the FSA
+ * enters state NEGOTIATION_DONE or it will be ignored. This is how this client
+ * prevents negotiation loops.
+ *
+ * Transition C happens when the local endpoint receives an option command from the
+ * remote endpoint before sending a command for the same option. In that case, the
+ * local endpoint replies immediately with an option command and the negotiation
+ * terminates.
+ *
+ * Some TELNET servers (e.g., the Solaris server), after sending WILL and receiving
+ * DONT, will reply with a superfluous WONT. Any such superfluous option command
+ * received from the remote endpoint while the option's FSA is in state
+ * {@link #NEGOTIATION_DONE} will be ignored by the local endpoint.
+ */
+ protected static final int NEGOTIATION_NOT_STARTED = 0;
+
+ /** Negotiation state: Negotiation is in progress for this option. */
+ protected static final int NEGOTIATION_IN_PROGRESS = 1;
+
+ /** Negotiation state: Negotiation has terminated for this option. */
+ protected static final int NEGOTIATION_DONE = 2;
+
+ /**
+ * The number of milliseconds following the end of negotiation of this option
+ * before which the remote endpoint can re-negotiate the option. Any option
+ * command received from the remote endpoint before this time passes is ignored.
+ * This is used to prevent option negotiation loops.
+ *
+ * @see #ignoreNegotiation()
+ * @see #negotiationCompletionTime
+ */
+ protected static final int NEGOTIATION_IGNORE_DURATION = 30000;
+
+ /**
+ * This field holds the current negotiation state for this option.
+ */
+ protected int negotiationState = NEGOTIATION_NOT_STARTED;
+
+ /**
+ * This field holds the time when negotiation of this option most recently
+ * terminated (i.e., entered state {@link #NEGOTIATION_DONE}). This is used to
+ * determine whether an option command received from the remote endpoint after
+ * negotiation has terminated for this option is to be ignored or interpreted as
+ * the start of a new negotiation.
+ *
+ * @see #NEGOTIATION_IGNORE_DURATION
+ */
+ protected Date negotiationCompletionTime = new Date(0);
+
+ /**
+ * Holds the total number of negotiations that have completed for this option.
+ */
+ protected int negotiationCount = 0;
+
+ /**
+ * Holds the integer code representing the option.
+ */
+ protected byte option = 0;
+
+ /**
+ * Holds the OutputStream object that allows data to be sent to the remote endpoint
+ * of the TELNET connection.
+ */
+ protected OutputStream outputStream;
+
+ /**
+ * True if this option is for the local endpoint, false for the remote endpoint.
+ */
+ protected boolean local = true;
+
+ /**
+ * This field is true if the option is enabled, false if it is disabled. All
+ * options are initially disabled until they are negotiated to be enabled.
+ */
+ protected boolean enabled = false;
+
+ /**
+ * This field is true if the client desires the option to be enabled, false if the
+ * client desires the option to be disabled. This field does not represent the
+ * remote's endpoints desire (as expressed via WILL and WONT commands) -- it
+ * represnet the local endpoint's desire.
+ *
+ * @param option The integer code of this option.
+ * @param desired Whether we desire this option to be enabled.
+ * @param local Whether this option is for the local or remote endpoint.
+ * @param outputStream A stream used to negotiate with the remote endpoint.
+ */
+ TelnetOption(byte option, boolean desired, boolean local,
+ OutputStream outputStream) {
+ this.option = option;
+ this.desired = desired;
+ this.local = local;
+ this.outputStream = outputStream;
+ }
+
+ /**
+ * @return Returns a String containing the name of the TELNET option specified in
+ * parameter option.
+ */
+ public String optionName() {
+ return optionNames[option & 0xFF];
+ }
+
+ /**
+ * Returns true if this option is enabled, false if it is disabled.
+ *
+ * @return Returns true if this option is enabled, false if it is disabled.
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * Enables this option if newValue is true, otherwise disables this
+ * option.
+ *
+ * @param newValue True if this option is to be enabled, false otherwise.
+ */
+ public void setEnabled(boolean newValue) {
+ Logger.log("Enabling " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ optionName());
+ enabled = newValue;
+ }
+
+ /**
+ * Returns true if the local endpoint desires this option to be enabled, false if
+ * not. It is not an error for the value returned by this method to differ from
+ * the value returned by isEnabled(). The value returned by this method can change
+ * over time, reflecting the local endpoint's changing desire regarding the
+ * option.
+ *
+ * NOTE: Even if this option represents a remote endpoint option, the return value
+ * of this method represents the local endpint's desire regarding the remote
+ * option.
+ *
+ * @return Returns true if the local endpoint desires this option to be enabled,
+ * false if not.
+ */
+ public boolean isDesired() {
+ return desired;
+ }
+
+ /**
+ * Sets our desired value for this option. Note that the option can be desired
+ * when enabled is false, and the option can be undesired when
+ * enabled is true, though the latter state should not persist, since either
+ * endpoint can disable any option at any time.
+ *
+ * @param newValue True if we desire this option to be enabled, false if
+ * we desire this option to be disabled.
+ */
+ public void setDesired(boolean newValue) {
+ if (newValue)
+ Logger.log("Setting " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ optionName() + " as desired."); //$NON-NLS-1$
+
+ desired = newValue;
+ }
+
+ /**
+ * Call this method to request that negotiation begin for this option. This method
+ * does nothing if negotiation for this option has already started or is already
+ * complete. If negotiation has not yet started for this option and the local
+ * endpoint desires this option to be enabled, then we send a WILL or DO command to
+ * the remote endpoint.
+ */
+ public void negotiate() {
+ if (negotiationState == NEGOTIATION_NOT_STARTED && desired) {
+ if (local) {
+ Logger
+ .log("Starting negotiation for local option " + optionName()); //$NON-NLS-1$
+ sendWill();
+ } else {
+ Logger
+ .log("Starting negotiation for remote option " + optionName()); //$NON-NLS-1$
+ sendDo();
+ }
+
+ negotiationState = NEGOTIATION_IN_PROGRESS;
+ }
+ }
+
+ /**
+ * This method is called whenever we receive a WILL command from the remote
+ * endpoint.
+ */
+ public void handleWill() {
+ if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) {
+ Logger
+ .log("Ignoring superfluous WILL command from remote endpoint."); //$NON-NLS-1$
+ return;
+ }
+
+ if (negotiationState == NEGOTIATION_IN_PROGRESS) {
+ if (desired) {
+ // We sent DO and server replied with WILL. Enable the option, and end
+ // this negotiation.
+
+ enabled = true;
+ Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // This should never happen! We sent DONT and the server replied with
+ // WILL. Bad server. No soup for you. Disable the option, and end
+ // this negotiation.
+
+ Logger.log("Server answered DONT with WILL!"); //$NON-NLS-1$
+ enabled = false;
+ Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ } else {
+ if (desired) {
+ // Server sent WILL, so we reply with DO. Enable the option, and end
+ // this negotiation.
+
+ sendDo();
+ enabled = true;
+ Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // Server sent WILL, so we reply with DONT. Disable the option, and
+ // end this negotiation.
+
+ sendDont();
+ enabled = false;
+ Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ }
+ }
+
+ /**
+ * Handles a WONT command sent by the remote endpoint for this option. The value
+ * of desired doesn't matter in this method, because the remote endpoint is
+ * forcing the option to be disabled.
+ */
+ public void handleWont() {
+ if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) {
+ Logger
+ .log("Ignoring superfluous WONT command from remote endpoint."); //$NON-NLS-1$
+ return;
+ }
+
+ if (negotiationState == NEGOTIATION_IN_PROGRESS) {
+ // We sent DO or DONT and server replied with WONT. Disable the
+ // option, and end this negotiation.
+
+ enabled = false;
+ Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // Server sent WONT, so we reply with DONT. Disable the option, and
+ // end this negotiation.
+
+ sendDont();
+ enabled = false;
+ Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ }
+
+ /**
+ * Handles a DO command sent by the remote endpoint for this option.
+ */
+ public void handleDo() {
+ if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) {
+ Logger.log("Ignoring superfluous DO command from remote endpoint."); //$NON-NLS-1$
+ return;
+ }
+
+ if (negotiationState == NEGOTIATION_IN_PROGRESS) {
+ if (desired) {
+ // We sent WILL and server replied with DO. Enable the option, and end
+ // this negotiation.
+
+ enabled = true;
+ Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // We sent WONT and server replied with DO. This should never happen!
+ // Bad server. No soup for you. Disable the option, and end this
+ // negotiation.
+
+ Logger.log("Server answered WONT with DO!"); //$NON-NLS-1$
+ enabled = false;
+ Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ } else {
+ if (desired) {
+ // Server sent DO, so we reply with WILL. Enable the option, and end
+ // this negotiation.
+
+ sendWill();
+ enabled = true;
+ Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // Server sent DO, so we reply with WONT. Disable the option, and end
+ // this negotiation.
+
+ sendWont();
+ enabled = false;
+ Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ }
+ }
+
+ /**
+ * Handles a DONT command sent by the remote endpoint for this option. The value
+ * of desired doesn't matter in this method, because the remote endpoint is
+ * forcing the option to be disabled.
+ */
+ public void handleDont() {
+ if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) {
+ Logger
+ .log("Ignoring superfluous DONT command from remote endpoint."); //$NON-NLS-1$
+ return;
+ }
+
+ if (negotiationState == NEGOTIATION_IN_PROGRESS) {
+ // We sent WILL or WONT and server replied with DONT. Disable the
+ // option, and end this negotiation.
+
+ enabled = false;
+ Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ } else {
+ // Server sent DONT, so we reply with WONT. Disable the option, and end
+ // this negotiation.
+
+ sendWont();
+ enabled = false;
+ Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$
+ endNegotiation();
+ }
+ }
+
+ /**
+ * This method handles a subnegotiation command received from the remote endpoint.
+ * Currently, the only subnegotiation we handle is when the remote endpoint
+ * commands us to send our terminal type (which is "xterm").
+ *
+ * @param subnegotiationData An array of bytes containing a TELNET
+ * subnegotiation command received from the
+ * remote endpoint.
+ * @param count The number of bytes in array
+ * subnegotiationData to examine.
+ */
+ public void handleSubnegotiation(byte[] subnegotiationData, int count) {
+ switch (option) {
+ case TELNET_OPTION_TERMINAL_TYPE:
+ if (subnegotiationData[1] != TELNET_SEND) {
+ // This should never happen!
+ Logger
+ .log("Invalid TERMINAL-TYPE subnegotiation command from remote endpoint: " + //$NON-NLS-1$
+ (subnegotiationData[1] & 0xff));
+ break;
+ }
+
+ // Tell the remote endpoint our terminal type is "xterm" using this sequence
+ // of TELNET protocol bytes:
+ //
+ // IAC SB TERMINAL-TYPE IS x t e r m IAC SE
+
+ byte[] terminalTypeData = { TELNET_IAC, TELNET_SB,
+ TELNET_OPTION_TERMINAL_TYPE, TELNET_IS, (byte) 'x',
+ (byte) 't', (byte) 'e', (byte) 'r', (byte) 'm', TELNET_IAC, TELNET_SE };
+
+ try {
+ outputStream.write(terminalTypeData);
+ } catch (IOException ex) {
+ Logger.log("IOException sending TERMINAL-TYPE subnegotiation!"); //$NON-NLS-1$
+ Logger.logException(ex);
+ }
+ break;
+
+ default:
+ // This should never happen!
+ Logger
+ .log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$
+ break;
+ }
+ }
+
+ /**
+ * This method sends a subnegotiation command to the remote endpoint.
+ *
+ * @param subnegotiationData An array of Objects holding data to be used
+ * when generating the outbound subnegotiation
+ * command.
+ */
+ public void sendSubnegotiation(Object[] subnegotiationData) {
+ switch (option) {
+ case TELNET_OPTION_NAWS:
+ // Get the width and height of the view and send it to the remote
+ // endpoint using this sequence of TELNET protocol bytes:
+ //
+ // IAC SB NAWS
+ // IAC SE
+
+ final byte[] NAWSData = { TELNET_IAC, TELNET_SB, TELNET_OPTION_NAWS, 0,
+ 0, 0, 0, TELNET_IAC, TELNET_SE };
+ int width = ((Integer) subnegotiationData[0]).intValue();
+ int height = ((Integer) subnegotiationData[1]).intValue();
+
+ NAWSData[3] = (byte) ((width >>> 8) & 0xff); // High order byte of width.
+ NAWSData[4] = (byte) (width & 0xff); // Low order byte of width.
+ NAWSData[5] = (byte) ((height >>> 8) & 0xff); // High order byte of height.
+ NAWSData[6] = (byte) (height & 0xff); // Low order byte of height.
+
+ Logger
+ .log("sending terminal size to remote endpoint: width = " + width + //$NON-NLS-1$
+ ", height = " + height + "."); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Send the NAWS data in a new thread. The current thread is the display
+ // thread, and calls to write() can block, but blocking the display thread
+ // is _bad_ (it hangs the GUI).
+
+ Thread t=new Thread() {
+ @Override
+ public void run() {
+ try {
+ outputStream.write(NAWSData);
+ } catch (IOException ex) {
+ Logger.log("IOException sending NAWS subnegotiation!"); //$NON-NLS-1$
+ Logger.logException(ex);
+ }
+ }
+ };
+ t.setDaemon(true);
+ t.start();
+ break;
+
+ default:
+ // This should never happen!
+ Logger
+ .log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$
+ break;
+ }
+ }
+
+ /**
+ * This method returns true if there has not yet been any negotiation of this
+ * option.
+ *
+ * @return Returns true if there has not yet been any negotiation of this option.
+ */
+ protected boolean notYetNegotiated() {
+ return negotiationState == NEGOTIATION_NOT_STARTED;
+ }
+
+ /**
+ * This method terminates the current negotiation and records the time at which the
+ * negotiation terminated.
+ */
+ protected void endNegotiation() {
+ Logger.log("Ending negotiation #" + negotiationCount + " for " + //$NON-NLS-1$ //$NON-NLS-2$
+ (local ? "local" : "remote") + " option " + optionName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ negotiationState = NEGOTIATION_DONE;
+ negotiationCompletionTime.setTime(System.currentTimeMillis());
+ ++negotiationCount;
+ }
+
+ /**
+ * This method determines whether or not to ignore what appears to be a new
+ * negotiation initiated by the remote endpoint. This is needed because some
+ * TELNET servers send superfluous option commands that a naive client might
+ * interpret as the start of a new negotiation. If the superfluous command is not
+ * ignored, an option negotiation loop can result (which is bad). For details
+ * about the superfluous commands sent by some servers, see the documentation for
+ * {@link #NEGOTIATION_NOT_STARTED}.
+ *
+ * The current implementation of this method returns true if the new negotiation
+ * starts within NEGOTIATION_IGNORE_DURATION seconds of the end of the previous
+ * negotiation of this option.
+ *
+ * @return Returns true if the new negotiation should be ignored, false if not.
+ */
+ protected boolean ignoreNegotiation() {
+ return (System.currentTimeMillis() - negotiationCompletionTime.getTime()) < NEGOTIATION_IGNORE_DURATION;
+ }
+
+ /**
+ * Sends a DO command to the remote endpoint for this option.
+ */
+ protected void sendDo() {
+ Logger.log("Sending DO " + optionName()); //$NON-NLS-1$
+ sendCommand(TELNET_DO);
+ }
+
+ /**
+ * Sends a DONT command to the remote endpoint for this option.
+ */
+ protected void sendDont() {
+ Logger.log("Sending DONT " + optionName()); //$NON-NLS-1$
+ sendCommand(TELNET_DONT);
+ }
+
+ /**
+ * Sends a WILL command to the remote endpoint for this option.
+ */
+ protected void sendWill() {
+ Logger.log("Sending WILL " + optionName()); //$NON-NLS-1$
+ sendCommand(TELNET_WILL);
+ }
+
+ /**
+ * Sends a WONT command to the remote endpoint for this option.
+ */
+ protected void sendWont() {
+ Logger.log("Sending WONT " + optionName()); //$NON-NLS-1$
+ sendCommand(TELNET_WONT);
+ }
+
+ /**
+ * This method sends a WILL/WONT/DO/DONT command to the remote endpoint for this
+ * option.
+ */
+ protected void sendCommand(byte command) {
+ byte[] data = { TELNET_IAC, 0, 0 };
+
+ data[1] = command;
+ data[2] = option;
+
+ try {
+ outputStream.write(data);
+ } catch (IOException ex) {
+ Logger.log("IOException sending command " + command); //$NON-NLS-1$
+ Logger.logException(ex);
+ }
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetProperties.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetProperties.java
new file mode 100644
index 00000000000..0af9feaa8f6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetProperties.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalProperties
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+public class TelnetProperties {
+ private final NetworkPortMap fNetworkPortMap;
+ private final String fDefaultHost;
+ private final String fDefaultNetworkPort;
+
+ public TelnetProperties() {
+ fNetworkPortMap = new NetworkPortMap();
+ fDefaultNetworkPort = fNetworkPortMap.getDefaultNetworkPort();
+ fDefaultHost = ""; //$NON-NLS-1$
+ }
+
+ public String getDefaultHost() {
+ return fDefaultHost;
+ }
+
+ public String getDefaultNetworkPort() {
+ return fDefaultNetworkPort;
+ }
+
+ public NetworkPortMap getNetworkPortMap() {
+ // TODO Auto-generated method stub
+ return fNetworkPortMap;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettings.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettings.java
new file mode 100644
index 00000000000..40d8ca5f492
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettings.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalSettings
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+
+/**
+ * @noreference This class is not intended to be referenced by clients.
+ */
+public class TelnetSettings implements ITelnetSettings {
+ protected String fHost;
+ protected String fNetworkPort;
+ protected String fTimeout;
+ protected String fEndOfLine = EOL_CRNUL;
+ private final TelnetProperties fProperties=new TelnetProperties();
+ @Override
+ public String getHost() {
+ return fHost;
+ }
+
+ public void setHost(String strHost) {
+ fHost = strHost;
+ }
+
+ public String getNetworkPortString() {
+ return fNetworkPort;
+ }
+
+ @Override
+ public int getNetworkPort() {
+ try {
+ return Integer.parseInt(fNetworkPort);
+ } catch (NumberFormatException numberFormatException) {
+ return 1313;
+ }
+ }
+
+ public void setNetworkPort(String strNetworkPort) {
+ fNetworkPort = strNetworkPort;
+ }
+
+ @Override
+ public String getSummary() {
+ return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$
+ }
+
+ @Override
+ public void load(ISettingsStore store) {
+ fHost = store.get("Host", fProperties.getDefaultHost());//$NON-NLS-1$
+ fNetworkPort = store.get("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$
+ fTimeout = store.get("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$
+ fEndOfLine = store.get("EndOfLine", EOL_CRNUL);//$NON-NLS-1$
+ }
+
+ @Override
+ public void save(ISettingsStore store) {
+ store.put("Host", fHost);//$NON-NLS-1$
+ store.put("NetworkPort", fNetworkPort);//$NON-NLS-1$
+ store.put("Timeout", fTimeout);//$NON-NLS-1$
+ store.put("EndOfLine", fEndOfLine);//$NON-NLS-1$
+ }
+
+ public TelnetProperties getProperties() {
+ return fProperties;
+ }
+ @Override
+ public int getTimeout() {
+ try {
+ return Integer.parseInt(fTimeout);
+ } catch (NumberFormatException numberFormatException) {
+ return 10;
+ }
+ }
+ public String getTimeoutString() {
+ return fTimeout;
+ }
+
+ public void setTimeout(String timeout) {
+ fTimeout = timeout;
+ }
+
+ public void setEndOfLine(String eol) {
+ fEndOfLine = EOL_CRLF.equals(eol) ? EOL_CRLF : EOL_CRNUL;
+ }
+
+ @Override
+ public String getEndOfLine() {
+ return fEndOfLine;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettingsPage.java
new file mode 100644
index 00000000000..f40cfb76e9f
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/connector/TelnetSettingsPage.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Initial Contributors:
+ * The following Wind River employees contributed to the Terminal component
+ * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+ * Helmut Haigermoser and Ted Williams.
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - extracted from TerminalSettingsDlg
+ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+ * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings
+ * Martin Oberhuber (Wind River) - [401476] Strip whitespace around Telnet Port
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.connector;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+
+public class TelnetSettingsPage extends AbstractSettingsPage {
+ /* default */ Text fHostText;
+ /* default */ Combo fNetworkPortCombo;
+ /* default */ Text fTimeout;
+ /* default */ Combo fEndOfLineCombo;
+ private final TelnetSettings fTerminalSettings;
+
+ public TelnetSettingsPage(TelnetSettings settings) {
+ fTerminalSettings=settings;
+ }
+ @Override
+ public void saveSettings() {
+ fTerminalSettings.setHost(fHostText.getText());
+ fTerminalSettings.setTimeout(fTimeout.getText());
+ fTerminalSettings.setNetworkPort(getNetworkPort());
+ fTerminalSettings.setEndOfLine(getEndOfLine());
+ }
+
+ @Override
+ public void loadSettings() {
+ if(fTerminalSettings!=null) {
+ setHost(fTerminalSettings.getHost());
+ setTimeout(fTerminalSettings.getTimeoutString());
+ setNetworkPort(fTerminalSettings.getNetworkPortString());
+ setEndOfLine(fTerminalSettings.getEndOfLine());
+ }
+ }
+ private void setHost(String strHost) {
+ if(strHost==null)
+ strHost=""; //$NON-NLS-1$
+ fHostText.setText(strHost);
+
+ }
+ private void setTimeout(String timeout) {
+ if(timeout==null || timeout.length()==0)
+ timeout="5"; //$NON-NLS-1$
+ fTimeout.setText(timeout);
+
+ }
+ private void setNetworkPort(String strNetworkPort) {
+ if (strNetworkPort!=null) {
+ String strPortName = getNetworkPortMap().findPortName(strNetworkPort);
+ if(strPortName==null) {
+ strPortName=strNetworkPort; //fallback to verbatim port if not found
+ }
+ int nIndex = fNetworkPortCombo.indexOf(strPortName);
+
+ if (nIndex == -1) {
+ fNetworkPortCombo.setText(strNetworkPort);
+ } else {
+ fNetworkPortCombo.select(nIndex);
+ }
+ }
+ }
+ private String getNetworkPort() {
+ String portText = fNetworkPortCombo.getText().trim();
+ String mappedPort = getNetworkPortMap().findPort(portText);
+ return mappedPort!=null ? mappedPort : portText;
+ }
+ private NetworkPortMap getNetworkPortMap() {
+ return fTerminalSettings.getProperties().getNetworkPortMap();
+ }
+ private void setEndOfLine(String eol) {
+ int idx = fEndOfLineCombo.indexOf(eol);
+ fEndOfLineCombo.select(idx >= 0 ? idx : 0);
+ }
+ private String getEndOfLine() {
+ return fEndOfLineCombo.getText();
+ }
+ @Override
+ public boolean validateSettings() {
+ String message = null;
+ int messageType = IMessageProvider.NONE;
+ boolean valid = true;
+
+ if (fHostText.getText().trim().length() == 0) {
+ String m = "Please enter a host IP or name."; //$NON-NLS-1$
+ int mt = IMessageProvider.INFORMATION;
+ updateControlDecoration(fHostText, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fHostText, null, IMessageProvider.NONE);
+ }
+
+ try {
+ int p = Integer.parseInt(getNetworkPort());
+ if (p <= 0 || p > 65535) {
+ String m = "Invalid network port. Must be between 0 and 65535."; //$NON-NLS-1$
+ int mt = IMessageProvider.ERROR;
+ updateControlDecoration(fNetworkPortCombo, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fNetworkPortCombo, null, IMessageProvider.NONE);
+ }
+
+ p = Integer.parseInt(fTimeout.getText().trim());
+ if (p < 0) {
+ String m = "Invalid timeout. Must be greater than 0."; //$NON-NLS-1$
+ int mt = IMessageProvider.ERROR;
+ updateControlDecoration(fTimeout, m, mt);
+ if (mt > messageType) { message = m; messageType = mt; }
+
+ valid = false;
+ } else {
+ updateControlDecoration(fTimeout, null, IMessageProvider.NONE);
+ }
+
+ } catch (Exception e) {
+ valid = false;
+ }
+
+ setMessage(message, messageType);
+ return valid;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
+
+ composite.setLayout(gridLayout);
+ composite.setLayoutData(gridData);
+
+ // Add label
+ Label ctlLabel = new Label(composite, SWT.RIGHT);
+ ctlLabel.setText(TelnetMessages.HOST + ":"); //$NON-NLS-1$
+
+ // Add control
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ fHostText = new Text(composite, SWT.BORDER);
+ fHostText.setLayoutData(gridData);
+ fHostText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ fireListeners(fHostText);
+ }
+ });
+ createControlDecoration(fHostText);
+
+ // Add label
+ ctlLabel = new Label(composite, SWT.RIGHT);
+ ctlLabel.setText(TelnetMessages.PORT + ":"); //$NON-NLS-1$
+
+ // Add control
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ fNetworkPortCombo = new Combo(composite, SWT.DROP_DOWN);
+ fNetworkPortCombo.setLayoutData(gridData);
+ fNetworkPortCombo.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ fireListeners(fNetworkPortCombo);
+ }
+ });
+ fNetworkPortCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fireListeners(fNetworkPortCombo);
+ }
+ });
+ createControlDecoration(fNetworkPortCombo);
+
+ List table = getNetworkPortMap().getNameTable();
+ Collections.sort(table);
+ loadCombo(fNetworkPortCombo, table);
+
+ new Label(composite, SWT.RIGHT).setText(TelnetMessages.TIMEOUT + ":"); //$NON-NLS-1$
+ fTimeout = new Text(composite, SWT.BORDER);
+ fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fTimeout.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ fireListeners(fTimeout);
+ }
+ });
+ createControlDecoration(fTimeout);
+
+ new Label(composite, SWT.RIGHT).setText(TelnetMessages.END_OF_LINE + ":"); //$NON-NLS-1$
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ fEndOfLineCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ fEndOfLineCombo.setLayoutData(gridData);
+ fEndOfLineCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fireListeners(fEndOfLineCombo);
+ }
+ });
+ loadCombo(fEndOfLineCombo, Arrays.asList(ITelnetSettings.EOL_CRNUL, ITelnetSettings.EOL_CRLF));
+
+ loadSettings();
+ }
+ private void loadCombo(Combo ctlCombo, List table) {
+ for (Iterator iter = table.iterator(); iter.hasNext();) {
+ String label = iter.next();
+ ctlCombo.add(label);
+ }
+ }
+
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/controls/TelnetWizardConfigurationPanel.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/controls/TelnetWizardConfigurationPanel.java
new file mode 100644
index 00000000000..05ca464dbc6
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/controls/TelnetWizardConfigurationPanel.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [366374] [TERMINALS][TELNET] Add Telnet terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.controls;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
+import org.eclipse.tm.terminal.connector.telnet.connector.NetworkPortMap;
+import org.eclipse.tm.terminal.connector.telnet.connector.TelnetConnector;
+import org.eclipse.tm.terminal.connector.telnet.connector.TelnetSettings;
+import org.eclipse.tm.terminal.connector.telnet.connector.TelnetSettingsPage;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel;
+
+/**
+ * telnet wizard configuration panel implementation.
+ */
+public class TelnetWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
+
+ public TelnetSettings telnetSettings;
+ private ISettingsPage telnetSettingsPage;
+
+ /**
+ * Constructor.
+ *
+ * @param container The configuration panel container or null.
+ */
+ public TelnetWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ panel.setLayoutData(data);
+
+ // Create the host selection combo
+ if (isWithoutSelection()) createHostsUI(panel, true);
+
+ TelnetConnector conn = new TelnetConnector();
+ telnetSettings = (TelnetSettings) conn.getTelnetSettings();
+ telnetSettings.setHost(getSelectionHost());
+ // MWE otherwise we don't get a valid default selection of the combo
+ telnetSettings.setNetworkPort(NetworkPortMap.PROP_VALUETELNET);
+
+ telnetSettingsPage = new TelnetSettingsPage(telnetSettings);
+ if (telnetSettingsPage instanceof AbstractSettingsPage) {
+ ((AbstractSettingsPage)telnetSettingsPage).setHasControlDecoration(true);
+ }
+ telnetSettingsPage.createControl(panel);
+
+ // Add the listener to the settings page
+ telnetSettingsPage.addListener(new ISettingsPage.Listener() {
+
+ @Override
+ public void onSettingsPageChanged(Control control) {
+ if (getContainer() != null) getContainer().validate();
+ }
+ });
+
+ // Create the encoding selection combo
+ createEncodingUI(panel, true);
+
+ setControl(panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#setupData(java.util.Map)
+ */
+ @Override
+ public void setupData(Map data) {
+ if (data == null || telnetSettings == null || telnetSettingsPage == null) return;
+
+ String value = (String)data.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+ if (value != null) telnetSettings.setHost(value);
+
+ Object v = data.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ value = v != null ? v.toString() : null;
+ if (value != null) telnetSettings.setNetworkPort(value);
+
+ v = data.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ value = v != null ? v.toString() : null;
+ if (value != null) telnetSettings.setTimeout(value);
+
+ v = data.get(ITerminalsConnectorConstants.PROP_TELNET_EOL);
+ value = v != null ? v.toString() : null;
+ if (value != null) telnetSettings.setEndOfLine(value);
+
+ value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) setEncoding(value);
+
+ telnetSettingsPage.loadSettings();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#extractData(java.util.Map)
+ */
+ @Override
+ public void extractData(Map data) {
+ if (data == null) return;
+
+ // set the terminal connector id for ssh
+ data.put(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID, "org.eclipse.tm.terminal.connector.telnet.TelnetConnector"); //$NON-NLS-1$
+
+ telnetSettingsPage.saveSettings();
+ data.put(ITerminalsConnectorConstants.PROP_IP_HOST,telnetSettings.getHost());
+ data.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.valueOf(telnetSettings.getNetworkPort()));
+ data.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.valueOf(telnetSettings.getTimeout()));
+ data.put(ITerminalsConnectorConstants.PROP_TELNET_EOL, telnetSettings.getEndOfLine());
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
+ */
+ @Override
+ protected void fillSettingsForHost(String host){
+ if (host != null && host.length() != 0){
+ if (hostSettingsMap.containsKey(host)){
+ Map hostSettings = hostSettingsMap.get(host);
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST) != null) {
+ telnetSettings.setHost(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_IP_PORT) != null) {
+ telnetSettings.setNetworkPort(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_PORT));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT) != null) {
+ telnetSettings.setTimeout(hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_TELNET_EOL) != null) {
+ telnetSettings.setEndOfLine(hostSettings.get(ITerminalsConnectorConstants.PROP_TELNET_EOL));
+ }
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING) != null) {
+ setEncoding(hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+ } else {
+ telnetSettings.setHost(getSelectionHost());
+ // MWE otherwise we don't get a valid default selection of the combo
+ telnetSettings.setNetworkPort(NetworkPortMap.PROP_VALUETELNET);
+ }
+ // set settings in page
+ telnetSettingsPage.loadSettings();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
+ @Override
+ protected void saveSettingsForHost(boolean add){
+ String host = getHostFromSettings();
+ if(host != null && host.length() != 0) {
+ Map hostSettings = hostSettingsMap.get(host);
+ if (hostSettings == null && !add) {
+ hostSettings=new HashMap();
+ hostSettingsMap.put(host, hostSettings);
+ }
+ if (hostSettings != null) {
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, telnetSettings.getHost());
+ hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(telnetSettings.getNetworkPort()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(telnetSettings.getTimeout()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_TELNET_EOL, telnetSettings.getEndOfLine());
+ if (getEncoding() != null) {
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid(){
+ return isEncodingValid() && telnetSettingsPage.validateSettings();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ saveSettingsForHost(true);
+ super.doSaveWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
+ */
+ @Override
+ protected String getHostFromSettings() {
+ telnetSettingsPage.saveSettings();
+ return telnetSettings.getHost();
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java
new file mode 100644
index 00000000000..98221f60b71
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [366374] [TERMINALS][TELNET] Add Telnet terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.launcher;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.terminal.connector.telnet.connector.TelnetSettings;
+import org.eclipse.tm.terminal.connector.telnet.controls.TelnetWizardConfigurationPanel;
+import org.eclipse.tm.terminal.connector.telnet.nls.Messages;
+import org.eclipse.tm.terminal.view.core.TerminalServiceFactory;
+import org.eclipse.tm.terminal.view.core.interfaces.ITerminalService;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel;
+import org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.tm.terminal.view.ui.internal.SettingsStore;
+import org.eclipse.tm.terminal.view.ui.launcher.AbstractLauncherDelegate;
+
+/**
+ * Telnet launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class TelnetLauncherDelegate extends AbstractLauncherDelegate {
+ // The Telnet terminal connection memento handler
+ private final IMementoHandler mementoHandler = new TelnetMementoHandler();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#getPanel(org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new TelnetWizardConfigurationPanel(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tm.terminal.view.core.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map properties, ITerminalService.Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String terminalTitle = getTerminalTitle(properties);
+ if (terminalTitle != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
+ }
+
+ // For Telnet terminals, force a new terminal tab each time it is launched,
+ // if not set otherwise from outside
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /**
+ * Returns the terminal title string.
+ *
+ * The default implementation constructs a title like "Telnet @ host (Start time) ".
+ *
+ * @return The terminal title string or null.
+ */
+ private String getTerminalTitle(Map properties) {
+ // Try to see if the user set a title explicitly via the properties map.
+ String title = getDefaultTerminalTitle(properties);
+ if (title != null) return title;
+
+ //No title,try to calculate the title
+ String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+
+ if (host != null) {
+ DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
+ String date = format.format(new Date(System.currentTimeMillis()));
+ return NLS.bind(Messages.TelnetLauncherDelegate_terminalTitle, new String[]{host, date});
+ }
+
+ return Messages.TelnetLauncherDelegate_terminalTitle_default;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IMementoHandler.class.equals(adapter)) {
+ return mementoHandler;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String)properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) connectorId = "org.eclipse.tm.terminal.connector.telnet.TelnetConnector"; //$NON-NLS-1$
+
+ // Extract the telnet properties
+ String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ String port = value != null ? value.toString() : null;
+ value = properties.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ String timeout = value != null ? value.toString() : null;
+ String endOfLine = (String)properties.get(ITerminalsConnectorConstants.PROP_TELNET_EOL);
+
+ int portOffset = 0;
+ if (properties.get(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET) instanceof Integer) {
+ portOffset = ((Integer)properties.get(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET)).intValue();
+ if (portOffset < 0) portOffset = 0;
+ }
+
+ // The real port to connect to is port + portOffset
+ if (port != null) {
+ port = Integer.toString(Integer.decode(port).intValue() + portOffset);
+ }
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the telnet settings
+ TelnetSettings telnetSettings = new TelnetSettings();
+ telnetSettings.setHost(host);
+ telnetSettings.setNetworkPort(port);
+ if (timeout != null) {
+ telnetSettings.setTimeout(timeout);
+ }
+ telnetSettings.setEndOfLine(endOfLine);
+ // And save the settings to the store
+ telnetSettings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.setDefaultSettings();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetMementoHandler.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetMementoHandler.java
new file mode 100644
index 00000000000..ea8a4be6b65
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetMementoHandler.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.launcher;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.terminal.view.core.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Telnet terminal connection memento handler implementation.
+ */
+public class TelnetMementoHandler implements IMementoHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void saveState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Do not write the terminal title to the memento -> needs to
+ // be recreated at the time of restoration.
+ memento.putString(ITerminalsConnectorConstants.PROP_IP_HOST, (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST));
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_IP_PORT);
+ memento.putInteger(ITerminalsConnectorConstants.PROP_IP_PORT, value instanceof Integer ? ((Integer)value).intValue() : -1);
+ value = properties.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
+ memento.putInteger(ITerminalsConnectorConstants.PROP_TIMEOUT, value instanceof Integer ? ((Integer)value).intValue() : -1);
+ memento.putString(ITerminalsConnectorConstants.PROP_ENCODING, (String)properties.get(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#restoreState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void restoreState(IMemento memento, Map properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+
+ // Restore the terminal properties from the memento
+ properties.put(ITerminalsConnectorConstants.PROP_IP_HOST, memento.getString(ITerminalsConnectorConstants.PROP_IP_HOST));
+ properties.put(ITerminalsConnectorConstants.PROP_IP_PORT, memento.getInteger(ITerminalsConnectorConstants.PROP_IP_PORT));
+ properties.put(ITerminalsConnectorConstants.PROP_TIMEOUT, memento.getInteger(ITerminalsConnectorConstants.PROP_TIMEOUT));
+ properties.put(ITerminalsConnectorConstants.PROP_ENCODING, memento.getString(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.java
new file mode 100644
index 00000000000..d223e942a6c
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2018 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 2.0 which accompanies this distribution, and is
+ * available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ * Max Weninger (Wind River) - [366374] [TERMINALS][TELNET] Add Telnet terminal support
+ *******************************************************************************/
+package org.eclipse.tm.terminal.connector.telnet.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tm.terminal.connector.telnet.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String TelnetLauncherDelegate_terminalTitle;
+ public static String TelnetLauncherDelegate_terminalTitle_default;
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.properties b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.properties
new file mode 100644
index 00000000000..7ed5b2ef78d
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/nls/Messages.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2012, 2018 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 2.0 which accompanies this distribution, and is
+# available at https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+TelnetLauncherDelegate_terminalTitle=Telnet {0} ({1})
+TelnetLauncherDelegate_terminalTitle_default=Telnet Terminal
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.classpath b/terminal/plugins/org.eclipse.tm.terminal.control/.classpath
new file mode 100644
index 00000000000..25d360efcad
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.control/.cvsignore
new file mode 100644
index 00000000000..ba077a4031a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.gitignore b/terminal/plugins/org.eclipse.tm.terminal.control/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.options b/terminal/plugins/org.eclipse.tm.terminal.control/.options
new file mode 100644
index 00000000000..7e591a4d4e7
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.options
@@ -0,0 +1,3 @@
+org.eclipse.tm.terminal.control/debug/log = false
+org.eclipse.tm.terminal.control/debug/log/char = false
+org.eclipse.tm.terminal.control/debug/log/VT100Backend = false
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.project b/terminal/plugins/org.eclipse.tm.terminal.control/.project
new file mode 100644
index 00000000000..11e18c380e4
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.project
@@ -0,0 +1,34 @@
+
+
+ org.eclipse.tm.terminal.control
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.core.resources.prefs b/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..775bde20f32
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java=UTF-8
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..eb9982c343a
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,100 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/HelpContexts.xml b/terminal/plugins/org.eclipse.tm.terminal.control/HelpContexts.xml
new file mode 100644
index 00000000000..2bde74230c5
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/HelpContexts.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ The Terminal View supports direct connections to remote systems via serial or network connections.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.control/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..5150cac4ff8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.control; singleton:=true
+Bundle-Version: 4.5.102.qualifier
+Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .
+Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true,
+ org.eclipse.tm.internal.terminal.control,
+ org.eclipse.tm.internal.terminal.control.actions,
+ org.eclipse.tm.internal.terminal.control.impl;x-internal:=true,
+ org.eclipse.tm.internal.terminal.emulator;x-internal:=true,
+ org.eclipse.tm.internal.terminal.model;x-internal:=true,
+ org.eclipse.tm.internal.terminal.preferences,
+ org.eclipse.tm.internal.terminal.provisional.api,
+ org.eclipse.tm.internal.terminal.provisional.api.provider,
+ org.eclipse.tm.internal.terminal.textcanvas;x-internal:=true,
+ org.eclipse.tm.terminal.model
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/README.txt b/terminal/plugins/org.eclipse.tm.terminal.control/README.txt
new file mode 100644
index 00000000000..c88bc696e29
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/README.txt
@@ -0,0 +1,18 @@
+Terminal README
+===============
+
+The Terminal is a UI-less model of a grid of characters,
+plus an SWT widget that's updated asynchronously for
+maximum performance. The widget can be hooked up to various
+ITerminalConnectors providing an InputStream, OutputStream,
+and a method for setting the Terminal Size.
+
+The widget processes ANSI control characters, including NUL,
+backspace, carriage return, linefeed, and a subset of ANSI
+escape sequences sufficient to allow use of screen-oriented
+applications, such as vi, Emacs, and any GNU readline-enabled
+application (Bash, bc, ncftp, etc.).
+
+This is not yet a fully compliant vt100 / vt102 terminal
+emulator!
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/about.html b/terminal/plugins/org.eclipse.tm.terminal.control/about.html
new file mode 100644
index 00000000000..62cf4ee7eb8
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+
About This Content
+
+
June 5, 2007
+
License
+
+
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License 2.0 ("EPL"). A copy of the EPL is available
+at https://www.eclipse.org/legal/epl-2.0/.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at http://www.eclipse.org.
+
+
+
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/about.ini b/terminal/plugins/org.eclipse.tm.terminal.control/about.ini
new file mode 100644
index 00000000000..3adc27ab587
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/about.ini
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=tm32.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+# optional
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/about.properties b/terminal/plugins/org.eclipse.tm.terminal.control/about.properties
new file mode 100644
index 00000000000..55d889e964e
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/about.properties
@@ -0,0 +1,24 @@
+################################################################################
+# Copyright (c) 2006, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Martin Oberhuber - initial API and implementation
+################################################################################
+# about.properties
+# contains externalized strings for about.ini
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# fill-ins are supplied by about.mappings
+# This file should be translated.
+#
+# Do not translate any values surrounded by {}
+
+blurb=Target Management Terminal Widget\n\
+\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Wind River Systems, Inc. and others 2003, 2018. All rights reserved.\n\
+Visit http://www.eclipse.org/tm
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/build.properties b/terminal/plugins/org.eclipse.tm.terminal.control/build.properties
new file mode 100644
index 00000000000..ff0b66ba638
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/build.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2003, 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Initial Contributors:
+# The following Wind River employees contributed to the Terminal component
+# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+# Helmut Haigermoser and Ted Williams.
+#
+# Contributors:
+# Michael Scharf (Wind River) - split into core, view and connector plugins
+# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+# Anna Dushistova (MontaVista) - added icons
+###############################################################################
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ .options,\
+ README.txt,\
+ about.html,\
+ about.ini,\
+ about.properties,\
+ tm32.png,\
+ icons/,\
+ HelpContexts.xml,\
+ css/
+
+source.. = src/
+output.. = bin/
+src.includes = schema/,\
+ about.html
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/css/org.eclipse.tm.terminal.stylesheet.dark.css b/terminal/plugins/org.eclipse.tm.terminal.control/css/org.eclipse.tm.terminal.stylesheet.dark.css
new file mode 100644
index 00000000000..6b612015089
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/css/org.eclipse.tm.terminal.stylesheet.dark.css
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 vogella GmbH and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Lars Vogel - initial API and implementation
+ ******************************************************************************/
+
+IEclipsePreferences#org-eclipse-tm-terminal-control {
+ preferences:
+ "TerminalPrefInvertColors=true"
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/icons/clcl16/clear_co.gif b/terminal/plugins/org.eclipse.tm.terminal.control/icons/clcl16/clear_co.gif
new file mode 100644
index 00000000000..af30a42f83d
Binary files /dev/null and b/terminal/plugins/org.eclipse.tm.terminal.control/icons/clcl16/clear_co.gif differ
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/icons/dlcl16/clear_co.gif b/terminal/plugins/org.eclipse.tm.terminal.control/icons/dlcl16/clear_co.gif
new file mode 100644
index 00000000000..6775edfabb9
Binary files /dev/null and b/terminal/plugins/org.eclipse.tm.terminal.control/icons/dlcl16/clear_co.gif differ
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/icons/elcl16/clear_co.gif b/terminal/plugins/org.eclipse.tm.terminal.control/icons/elcl16/clear_co.gif
new file mode 100644
index 00000000000..af30a42f83d
Binary files /dev/null and b/terminal/plugins/org.eclipse.tm.terminal.control/icons/elcl16/clear_co.gif differ
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.control/plugin.properties
new file mode 100644
index 00000000000..daad8a7fc59
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/plugin.properties
@@ -0,0 +1,44 @@
+###############################################################################
+# Copyright (c) 2003 - 2018 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 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Initial Contributors:
+# The following Wind River employees contributed to the Terminal component
+# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
+# Helmut Haigermoser and Ted Williams.
+#
+# Contributors:
+# Michael Scharf (Wind River) - split into core, view and connector plugins
+# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+# Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget
+###############################################################################
+
+# NLS_MESSAGEFORMAT_NONE
+
+pluginName = Terminal Control (Embeddable Widget)
+providerName = Eclipse.org - Target Management
+
+terminal.context.name.edit=Terminal Control in Focus
+terminal.context.description.edit=Show modified keyboard shortcuts in context menu
+
+terminal.context.name.terminal=Terminal Typing Connected
+terminal.context.description.terminal=Override ALT+x menu access keys while typing into the Terminal
+
+terminal.insertion.description=Terminal view insertion
+terminal.insertion.name=Terminal view insert
+terminal.insertion.category.name=Terminal view commands
+terminal.view.insertion.description = Terminal view commands
+
+terminal.command.copy.name=Copy
+terminal.command.paste.name=Paste
+terminal.command.maximize.name=Maximize Active View or Editor
+terminal.command.quickaccess.name=Quick Access
+
+terminal.preferences.name = Terminal
+terminal.font.description = The font for the terminal console.
+terminal.font.label = Terminal Console Font
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.control/plugin.xml
new file mode 100644
index 00000000000..ed656d41978
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/plugin.xml
@@ -0,0 +1,277 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %terminal.font.description
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.control/pom.xml
new file mode 100644
index 00000000000..a0de87da146
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/pom.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ 4.0.0
+
+
+ org.eclipse.tm.terminal
+ org.eclipse.tm.terminal.maven-build
+ 4.5.100-SNAPSHOT
+ ../../admin/pom-build.xml
+
+ 4.5.102-SNAPSHOT
+
+ org.eclipse.tm.terminal.control
+ eclipse-plugin
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/schema/connectors.exsd b/terminal/plugins/org.eclipse.tm.terminal.control/schema/connectors.exsd
new file mode 100644
index 00000000000..8a0862cf413
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/schema/connectors.exsd
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A class extending TerminalConnectorImpl
+
+
+
+
+
+
+
+
+
+ Uniquely identify this connector for programmatic access. Clients will use this ID in order to find and instantiate it.
+
+
+
+
+
+
+ The name of the connection (used in the UI)
+
+
+
+
+
+
+
+
+
+ When set to "true", the terminal connector will not be visible to the user in connector selections.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Copyright (c) 2006 - 2018 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 2.0
+which accompanies this distribution, and is available at
+https://www.eclipse.org/legal/epl-2.0/
+
+Contributors:
+Michael Scharf (Wind River) - initial API and implementation
+Martin Oberhuber (Wind River) - fixed copyright headers and beautified
+Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
+
+
+
+
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java
new file mode 100644
index 00000000000..dfa2f8faf91
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ * Michael Scharf (Wind River) - [200541] Extract from TerminalConnectorExtension.TerminalConnectorProxy
+ * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
+ * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.connector;
+
+import java.io.OutputStream;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.Logger;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl;
+
+/**
+ * An {@link ITerminalConnector} instance, also known as terminal connection
+ * type, for maintaining a single terminal connection.
+ *
+ * It provides all terminal connector functions that can be provided by static
+ * markup without loading the actual implementation class. The actual
+ * {@link TerminalConnectorImpl} implementation class is lazily loaded by the
+ * provided {@link TerminalConnector.Factory} interface when needed. class, and
+ * delegates to the actual implementation when needed. The following methods can
+ * be called without initializing the contributed implementation class:
+ * {@link #getId()}, {@link #getName()}, {@link #getSettingsSummary()},{@link #load(ISettings)},
+ * {@link #setTerminalSize(int, int)}, {@link #save(ISettings)},
+ * {@link #getAdapter(Class)}
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ * Clients can get terminal connector instances through the
+ * {@link TerminalConnectorExtension} class.
+ * @since org.eclipse.tm.terminal 2.0
+ */
+public class TerminalConnector implements ITerminalConnector {
+ /**
+ * Creates an instance of TerminalConnectorImpl. This is used to lazily load
+ * classed defined in extensions.
+ *
+ * @since org.eclipse.tm.terminal 2.0
+ */
+ public interface Factory {
+ /**
+ * Factory method to create the actual terminal connector implementation
+ * when needed.
+ *
+ * @return a Connector
+ * @throws Exception
+ */
+ TerminalConnectorImpl makeConnector() throws Exception;
+ }
+ /**
+ * The factory for creating impl instances.
+ */
+ private final TerminalConnector.Factory fTerminalConnectorFactory;
+ /**
+ * The (display) name of the TerminalConnector
+ */
+ private final String fName;
+ /**
+ * The unique id the connector
+ */
+ private final String fId;
+ /**
+ * Flag to mark the connector as hidden.
+ */
+ private final boolean fHidden;
+ /**
+ * The connector
+ */
+ private TerminalConnectorImpl fConnector;
+ /**
+ * If the initialization of the class specified in the extension fails,
+ * this variable contains the error
+ */
+ private Exception fException;
+ /**
+ * The store might be set before the real connector is initialized.
+ * This keeps the value until the connector is created.
+ */
+ private ISettingsStore fStore;
+ /**
+ * Constructor for the terminal connector.
+ *
+ * @param terminalConnectorFactory Factory for lazily instantiating the
+ * TerminalConnectorImpl when needed.
+ * @param id terminal connector ID. The connector is publicly known under
+ * this ID.
+ * @param name translatable name to display the connector in the UI.
+ */
+ public TerminalConnector(TerminalConnector.Factory terminalConnectorFactory, String id, String name, boolean hidden) {
+ fTerminalConnectorFactory = terminalConnectorFactory;
+ fId = id;
+ fName = name;
+ fHidden = hidden;
+ }
+ public String getInitializationErrorMessage() {
+ getConnectorImpl();
+ if(fException!=null)
+ return fException.getLocalizedMessage();
+ return null;
+ }
+ public String getId() {
+ return fId;
+ }
+ public String getName() {
+ return fName;
+ }
+ public boolean isHidden() {
+ return fHidden;
+ }
+ private TerminalConnectorImpl getConnectorImpl() {
+ if(!isInitialized()) {
+ try {
+ fConnector=fTerminalConnectorFactory.makeConnector();
+ fConnector.initialize();
+ } catch (Exception e) {
+ fException=e;
+ fConnector=new TerminalConnectorImpl(){
+ public void connect(ITerminalControl control) {
+ // super.connect(control);
+ control.setState(TerminalState.CLOSED);
+ control.setMsg(getInitializationErrorMessage());
+ }
+ public OutputStream getTerminalToRemoteStream() {
+ return null;
+ }
+ public String getSettingsSummary() {
+ return null;
+ }};
+ // that's the place where we log the exception
+ Logger.logException(e);
+ }
+ if(fConnector!=null && fStore!=null)
+ fConnector.load(fStore);
+ }
+ return fConnector;
+ }
+
+ public boolean isInitialized() {
+ return fConnector!=null || fException!=null;
+ }
+ public void connect(ITerminalControl control) {
+ getConnectorImpl().connect(control);
+ }
+ public void disconnect() {
+ getConnectorImpl().disconnect();
+ }
+ public OutputStream getTerminalToRemoteStream() {
+ return getConnectorImpl().getTerminalToRemoteStream();
+ }
+ public String getSettingsSummary() {
+ if(fConnector!=null)
+ return getConnectorImpl().getSettingsSummary();
+ else
+ return TerminalMessages.NotInitialized;
+ }
+ public boolean isLocalEcho() {
+ return getConnectorImpl().isLocalEcho();
+ }
+ public void load(ISettingsStore store) {
+ if(fConnector==null) {
+ fStore=store;
+ } else {
+ getConnectorImpl().load(store);
+ }
+ }
+ @Override
+ public void setDefaultSettings() {
+ getConnectorImpl().setDefaultSettings();
+ }
+ public void save(ISettingsStore store) {
+ // no need to save the settings: it cannot have changed
+ // because we are not initialized....
+ if(fConnector!=null)
+ getConnectorImpl().save(store);
+ }
+ public void setTerminalSize(int newWidth, int newHeight) {
+ // we assume that setTerminalSize is called also after
+ // the terminal has been initialized. Else we would have to cache
+ // the values....
+ if(fConnector!=null) {
+ fConnector.setTerminalSize(newWidth, newHeight);
+ }
+ }
+ public Object getAdapter(Class adapter) {
+ TerminalConnectorImpl connector=null;
+ if(isInitialized())
+ connector=getConnectorImpl();
+ // if we cannot create the connector then we cannot adapt...
+ if(connector!=null) {
+ // maybe the connector is adaptable
+ if(connector instanceof IAdaptable) {
+ Object result =((IAdaptable)connector).getAdapter(adapter);
+ // Not sure if the next block is needed....
+ if(result==null)
+ //defer to the platform
+ result= Platform.getAdapterManager().getAdapter(connector, adapter);
+ if(result!=null)
+ return result;
+ }
+ // maybe the real adapter is what we need....
+ if(adapter.isInstance(connector))
+ return connector;
+ }
+ // maybe we have to be adapted....
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+}
\ No newline at end of file
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java
new file mode 100644
index 00000000000..362306a4fb1
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Michael Scharf (Wind River) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.connector;
+
+import java.io.ByteArrayOutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noreference This class is not intended to be referenced by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ * This class used to be package-protected. It is public only for access by the Unit Tests.
+ */
+public class TerminalToRemoteInjectionOutputStream extends FilterOutputStream {
+ /**
+ * This class handles bytes written to the {@link TerminalToRemoteInjectionOutputStream}.
+ */
+ static abstract public class Interceptor {
+ protected OutputStream fOriginal;
+ /**
+ * @param original the injection into the original stream begins
+ * @throws IOException
+ */
+ public void begin(OutputStream original) throws IOException {
+ fOriginal=original;
+ }
+ /**
+ * @param b a byte was written to the {@link TerminalToRemoteInjectionOutputStream}.
+ * @throws IOException
+ */
+ public void write(int b) throws IOException {
+ }
+ /**
+ * @param b bytes written to the {@link TerminalToRemoteInjectionOutputStream}.
+ * @param off the start offset in the data.
+ * @param len the number of bytes to write.
+ * @throws IOException
+ */
+ public void write(byte[] b, int off, int len) throws IOException {
+ }
+ /**
+ * The injection into the normal stream ends.
+ * @throws IOException
+ */
+ public void close() throws IOException {
+ }
+ public void flush() {
+ }
+ }
+ static public class BufferInterceptor extends Interceptor {
+ private final ByteArrayOutputStream fBuffer=new ByteArrayOutputStream();
+ public void close() throws IOException {
+ fOriginal.write(fBuffer.toByteArray());
+ }
+ public void write(byte[] b, int off, int len) throws IOException {
+ fBuffer.write(b, off, len);
+ }
+ public void write(int b) throws IOException {
+ fBuffer.write(b);
+ }
+ }
+ private class TerminalFilterOutputStream extends OutputStream {
+ final private Object fLock=TerminalToRemoteInjectionOutputStream.this;
+ public void close() throws IOException {
+ synchronized(fLock) {
+ if(fInjection==this) {
+ flush();
+ ungrabOutput();
+ }
+ }
+ }
+ public void write(byte[] b, int off, int len) throws IOException {
+ synchronized(fLock) {
+ checkStream();
+ out.write(b, off, len);
+ }
+ }
+ public void write(byte[] b) throws IOException {
+ synchronized(fLock) {
+ checkStream();
+ out.write(b);
+ }
+ }
+ public void flush() throws IOException {
+ synchronized(fLock) {
+ checkStream();
+ out.flush();
+ }
+ }
+ public void write(int b) throws IOException {
+ synchronized(fLock) {
+ checkStream();
+ out.write(b);
+ }
+ }
+ private void checkStream() throws IOException {
+ if(fInjection!=this)
+ throw new IOException("Stream is closed"); //$NON-NLS-1$
+ }
+ }
+ private Interceptor fInterceptor;
+ private TerminalFilterOutputStream fInjection;
+ public TerminalToRemoteInjectionOutputStream(OutputStream out) {
+ super(out);
+ }
+ synchronized protected void ungrabOutput() throws IOException {
+ if(fInterceptor!=null) {
+ fInterceptor.close();
+ fInterceptor=null;
+ fInjection=null;
+ }
+ }
+ /**
+ * There can only be one injection stream active at a time. You must call close on the
+ * returned output stream to end the injection.
+ * @param interceptor This is used handle bytes sent while the injection stream is active.
+ * @return a output stream that can be used to write to the decorated stream.
+ * @throws IOException
+ */
+ public synchronized OutputStream grabOutput(Interceptor interceptor) throws IOException {
+ if(fInjection!=null) {
+ throw new IOException("Buffer in use"); //$NON-NLS-1$
+ }
+ fInterceptor=interceptor;
+ fInterceptor.begin(out);
+ fInjection=new TerminalFilterOutputStream();
+ return fInjection;
+ }
+ /** See {@link #grabOutput(TerminalToRemoteInjectionOutputStream.Interceptor)}.
+ * @return injection output stream
+ * @throws IOException
+ */
+ public synchronized OutputStream grabOutput() throws IOException {
+ return grabOutput(new BufferInterceptor());
+ }
+ synchronized public void close() throws IOException {
+ if(fInjection!=null) {
+ fInjection.close();
+ }
+ super.close();
+ }
+ synchronized public void flush() throws IOException {
+ if(fInterceptor!=null)
+ fInterceptor.flush();
+ out.flush();
+ }
+ synchronized public void write(byte[] b, int off, int len) throws IOException {
+ if(fInterceptor!=null)
+ fInterceptor.write(b, off, len);
+ else
+ out.write(b, off, len);
+ }
+ synchronized public void write(int b) throws IOException {
+ if(fInterceptor!=null)
+ fInterceptor.write(b);
+ else
+ out.write(b);
+ }
+}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java
new file mode 100644
index 00000000000..0034ea648ba
--- /dev/null
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java
@@ -0,0 +1,324 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2018 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * 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
+ * Michael Scharf (Wing River) - [236458] Fix 168197 lost the last entry
+ * Anton Leherbauer (Wind River) - [220971] The optional terminal input line has redraw problems when resizing
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.control;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.fieldassist.TextContentAdapter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
+
+
+
+/**
+ * Manages the Command History for the command line input
+ * of the terminal control.
+ *
+ *
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.
+ *
+ *
+ */
+public class CommandInputFieldWithHistory implements ICommandInputField {
+ private class FieldAssist implements IContentProposalProvider {
+
+ public IContentProposal[] getProposals(String contents, int position) {
+ String prefix=contents.substring(0, position);
+ List result=new ArrayList();
+ // show an entry only once
+ Set seen=new HashSet();
+ for (Iterator iterator = fHistory.iterator(); iterator.hasNext();) {
+ String history = iterator.next();
+ if(history.startsWith(prefix) && !seen.contains(history)) {
+ // the content is the rest of the history item
+ String content=history.substring(prefix.length());
+ result.add(new Proposal(content,history));
+ // don't add this proposal again
+ seen.add(history);
+ }
+ }
+ return 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) {
+ fContent= content;
+ fLabel= label;
+ }
+ public String getContent() {
+ return fContent;
+ }
+
+ public String getLabel() {
+ return fLabel;
+ }
+
+ public String getDescription() {
+ return null;
+ }
+
+ public int getCursorPosition() {
+ return fContent.length();
+ }
+ }
+
+ final List fHistory=new ArrayList();
+ /**
+ * Keeps a modifiable history while in history editing mode
+ */
+ List