diff --git a/features/org.eclipse.tm.terminal.remote-feature/.project b/features/org.eclipse.tm.terminal.remote-feature/.project
new file mode 100644
index 00000000000..311b718d840
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote-feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.remote-feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/features/org.eclipse.tm.terminal.remote-feature/build.properties b/features/org.eclipse.tm.terminal.remote-feature/build.properties
new file mode 100644
index 00000000000..cd19ac2ddfd
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote-feature/build.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/features/org.eclipse.tm.terminal.remote-feature/feature.properties b/features/org.eclipse.tm.terminal.remote-feature/feature.properties
new file mode 100644
index 00000000000..ddc31e1b159
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote-feature/feature.properties
@@ -0,0 +1,165 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+# 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=Target Management Terminal Remote Connector
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse TM Project
+
+# "tmUpdateSiteName" property - label for the update site
+tmUpdateSiteName=Target Management 3.7 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 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 v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html
+################ end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+February 1, 2011\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/features/org.eclipse.tm.terminal.remote-feature/feature.xml b/features/org.eclipse.tm.terminal.remote-feature/feature.xml
new file mode 100644
index 00000000000..46ffdefffda
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote-feature/feature.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/org.eclipse.tm.terminal.remote-feature/pom.xml b/features/org.eclipse.tm.terminal.remote-feature/pom.xml
new file mode 100644
index 00000000000..6f4bfe93ad1
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote-feature/pom.xml
@@ -0,0 +1,30 @@
+
+
+ 4.0.0
+
+ org.eclipse.tm.maven-build
+ org.eclipse.tm
+ 4.0.0-SNAPSHOT
+ ../../../admin/pom-build.xml
+
+ org.eclipse.tm.features
+ org.eclipse.tm.terminal.remote.feature
+ 3.7.0.qualifier
+ eclipse-feature
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/features/org.eclipse.tm.terminal.remote.sdk-feature/.project b/features/org.eclipse.tm.terminal.remote.sdk-feature/.project
new file mode 100644
index 00000000000..1ddaded993b
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote.sdk-feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.tm.terminal.remote.sdk-feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/features/org.eclipse.tm.terminal.remote.sdk-feature/build.properties b/features/org.eclipse.tm.terminal.remote.sdk-feature/build.properties
new file mode 100644
index 00000000000..6496f1dba2f
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote.sdk-feature/build.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+
+bin.includes = feature.xml,\
+ feature.properties
+
+generate.plugin@org.eclipse.tm.terminal.remote.source=org.eclipse.tm.terminal.remote
diff --git a/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.properties b/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.properties
new file mode 100644
index 00000000000..38413c768bc
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.properties
@@ -0,0 +1,165 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+# 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=Target Management Terminal Remote Connector SDK
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse TM Project
+
+# "tmUpdateSiteName" property - label for the update site
+tmUpdateSiteName=Target Management 3.7 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 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 v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html
+################ end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+February 1, 2011\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.xml b/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.xml
new file mode 100644
index 00000000000..424ef3985b0
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote.sdk-feature/feature.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+ %description
+
+
+
+ %copyright
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/org.eclipse.tm.terminal.remote.sdk-feature/pom.xml b/features/org.eclipse.tm.terminal.remote.sdk-feature/pom.xml
new file mode 100644
index 00000000000..64ce0cd11cc
--- /dev/null
+++ b/features/org.eclipse.tm.terminal.remote.sdk-feature/pom.xml
@@ -0,0 +1,30 @@
+
+
+ 4.0.0
+
+ org.eclipse.tm.maven-build
+ org.eclipse.tm
+ 4.0.0-SNAPSHOT
+ ../../../admin/pom-build.xml
+
+ org.eclipse.tm.features
+ org.eclipse.tm.terminal.remote.sdk.feature
+ 3.7.0.qualifier
+ eclipse-feature
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-packaging-plugin
+ ${tycho-version}
+
+ default
+
+
+
+
+
+
diff --git a/plugins/org.eclipse.tm.terminal.remote/.classpath b/plugins/org.eclipse.tm.terminal.remote/.classpath
new file mode 100644
index 00000000000..098194ca4b7
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/plugins/org.eclipse.tm.terminal.remote/.cvsignore b/plugins/org.eclipse.tm.terminal.remote/.cvsignore
new file mode 100644
index 00000000000..ba077a4031a
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.tm.terminal.remote/.project b/plugins/org.eclipse.tm.terminal.remote/.project
new file mode 100644
index 00000000000..772df90ccb9
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/.project
@@ -0,0 +1,34 @@
+
+
+ org.eclipse.tm.terminal.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/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..a4b6f7df50e
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,74 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+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.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+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.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+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.7
diff --git a/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..0b831f584d6
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.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/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF b/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..73dc4e1da8c
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tm.terminal.remote;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.tm.terminal,
+ org.eclipse.remote.core,
+ org.eclipse.remote.ui,
+ org.eclipse.core.resources,
+ org.eclipse.tm.terminal.view,
+ org.eclipse.swt,
+ org.eclipse.jface
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: org.eclipse.tm.internal.terminal.remote;x-internal:=true,
+ org.eclipse.tm.terminal.remote
+Bundle-Activator: org.eclipse.tm.internal.terminal.remote.Activator
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.ide
diff --git a/plugins/org.eclipse.tm.terminal.remote/about.html b/plugins/org.eclipse.tm.terminal.remote/about.html
new file mode 100644
index 00000000000..d4cc693f9f0
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.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 Version 1.0 ("EPL"). A copy of the EPL is available
+at http://www.eclipse.org/legal/epl-v10.html.
+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/plugins/org.eclipse.tm.terminal.remote/build.properties b/plugins/org.eclipse.tm.terminal.remote/build.properties
new file mode 100644
index 00000000000..3ca651cc829
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
+
diff --git a/plugins/org.eclipse.tm.terminal.remote/plugin.properties b/plugins/org.eclipse.tm.terminal.remote/plugin.properties
new file mode 100644
index 00000000000..e20f519925c
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/plugin.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Target Management Terminal Remote Services Connector
+providerName = Eclipse PTP
+connectionName = Remote Services
+RemoteTerminalPage.name = Remote Terminal
diff --git a/plugins/org.eclipse.tm.terminal.remote/plugin.xml b/plugins/org.eclipse.tm.terminal.remote/plugin.xml
new file mode 100644
index 00000000000..c3aa141f19e
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/plugin.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/org.eclipse.tm.terminal.remote/pom.xml b/plugins/org.eclipse.tm.terminal.remote/pom.xml
new file mode 100644
index 00000000000..6b257540a07
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/pom.xml
@@ -0,0 +1,16 @@
+
+
+ 4.0.0
+
+
+ org.eclipse.tm
+ org.eclipse.tm.maven-build
+ 4.0.0-SNAPSHOT
+ ../../../admin/pom-build.xml
+
+ org.eclipse.tm
+ org.eclipse.tm.terminal.remote
+ 1.0.0-SNAPSHOT
+ eclipse-plugin
+
diff --git a/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd b/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd
new file mode 100644
index 00000000000..4fa0ed65b15
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+ 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/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java
new file mode 100644
index 00000000000..577abd3410d
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+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.internal.terminal.remote.messages.Messages;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * 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();
+ }
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java
new file mode 100644
index 00000000000..28add0f3f99
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+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/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java
new file mode 100644
index 00000000000..74ac4835e66
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+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.IRemoteConnection;
+import org.eclipse.remote.core.IRemoteConnectionManager;
+import org.eclipse.remote.core.IRemoteProcess;
+import org.eclipse.remote.core.IRemoteProcessBuilder;
+import org.eclipse.remote.core.IRemoteServices;
+import org.eclipse.remote.core.RemoteServices;
+import org.eclipse.remote.core.exception.RemoteConnectionException;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
+import org.eclipse.tm.internal.terminal.remote.messages.Messages;
+import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants;
+import org.eclipse.tm.terminal.remote.IRemoteTerminalParser;
+
+@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;
+
+ 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) {
+ IRemoteProcess remoteProcess = null;
+ IRemoteConnection remoteConnection = null;
+
+ try {
+ String remoteServices = connector.getSshSettings().getRemoteServices();
+ IRemoteServices services = RemoteServices.getRemoteServices(remoteServices);
+ if (services != null) {
+ IRemoteConnectionManager connMgr = services.getConnectionManager();
+ if (connMgr != null) {
+ remoteConnection = connMgr.getConnection(connector.getSshSettings().getConnectionName());
+ }
+ }
+ if (remoteConnection == null) {
+ throw new RemoteConnectionException(NLS.bind(Messages.RemoteConnectionManager_0, connector.getSshSettings()
+ .getConnectionName()));
+ }
+
+ if (!remoteConnection.isOpen()) {
+ remoteConnection.open(monitor);
+ if (!remoteConnection.isOpen()) {
+ throw new RemoteConnectionException(NLS.bind(Messages.RemoteConnectionManager_1, connector.getSshSettings()
+ .getConnectionName()));
+ }
+ }
+
+ if (parser != null) {
+ remoteProcess = parser.initialize(remoteConnection);
+ } else {
+ /*
+ * 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.getRemoteServices().getCapabilities() & IRemoteServices.CAPABILITY_SUPPORTS_COMMAND_SHELL) != 0) {
+ remoteProcess = remoteConnection.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
+ } else {
+ if ("".equals(terminalShellCommand)) { //$NON-NLS-1$
+ terminalShellCommand = "/bin/bash -l"; //$NON-NLS-1$
+ }
+ IRemoteProcessBuilder processBuilder = remoteConnection.getProcessBuilder(new ArgumentParser(
+ terminalShellCommand).getTokenList());
+ remoteProcess = processBuilder.start(IRemoteProcessBuilder.ALLOCATE_PTY);
+ }
+ }
+
+ connector.setInputStream(remoteProcess.getInputStream());
+ control.setState(TerminalState.CONNECTED);
+ control.setTerminalTitle(remoteConnection.getName());
+ connector.setOutputStream(remoteProcess.getOutputStream());
+
+ // 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();
+ synchronized (this) {
+ if (remoteProcess != null && !remoteProcess.isCompleted()) {
+ remoteProcess.destroy();
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ public void setTerminalSize(int cols, int rows, int width, int height) {
+ // Enable for org.eclipse.remote v1.2
+ // if (remoteProcess instanceof IRemoteTerminal) {
+ // ((IRemoteTerminal) remoteProcess).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];
+ while (getState() == Job.RUNNING) {
+ int n = in.read(buf, 0, buf.length);
+ if (n <= 0) {
+ break;
+ }
+ if (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/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java
new file mode 100644
index 00000000000..f97ec007898
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
+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.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() {
+ if (getInputStream() != null) {
+ try {
+ getInputStream().close();
+ } catch (Exception exception) {
+ Activator.log(exception);
+ }
+ }
+
+ if (getTerminalToRemoteStream() != null) {
+ try {
+ getTerminalToRemoteStream().close();
+ } catch (Exception exception) {
+ Activator.log(exception);
+ }
+ }
+
+ 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 SSH Settings.
+ *
+ * @return the settings for a concrete connection.
+ * @since org.eclipse.tm.terminal.ssh 2.0 renamed from getTelnetSettings()
+ */
+ public IRemoteSettings getSshSettings() {
+ return fSettings;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getTerminalToRemoteStream()
+ */
+ @Override
+ public OutputStream getTerminalToRemoteStream() {
+ return fOutputStream;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#initialize()
+ */
+ @Override
+ public void initialize() throws Exception {
+ }
+
+ /*
+ * (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) {
+ fSettings.load(store);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#makeSettingsPage()
+ */
+ @Override
+ public ISettingsPage makeSettingsPage() {
+ return new RemoteSettingsPage(fSettings);
+ }
+
+ /*
+ * (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) {
+ 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/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java
new file mode 100644
index 00000000000..e71e9f65eb9
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.terminal.remote.IRemoteSettings;
+
+@SuppressWarnings("restriction")
+public class RemoteSettings implements IRemoteSettings {
+ protected String fRemoteServices;
+ protected String fConnectionName;
+
+ public RemoteSettings() {
+ }
+
+ public String getConnectionName() {
+ return fConnectionName;
+ }
+
+ public String getRemoteServices() {
+ return fRemoteServices;
+ }
+
+ public String getSummary() {
+ return "Remote:" + getRemoteServices() + '_' + getConnectionName(); //$NON-NLS-1$
+ }
+
+ @Override
+ public String toString() {
+ return getSummary();
+ }
+
+ /**
+ * Load information into the RemoteSettings object.
+ */
+ public void load(ISettingsStore store) {
+ fRemoteServices = store.get(REMOTE_SERVICES);
+ fConnectionName = store.get(CONNECTION_NAME);
+ }
+
+ /**
+ * Extract information from the RemoteSettings object.
+ */
+ public void save(ISettingsStore store) {
+ store.put(REMOTE_SERVICES, fRemoteServices);
+ store.put(CONNECTION_NAME, fConnectionName);
+ }
+
+ public void setConnectionName(String name) {
+ fConnectionName = name;
+ }
+
+ public void setRemoteServices(String remoteServices) {
+ fRemoteServices = remoteServices;
+ }
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java
new file mode 100644
index 00000000000..e49d8097e47
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote;
+
+import org.eclipse.remote.ui.widgets.RemoteConnectionWidget;
+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.internal.terminal.provisional.api.AbstractSettingsPage;
+
+@SuppressWarnings("restriction")
+public class RemoteSettingsPage extends AbstractSettingsPage {
+ private final RemoteSettings fTerminalSettings;
+ private RemoteConnectionWidget fRemoteConnectionWidget;
+
+ public RemoteSettingsPage(RemoteSettings settings) {
+ fTerminalSettings = settings;
+ }
+
+ public void saveSettings() {
+ fTerminalSettings.setRemoteServices(fRemoteConnectionWidget.getConnection().getRemoteServices().getId());
+ fTerminalSettings.setConnectionName(fRemoteConnectionWidget.getConnection().getName());
+ }
+
+ public void loadSettings() {
+ if (fTerminalSettings != null) {
+ fRemoteConnectionWidget.setConnection(fTerminalSettings.getRemoteServices(), fTerminalSettings.getConnectionName());
+ }
+ }
+
+ String get(String value, String def) {
+ if (value == null || value.length() == 0) {
+ return def;
+ }
+ return value;
+ }
+
+ public boolean validateSettings() {
+ if (fRemoteConnectionWidget.getConnection() == null) {
+ return false;
+ }
+ return true;
+ }
+
+ 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);
+
+ fRemoteConnectionWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0);
+ loadSettings();
+ }
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java
new file mode 100644
index 00000000000..a0df4052781
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tm.internal.terminal.remote.messages.messages"; //$NON-NLS-1$
+
+ public static String RemoteConnectionManager_0;
+
+ public static String RemoteConnectionManager_1;
+
+ public static String RemoteTerminalPreferencePage_0;
+
+ public static String TERMINAL_EXCEPTION;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties
new file mode 100644
index 00000000000..562a8886498
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties
@@ -0,0 +1,4 @@
+RemoteConnectionManager_0=Unable to create connection: {0}
+RemoteConnectionManager_1=Unable to to open connection: {0}
+RemoteTerminalPreferencePage_0=Initial Shell Command
+TERMINAL_EXCEPTION=Remote Terminal Exception
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java
new file mode 100644
index 00000000000..99d3a8ac91c
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote.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.internal.terminal.remote.Activator;
+import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants;
+
+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/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java
new file mode 100644
index 00000000000..cfc75187ddf
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.internal.terminal.remote.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.internal.terminal.remote.Activator;
+import org.eclipse.tm.internal.terminal.remote.messages.Messages;
+import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+public class RemoteTerminalPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ protected void createFieldEditors() {
+ Composite parent = getFieldEditorParent();
+ addField(new StringFieldEditor(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND,
+ Messages.RemoteTerminalPreferencePage_0, parent));
+ }
+
+ @Override
+ public IPreferenceStore doGetPreferenceStore() {
+ return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.getUniqueIdentifier());
+ }
+
+ public void init(IWorkbench workbench) {
+ // Nothing
+ }
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java
new file mode 100644
index 00000000000..22b07d0107d
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.terminal.remote;
+
+public interface IRemoteSettings {
+ public static final String CONNECTION_NAME = "ConnectionName"; //$NON-NLS-1$
+ public static final String REMOTE_SERVICES = "RemoteServices"; //$NON-NLS-1$
+
+ /**
+ * Get the host name or IP address of remote system to connect.
+ *
+ * @return host name or IP address of the remote system.
+ */
+ String getRemoteServices();
+
+ /**
+ * Get the login name for connecting to the remote system.
+ *
+ * @return remote login name
+ */
+ String getConnectionName();
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java
new file mode 100644
index 00000000000..d0f29e085c8
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java
@@ -0,0 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.terminal.remote;
+
+public interface IRemoteTerminalConstants {
+ public static final String PREF_TERMINAL_SHELL_COMMAND = "TERMINAL_SHELL_COMMAND"; //$NON-NLS-1$
+}
diff --git a/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java
new file mode 100644
index 00000000000..f951e2309e8
--- /dev/null
+++ b/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.tm.terminal.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);
+}