From c58c28b9cc02438b78232f299eaa5397a9c92b7f Mon Sep 17 00:00:00 2001
From: Jonah Graham
Date: Fri, 31 Jan 2020 11:02:25 -0500
Subject: [PATCH] Bug 559474: Format all TM.terminal code to CDT standard
This is applying the per-project code formatting rules that would
be applied on save in the JDT editor
See also Bug 540373
Change-Id: Id04c972c3b3cb0a6ed1ab8581185359b7cf43f91
---
.../build.properties | 16 +-
.../build.properties | 16 +-
.../build.properties | 16 +-
.../feature.properties | 2 +-
.../build.properties | 16 +-
.../feature.properties | 2 +-
.../build.properties | 4 +-
.../feature.properties | 2 +-
.../build.properties | 4 +-
.../feature.properties | 2 +-
.../build.properties | 16 +-
.../feature.properties | 2 +-
.../build.properties | 16 +-
.../feature.properties | 2 +-
.../build.properties | 14 +-
.../feature.properties | 2 +-
.../build.properties | 14 +-
.../feature.properties | 2 +-
.../cdtserial/activator/Activator.java | 7 +-
.../controls/SerialSettingsPage.java | 9 +-
.../connector/local/activator/UIPlugin.java | 4 +-
.../LocalWizardConfigurationPanel.java | 81 +-
.../local/launcher/LocalLauncherDelegate.java | 141 ++-
.../local/launcher/LocalLauncherHandler.java | 8 +-
.../connector/process/ProcessConnector.java | 43 +-
.../process/ProcessLauncherDelegate.java | 36 +-
.../connector/process/ProcessMonitor.java | 125 +-
.../connector/process/ProcessSettings.java | 28 +-
.../process/ProcessSettingsPage.java | 15 +-
.../connector/process/activator/UIPlugin.java | 4 +-
.../process/help/IContextHelpIds.java | 1 -
.../connector/remote/IRemoteSettings.java | 12 +-
.../remote/IRemoteTerminalParser.java | 12 +-
.../RemoteWizardConfigurationPanel.java | 16 +-
.../connector/remote/internal/Activator.java | 20 +-
.../remote/internal/ArgumentParser.java | 21 +-
.../internal/RemoteConnectionManager.java | 18 +-
.../remote/internal/RemoteConnector.java | 12 +-
.../remote/internal/RemoteSettings.java | 8 +-
.../remote/internal/RemoteSettingsPage.java | 6 +-
.../launcher/RemoteLauncherDelegate.java | 5 +-
.../remote/launcher/RemoteMementoHandler.java | 10 +-
.../connector/remote/nls/Messages.java | 2 +-
.../connector/ssh/activator/UIPlugin.java | 24 +-
.../ssh/connector/ISshConstants.java | 5 +-
.../connector/ssh/connector/ISshSettings.java | 30 +-
.../connector/KeyboardInteractiveDialog.java | 303 ++---
.../ssh/connector/SshConnection.java | 197 +--
.../connector/ssh/connector/SshConnector.java | 52 +-
.../connector/ssh/connector/SshMessages.java | 4 +-
.../ssh/connector/SshMessages.properties | 4 +-
.../connector/ssh/connector/SshSettings.java | 39 +-
.../ssh/connector/SshSettingsPage.java | 61 +-
.../ssh/connector/UserValidationDialog.java | 32 +-
.../controls/SshWizardConfigurationPanel.java | 116 +-
.../ssh/launcher/SshLauncherDelegate.java | 42 +-
.../ssh/launcher/SshMementoHandler.java | 100 +-
.../connector/telnet/activator/UIPlugin.java | 4 +-
.../telnet/connector/ITelnetSettings.java | 6 +
.../telnet/connector/NetworkPortMap.java | 22 +-
.../telnet/connector/TelnetCodes.java | 104 +-
.../telnet/connector/TelnetConnectWorker.java | 27 +-
.../telnet/connector/TelnetConnection.java | 15 +-
.../telnet/connector/TelnetConnector.java | 61 +-
.../telnet/connector/TelnetMessages.java | 2 +-
.../connector/TelnetMessages.properties | 2 +-
.../telnet/connector/TelnetOption.java | 417 +++----
.../telnet/connector/TelnetProperties.java | 2 +-
.../telnet/connector/TelnetSettings.java | 27 +-
.../telnet/connector/TelnetSettingsPage.java | 63 +-
.../TelnetWizardConfigurationPanel.java | 86 +-
.../launcher/TelnetLauncherDelegate.java | 31 +-
.../telnet/launcher/TelnetMementoHandler.java | 24 +-
.../build.properties | 6 +-
.../plugin.properties | 2 +-
.../terminal/connector/TerminalConnector.java | 71 +-
...TerminalToRemoteInjectionOutputStream.java | 139 ++-
.../control/CommandInputFieldWithHistory.java | 171 +--
.../terminal/control/ICommandInputField.java | 15 +-
.../terminal/control/ITerminalListener2.java | 2 +-
.../control/ITerminalMouseListener.java | 4 +-
.../control/ITerminalViewControl.java | 100 +-
.../control/TerminalViewControlFactory.java | 20 +-
.../actions/AbstractTerminalAction.java | 35 +-
.../control/actions/ActionMessages.java | 3 +-
.../control/actions/ActionMessages.properties | 2 +-
.../terminal/control/actions/ImageConsts.java | 2 +-
.../actions/TerminalActionClearAll.java | 12 +-
.../control/actions/TerminalActionCopy.java | 14 +-
.../control/actions/TerminalActionCut.java | 14 +-
.../control/actions/TerminalActionPaste.java | 19 +-
.../actions/TerminalActionSelectAll.java | 6 +-
.../control/impl/ITerminalControlForText.java | 22 +-
.../control/impl/TerminalMessages.java | 28 +-
.../control/impl/TerminalMessages.properties | 2 +-
.../terminal/control/impl/TerminalPlugin.java | 23 +-
.../emulator/EditActionAccelerators.java | 2 +-
.../emulator/IVT100EmulatorBackend.java | 44 +-
.../emulator/LoggingOutputStream.java | 26 +-
.../emulator/VT100BackendTraceDecorator.java | 47 +-
.../terminal/emulator/VT100Emulator.java | 148 +--
.../emulator/VT100EmulatorBackend.java | 203 ++--
.../emulator/VT100TerminalControl.java | 398 +++---
.../terminal/model/ISnapshotChanges.java | 8 +-
.../terminal/model/SnapshotChanges.java | 225 ++--
.../model/SynchronizedTerminalTextData.java | 41 +-
.../terminal/model/TerminalTextData.java | 92 +-
.../model/TerminalTextDataFastScroll.java | 147 ++-
.../model/TerminalTextDataSnapshot.java | 91 +-
.../terminal/model/TerminalTextDataStore.java | 236 ++--
.../model/TerminalTextDataWindow.java | 148 ++-
.../preferences/ITerminalConstants.java | 14 +-
.../TerminalPreferenceInitializer.java | 2 +-
.../preferences/TerminalPreferencePage.java | 19 +-
.../provisional/api/AbstractSettingsPage.java | 21 +-
.../provisional/api/ISettingsStore.java | 16 +-
.../provisional/api/ITerminalConnector.java | 26 +-
.../provisional/api/ITerminalControl.java | 12 +-
.../terminal/provisional/api/Logger.java | 126 +-
.../api/TerminalConnectorExtension.java | 30 +-
.../provisional/api/TerminalState.java | 6 +-
.../api/provider/TerminalConnectorImpl.java | 20 +-
.../textcanvas/AbstractTextCanvasModel.java | 189 +--
.../terminal/textcanvas/GridCanvas.java | 134 +-
.../terminal/textcanvas/ILinelRenderer.java | 6 +
.../terminal/textcanvas/ITextCanvasModel.java | 6 +
.../textcanvas/ITextCanvasModelListener.java | 2 +
.../terminal/textcanvas/PipedInputStream.java | 112 +-
.../textcanvas/PollingTextCanvasModel.java | 20 +-
.../terminal/textcanvas/StyleMap.java | 152 +--
.../terminal/textcanvas/TextCanvas.java | 171 +--
.../terminal/textcanvas/TextLineRenderer.java | 123 +-
.../terminal/textcanvas/VirtualCanvas.java | 227 ++--
.../tm/terminal/model/ITerminalTextData.java | 12 +-
.../model/ITerminalTextDataReadOnly.java | 2 +
.../model/ITerminalTextDataSnapshot.java | 6 +
.../tm/terminal/model/LineSegment.java | 20 +-
.../org/eclipse/tm/terminal/model/Style.java | 86 +-
.../eclipse/tm/terminal/model/StyleColor.java | 27 +-
.../model/TerminalTextDataFactory.java | 12 +-
.../TerminalConnectorFactoryTest.java | 82 +-
.../connector/TerminalConnectorTest.java | 82 +-
...inalToRemoteInjectionOutputStreamTest.java | 102 +-
.../internal/terminal/emulator/AllTests.java | 2 +-
.../emulator/VT100EmulatorBackendTest.java | 1076 +++++------------
.../model/AbstractITerminalTextDataTest.java | 704 +++++------
.../tm/internal/terminal/model/AllTests.java | 2 +-
.../terminal/model/SnapshotChangesTest.java | 343 +++---
.../SynchronizedTerminalTextDataTest.java | 12 +-
.../model/TerminalTextDataFastScrollTest.java | 12 +-
...rminalTextDataFastScrollTestMaxHeigth.java | 12 +-
.../TerminalTextDataPerformanceTest.java | 233 ++--
.../model/TerminalTextDataSnapshotTest.java | 925 +++++++-------
.../TerminalTextDataSnapshotWindowTest.java | 143 +--
.../model/TerminalTextDataStoreTest.java | 12 +-
.../terminal/model/TerminalTextDataTest.java | 12 +-
.../model/TerminalTextDataWindowTest.java | 384 +++---
.../model/TerminalTextTestHelper.java | 52 +-
.../speedtest/SpeedTestConnection.java | 91 +-
.../speedtest/SpeedTestConnector.java | 29 +-
.../terminal/speedtest/SpeedTestSettings.java | 39 +-
.../terminal/test/terminalcanvas/Main.java | 29 +-
.../test/terminalcanvas/Snippet48.java | 151 +--
.../terminalcanvas/TerminalTextCanvas.java | 95 +-
.../test/terminalcanvas/VirtualCanvas.java | 206 ++--
.../ui/AbstractLineOrientedDataSource.java | 23 +-
.../internal/terminal/test/ui/DataReader.java | 61 +-
.../terminal/test/ui/FastDataSource.java | 20 +-
.../terminal/test/ui/FileDataSource.java | 30 +-
.../terminal/test/ui/IDataSource.java | 12 +-
.../tm/internal/terminal/test/ui/IStatus.java | 12 +-
.../test/ui/LineCountingDataSource.java | 33 +-
.../terminal/test/ui/RandomDataSource.java | 44 +-
.../terminal/test/ui/TerminalTextUITest.java | 178 +--
.../terminal/test/ui/VT100DataSource.java | 35 +-
.../PipedInputStreamPerformanceTest.java | 20 +-
.../terminal/textcanvas/PipedStreamTest.java | 57 +-
.../eclipse/tm/terminal/model/AllTests.java | 2 +-
.../tm/terminal/model/StyleColorTest.java | 19 +-
.../eclipse/tm/terminal/model/StyleTest.java | 110 +-
.../terminal/test/AutomatedPluginTests.java | 2 +-
...minalContextPropertiesProviderFactory.java | 39 +-
.../view/core/TerminalServiceFactory.java | 16 +-
.../ITerminalsConnectorConstants.java | 3 +-
.../view/core/internal/PropertyTester.java | 5 +-
.../preferences/ScopedEclipsePreferences.java | 30 +-
.../view/core/tracing/TraceHandler.java | 23 +-
.../tm/terminal/view/core/utils/Env.java | 15 +-
.../plugin.properties | 2 +-
.../view/ui/actions/AbstractAction.java | 17 +-
.../ui/actions/NewTerminalViewAction.java | 18 +-
.../view/ui/actions/SelectEncodingAction.java | 17 +-
.../view/ui/actions/TabScrollLockAction.java | 10 +-
.../ui/actions/ToggleCommandFieldAction.java | 13 +-
.../terminal/view/ui/activator/UIPlugin.java | 32 +-
.../controls/ConfigurationPanelControl.java | 69 +-
.../view/ui/controls/NoteCompositeHelper.java | 6 +-
.../view/ui/help/IContextHelpIds.java | 1 -
.../IConfigurationPanelContainer.java | 2 -
.../view/ui/interfaces/ILauncherDelegate.java | 2 +-
.../view/ui/interfaces/IMementoHandler.java | 28 +-
.../view/ui/interfaces/IPreferenceKeys.java | 3 +-
.../view/ui/interfaces/ImageConsts.java | 128 +-
.../ui/internal/ExternalExecutablesState.java | 4 +-
.../view/ui/internal/PropertyTester.java | 16 +-
.../view/ui/internal/SettingsStore.java | 6 +-
.../dialogs/EncodingSelectionDialog.java | 186 +--
.../dialogs/LaunchTerminalSettingsDialog.java | 103 +-
.../AbstractTriggerCommandHandler.java | 7 +-
.../DisconnectTerminalCommandHandler.java | 14 +-
.../handler/LaunchTerminalCommandHandler.java | 45 +-
.../ui/launcher/AbstractLauncherDelegate.java | 25 +-
.../ui/launcher/LauncherDelegateManager.java | 77 +-
.../ui/listeners/AbstractWindowListener.java | 65 +-
.../ui/listeners/WorkbenchPartListener.java | 4 +-
.../ui/listeners/WorkbenchWindowListener.java | 2 +-
.../showin/DynamicContributionItems.java | 22 +-
.../showin/ExternalExecutablesDialog.java | 420 ++++---
.../showin/ExternalExecutablesManager.java | 46 +-
.../view/ui/manager/ConsoleManager.java | 126 +-
.../tm/terminal/view/ui/nls/Messages.java | 11 +-
.../terminal/view/ui/nls/Messages.properties | 4 +-
.../ui/panels/AbstractConfigurationPanel.java | 48 +-
.../AbstractExtendedConfigurationPanel.java | 80 +-
.../view/ui/preferences/PreferencePage.java | 160 ++-
.../preferences/PreferencesInitializer.java | 3 +-
.../view/ui/services/TerminalService.java | 128 +-
.../ui/streams/AbstractStreamsConnector.java | 256 ++--
.../view/ui/streams/InputStreamMonitor.java | 414 +++----
.../view/ui/streams/OutputStreamMonitor.java | 338 +++---
.../view/ui/streams/StreamsConnector.java | 5 +-
.../ui/streams/StreamsLauncherDelegate.java | 25 +-
.../view/ui/streams/StreamsSettings.java | 30 +-
.../view/ui/tabs/TabCommandFieldHandler.java | 7 +-
.../view/ui/tabs/TabDisposeListener.java | 15 +-
.../view/ui/tabs/TabFolderManager.java | 161 ++-
.../view/ui/tabs/TabFolderMenuHandler.java | 52 +-
.../view/ui/tabs/TabFolderToolbarHandler.java | 42 +-
.../view/ui/tabs/TabTerminalListener.java | 24 +-
.../view/ui/view/OldTerminalsViewHandler.java | 15 +-
.../terminal/view/ui/view/TerminalsView.java | 141 ++-
.../ui/view/TerminalsViewMementoHandler.java | 80 +-
.../view/showin/GitShowInContextHandler.java | 30 +-
243 files changed, 8230 insertions(+), 7835 deletions(-)
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
index 59d78e93926..89538a20b32 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.feature/build.properties
@@ -1,13 +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
+# 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/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.cdtserial.sdk.feature/build.properties
index 01228655964..9dbf021aaf0 100644
--- 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
@@ -1,13 +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
+# 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/build.properties b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties
index 59d78e93926..89538a20b32 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/build.properties
@@ -1,13 +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
+# 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
index 9acef2d3f8a..6eeb795643a 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.local.feature/feature.properties
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 59d78e93926..89538a20b32 100644
--- 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
@@ -1,13 +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
+# 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
index e3339ab9f3b..a7496356ac9 100644
--- 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
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 8e3ce5326b9..c3d7109be57 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/build.properties
@@ -6,10 +6,10 @@
# 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
+# 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
index 2c8e307d916..92d67a71e3d 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.ssh.feature/feature.properties
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 1b96b29abc4..70b8f53d16b 100644
--- 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
@@ -6,10 +6,10 @@
# 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
+# 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
index b650b956f92..97676b95e42 100644
--- 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
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 59d78e93926..89538a20b32 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/build.properties
@@ -1,13 +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
+# 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
index a3b734b888f..d741ae24e81 100644
--- a/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.properties
+++ b/terminal/features/org.eclipse.tm.terminal.connector.telnet.feature/feature.properties
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 59d78e93926..89538a20b32 100644
--- 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
@@ -1,13 +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
+# 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
index 0c4787ac81c..d757d652160 100644
--- 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
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
diff --git a/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties
index bfccdf49079..865a10c6790 100644
--- a/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/build.properties
@@ -1,13 +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:
+# 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
+# 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
index df9c50ce7f9..7a7e800d62c 100644
--- a/terminal/features/org.eclipse.tm.terminal.control.feature/feature.properties
+++ b/terminal/features/org.eclipse.tm.terminal.control.feature/feature.properties
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 4e9a9c77c82..89538a20b32 100644
--- a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/build.properties
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/build.properties
@@ -1,13 +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:
+# 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
+# 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
index acbfce1de76..922a08ad6ab 100644
--- a/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.properties
+++ b/terminal/features/org.eclipse.tm.terminal.control.sdk.feature/feature.properties
@@ -6,7 +6,7 @@
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
-#
+#
# Contributors:
# Martin Oberhuber (Wind River) - initial API and implementation
###############################################################################
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
index 84edbb2733a..fd41fbe57bf 100644
--- 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
@@ -69,13 +69,13 @@ public class Activator extends AbstractUIPlugin {
}
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
@@ -114,7 +114,8 @@ public class Activator extends AbstractUIPlugin {
if (exception instanceof CoreException) {
log(((CoreException) exception).getStatus());
} else {
- log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), exception.getLocalizedMessage(), exception));
+ 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/controls/SerialSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/src/org/eclipse/tm/terminal/connector/cdtserial/controls/SerialSettingsPage.java
index 1f9f4f2e151..a96aa798a12 100644
--- 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
@@ -246,13 +246,10 @@ public class SerialSettingsPage extends AbstractSettingsPage {
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.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()]);
+ dialogSettings.put(SerialSettings.STOP_BITS_ATTR, StopBits.getStrings()[stopBitsCombo.getSelectionIndex()]);
}
@Override
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
index c725a5cdbcc..f115b5356bd 100644
--- 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
@@ -81,7 +81,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@@ -90,7 +90,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
plugin = null;
scopedPreferences = null;
traceHandler = null;
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
index 28f0bcab2cb..32df2bf63fa 100644
--- 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
@@ -44,18 +44,18 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
*
* @param container The configuration panel container or null.
*/
- public LocalWizardConfigurationPanel(IConfigurationPanelContainer container) {
- super(container);
- }
+ public LocalWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
- /* (non-Javadoc)
- * @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
- */
+ /* (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));
+ 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);
@@ -66,13 +66,14 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
setEncoding("UTF-8"); //$NON-NLS-1$
} else {
String encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
- if (encoding != null && !"".equals(encoding)) setEncoding(encoding); //$NON-NLS-1$
+ if (encoding != null && !"".equals(encoding)) //$NON-NLS-1$
+ setEncoding(encoding);
}
// 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);
+ 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);
@@ -82,36 +83,39 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
resource = getSelectionResource();
}
- setControl(panel);
- }
+ 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;
+ if (data == null)
+ return;
- String value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
- if (value != null) setEncoding(value);
- }
+ 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$
+ // 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
+ // 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();
+ 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);
}
}
@@ -121,21 +125,21 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
*/
@Override
- protected void fillSettingsForHost(String host){
+ protected void fillSettingsForHost(String host) {
}
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
*/
@Override
- protected void saveSettingsForHost(boolean add){
+ protected void saveSettingsForHost(boolean add) {
}
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
*/
@Override
- public boolean isValid(){
+ public boolean isValid() {
return true;
}
@@ -143,16 +147,16 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
* @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) {
+ 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) {
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
// Restore the encodings widget values
doRestoreEncodingsWidgetValues(settings, idPrefix);
}
@@ -161,17 +165,17 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
*/
@Override
- protected String getHostFromSettings() {
+ protected String getHostFromSettings() {
return null;
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isWithHostList()
*/
@Override
- public boolean isWithHostList() {
- return false;
- }
+ public boolean isWithHostList() {
+ return false;
+ }
/**
* Returns the IResource from the current selection
@@ -184,11 +188,12 @@ public class LocalWizardConfigurationPanel extends AbstractExtendedConfiguration
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 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 (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
index a7277d69dbf..c1f9291b28f 100644
--- 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
@@ -104,7 +104,8 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
} else {
encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
}
- if (encoding != null && !"".equals(encoding)) properties.put(ITerminalsConnectorConstants.PROP_ENCODING, encoding); //$NON-NLS-1$
+ if (encoding != null && !"".equals(encoding)) //$NON-NLS-1$
+ properties.put(ITerminalsConnectorConstants.PROP_ENCODING, encoding);
}
// For local terminals, force a new terminal tab each time it is launched,
@@ -115,9 +116,11 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
// 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 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$
+ 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$
@@ -126,16 +129,18 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
URI uri = URIUtil.fromString(eclipseHomeLocation);
File f = URIUtil.toFile(uri);
cwd = f.getAbsolutePath();
- } catch (URISyntaxException ex) { /* ignored on purpose */ }
+ } 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();
- }
+ 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 {
@@ -161,28 +166,39 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
// 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 ((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();
+ 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 (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;
+ 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 (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;
@@ -190,7 +206,7 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
}
if (element instanceof IPath || element instanceof File) {
- File f = element instanceof IPath ? ((IPath)element).toFile() : (File)element;
+ File f = element instanceof IPath ? ((IPath) element).toFile() : (File) element;
if (f.isDirectory() && f.canRead()) {
dir = f.getAbsolutePath();
break;
@@ -225,14 +241,16 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
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;
+ 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 */ }
+ } catch (UnknownHostException e) {
+ /* ignored on purpose */ }
return "Local"; //$NON-NLS-1$
}
@@ -245,7 +263,7 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
if (IMementoHandler.class.equals(adapter)) {
return mementoHandler;
}
- return super.getAdapter(adapter);
+ return super.getAdapter(adapter);
}
/**
@@ -264,7 +282,8 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
}
}
if (shell == null) {
- shell = org.eclipse.tm.terminal.view.ui.activator.UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_DEFAULT_SHELL_UNIX);
+ 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$
@@ -280,13 +299,14 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
*/
- @Override
+ @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$
+ 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;
@@ -295,17 +315,19 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
File defaultShell = defaultShell();
image = defaultShell.isAbsolute() ? defaultShell.getAbsolutePath() : defaultShell.getPath();
} else {
- image = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH);
+ image = (String) properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH);
}
- String arguments = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ARGS);
+ 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);
+ 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 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)
@@ -315,7 +337,7 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
localEcho = !isUsingPTY;
}
} else {
- localEcho = ((Boolean)properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)).booleanValue();
+ localEcho = ((Boolean) properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)).booleanValue();
}
String lineSeparator = null;
@@ -323,28 +345,32 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
|| !(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;
+ lineSeparator = Platform.OS_WIN32.equals(Platform.getOS()) ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF
+ : ILineSeparatorConstants.LINE_SEPARATOR_LF;
}
} else {
- lineSeparator = (String)properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR);
+ 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);
+ 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);
+ 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));
+ if (envp != null)
+ envpList.addAll(Arrays.asList(envp));
// ECLIPSE_HOME
String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
@@ -353,21 +379,23 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
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 */ }
+ } 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$
- }
+ 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() //$NON-NLS-1$
+ .getLocation().toOSString());
+ }
}
- // Convert back into a string array
- envp = envpList.toArray(new String[envpList.size()]);
+ // Convert back into a string array
+ envp = envpList.toArray(new String[envpList.size()]);
Assert.isTrue(image != null || process != null);
@@ -389,7 +417,8 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
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);
+ processSettings
+ .setMergeWithNativeEnvironment(value instanceof Boolean ? ((Boolean) value).booleanValue() : false);
}
// And save the settings to the store
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
index d8701cb49b1..fa2a9c1d2b2 100644
--- 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
@@ -46,10 +46,12 @@ public class LocalLauncherHandler extends AbstractHandler {
if (!(selection instanceof IStructuredSelection)) {
IEditorInput input = HandlerUtil.getActiveEditorInput(event);
if (input instanceof IPathEditorInput) {
- IPath path = ((IPathEditorInput)input).getPath();
+ 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);
+ if (path.toFile().isFile())
+ path = path.removeLastSegments(1);
+ if (path.toFile().isDirectory() && path.toFile().canRead())
+ selection = new StructuredSelection(path);
}
}
}
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
index a297da9cd9a..68469eba7e6 100644
--- 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
@@ -113,7 +113,7 @@ public class ProcessConnector extends AbstractStreamsConnector {
pty = new PTY(PTY.Mode.TERMINAL);
// Initialize the terminal size
- VT100Emulator text = ((VT100TerminalControl)control).getTerminalText();
+ VT100Emulator text = ((VT100TerminalControl) control).getTerminalText();
text.fontChanged();
} catch (IOException e) {
// PTY not supported
@@ -129,13 +129,13 @@ public class ProcessConnector extends AbstractStreamsConnector {
command.append(arguments.trim());
}
- File workingDir =null;
- if (settings.getWorkingDir()!=null){
+ File workingDir = null;
+ if (settings.getWorkingDir() != null) {
workingDir = new File(settings.getWorkingDir());
}
String[] envp = null;
- if (settings.getEnvironment()!=null){
+ if (settings.getEnvironment() != null) {
envp = settings.getEnvironment();
}
@@ -165,7 +165,8 @@ public class ProcessConnector extends AbstractStreamsConnector {
}
// Execute the process
- process = ProcessFactory.getFactory().exec(argv.toArray(new String[argv.size()]), envp, workingDir, pty);
+ 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);
@@ -177,11 +178,9 @@ public class ProcessConnector extends AbstractStreamsConnector {
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$
+ } else if ("\n".equals(lineSeparator)) { //$NON-NLS-1$
lineSeparator = ILineSeparatorConstants.LINE_SEPARATOR_LF;
- }
- else {
+ } else {
lineSeparator = ILineSeparatorConstants.LINE_SEPARATOR_CRLF;
}
}
@@ -196,7 +195,8 @@ public class ProcessConnector extends AbstractStreamsConnector {
control.setVT100LineWrapping(true);
// connect the streams
- connectStreams(control, process.getOutputStream(), process.getInputStream(), (pty == null ? process.getErrorStream() : null), settings.isLocalEcho(), lineSeparator);
+ 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);
@@ -209,7 +209,8 @@ public class ProcessConnector extends AbstractStreamsConnector {
disconnect();
// Lookup the tab item
CTabItem item = ConsoleManager.getInstance().findConsole(control);
- if (item != null) item.dispose();
+ 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);
@@ -225,10 +226,10 @@ public class ProcessConnector extends AbstractStreamsConnector {
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$
- }
+ 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()
@@ -252,7 +253,10 @@ public class ProcessConnector extends AbstractStreamsConnector {
if (!isWindows) {
// Destroy the process first, except on windows (Bug 465674)
- if (process != null) { process.destroy(); process = null; }
+ if (process != null) {
+ process.destroy();
+ process = null;
+ }
}
// Dispose the streams
@@ -260,7 +264,10 @@ public class ProcessConnector extends AbstractStreamsConnector {
if (isWindows) {
// On Windows destroy the process after closing streams
- if (process != null) { process.destroy(); process = null; }
+ if (process != null) {
+ process.destroy();
+ process = null;
+ }
}
// Set the terminal control state to CLOSED.
@@ -274,7 +281,7 @@ public class ProcessConnector extends AbstractStreamsConnector {
*/
@Override
public void setDefaultSettings() {
- settings.load(new NullSettingsStore());
+ settings.load(new NullSettingsStore());
}
/* (non-Javadoc)
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
index bc9e067f29d..493c9d50b3d 100644
--- 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
@@ -72,26 +72,29 @@ public class ProcessLauncherDelegate extends AbstractLauncherDelegate {
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$
+ 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);
+ 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);
+ 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);
+ 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);
@@ -114,7 +117,8 @@ public class ProcessLauncherDelegate extends AbstractLauncherDelegate {
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);
+ processSettings
+ .setMergeWithNativeEnvironment(value instanceof Boolean ? ((Boolean) value).booleanValue() : false);
}
// And save the settings to the store
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
index ad509ca1b50..ff61cb9f5f3 100644
--- 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
@@ -13,7 +13,6 @@ package org.eclipse.tm.terminal.connector.process;
import org.eclipse.core.runtime.Assert;
-
/**
* Process monitor implementation.
*/
@@ -27,82 +26,84 @@ public class ProcessMonitor {
// 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();
- /**
- * Constructor.
- *
- * @param processConnector The parent process connector. Must not be null.
- */
- public ProcessMonitor(ProcessConnector processConnector) {
- super();
-
- Assert.isNotNull(processConnector);
+ Assert.isNotNull(processConnector);
this.processConnector = processConnector;
// Query the monitored process for easier access
this.process = processConnector.getProcess();
- }
+ }
- /**
- * Dispose the process monitor.
- */
+ /**
+ * Dispose the process monitor.
+ */
public void dispose() {
- // Set the disposed status
- disposed = true;
- // Not initialized -> return immediately
- if (thread == null) return;
+ // 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();
- }
+ // 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;
+ /**
+ * 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
+ // Create a new runnable which is constantly reading from the stream
+ Runnable runnable = new Runnable() {
+ @Override
public void run() {
- monitorProcess();
- }
- };
+ monitorProcess();
+ }
+ };
- // Create the monitor thread
- thread = new Thread(runnable, "Terminal Process Monitor Thread"); //$NON-NLS-1$
+ // Create the monitor thread
+ thread = new Thread(runnable, "Terminal Process Monitor Thread"); //$NON-NLS-1$
- // Configure the monitor thread
- thread.setDaemon(true);
+ // Configure the monitor thread
+ thread.setDaemon(true);
- // Start the processing
- thread.start();
- }
+ // Start the processing
+ thread.start();
+ }
- /**
- * Monitors the associated system process, waiting for it to terminate,
- * and notifies the associated process monitor's.
- */
+ /**
+ * 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;
+ // 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();
- }
- }
+ 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
index 4d74734df74..97a7084b7e0 100644
--- 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
@@ -113,7 +113,8 @@ public class ProcessSettings {
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);
+ if (pty == null)
+ setLocalEcho(true);
}
/**
@@ -265,15 +266,18 @@ public class ProcessSettings {
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$
+ 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$
+ 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$
}
}
@@ -291,11 +295,11 @@ public class ProcessSettings {
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$
+ ((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
index 3b734e318b4..58f59e88682 100644
--- 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
@@ -69,7 +69,8 @@ public class ProcessSettingsPage extends AbstractSettingsPage {
// 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;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
panel.setLayout(layout);
panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -80,7 +81,8 @@ public class ProcessSettingsPage extends AbstractSettingsPage {
// 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;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
innerPanel.setLayout(layout);
innerPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -127,7 +129,8 @@ public class ProcessSettingsPage extends AbstractSettingsPage {
*/
protected void onBrowseButtonSelected(SelectionEvent e) {
// Determine the shell
- Shell shell = e != null ? e.widget.getDisplay().getActiveShell() : PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ Shell shell = e != null ? e.widget.getDisplay().getActiveShell()
+ : PlatformUI.getWorkbench().getDisplay().getActiveShell();
// create a standard file dialog
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
@@ -141,7 +144,8 @@ public class ProcessSettingsPage extends AbstractSettingsPage {
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();
+ String filterFileName = filePath.toFile().isDirectory() || !filePath.toFile().exists() ? null
+ : filePath.lastSegment();
if (!filterPath.isEmpty()) {
dialog.setFilterPath(filterPath.toString());
@@ -152,7 +156,8 @@ public class ProcessSettingsPage extends AbstractSettingsPage {
} 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());
+ dialog.setFilterPath(
+ org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
}
}
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
index bf236afcf2e..6965fb78e45 100644
--- 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
@@ -69,7 +69,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@@ -78,7 +78,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
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
index 2d042f346d7..7c6dcb752bf 100644
--- 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
@@ -13,7 +13,6 @@ package org.eclipse.tm.terminal.connector.process.help;
import org.eclipse.tm.terminal.connector.process.activator.UIPlugin;
-
/**
* Context help id definitions.
*/
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
index e0c4671e641..5e4d711372a 100644
--- 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
@@ -1,9 +1,9 @@
/*******************************************************************************
* 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/
+ * 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;
@@ -13,14 +13,14 @@ public interface IRemoteSettings {
/**
* 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/IRemoteTerminalParser.java b/terminal/plugins/org.eclipse.tm.terminal.connector.remote/src/org/eclipse/tm/terminal/connector/remote/IRemoteTerminalParser.java
index dd8670059dc..3a91f1b5547 100644
--- 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
@@ -1,9 +1,9 @@
/*******************************************************************************
* 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/
+ * 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;
@@ -16,7 +16,7 @@ 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
@@ -28,7 +28,7 @@ public interface IRemoteTerminalParser {
/**
* 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
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
index 5a8853f3d87..f0cb639f2fc 100644
--- 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
@@ -50,7 +50,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
*/
@Override
@@ -88,7 +88,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#setupData(java.util.Map)
*/
@Override
@@ -117,7 +117,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#extractData(java.util.Map)
*/
@Override
@@ -141,7 +141,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
*/
@Override
@@ -150,7 +150,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
*/
@Override
@@ -159,7 +159,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
*/
@Override
@@ -169,7 +169,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.
* IDialogSettings, java.lang.String)
*/
@@ -181,7 +181,7 @@ public class RemoteWizardConfigurationPanel extends AbstractExtendedConfiguratio
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
*/
@Override
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
index 4ab951914e8..1d7e63dfecc 100644
--- 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
@@ -1,9 +1,9 @@
/*******************************************************************************
* 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/
+ * 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;
@@ -45,7 +45,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
@@ -54,7 +54,7 @@ public class Activator extends Plugin {
/**
* Returns an image descriptor for the image file at the given plug-in relative path.
- *
+ *
* @param path
* the path
* @return the image descriptor
@@ -65,7 +65,7 @@ public class Activator extends Plugin {
/**
* Create log entry from an IStatus
- *
+ *
* @param status
* status to log
*/
@@ -75,7 +75,7 @@ public class Activator extends Plugin {
/**
* Create log entry from a string
- *
+ *
* @param msg
* message to log
*/
@@ -85,7 +85,7 @@ public class Activator extends Plugin {
/**
* Create log entry from a Throwable
- *
+ *
* @param e
* throwable to log
*/
@@ -97,7 +97,7 @@ public class Activator extends Plugin {
/**
* Generate a unique identifier
- *
+ *
* @return unique identifier string
*/
public static String getUniqueIdentifier() {
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
index 59d647b9ef6..ca3e15e474e 100644
--- 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
@@ -6,7 +6,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -103,7 +103,8 @@ public class ArgumentParser {
* string. Allows escaping.
*/
iterator.next(); // Skip quote
- quoted_reader: while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '"')) {
+ quoted_reader: while ((iterator.current() != CharacterIterator.DONE)
+ && (iterator.current() != '"')) {
char innerChar = iterator.current();
switch (innerChar) {
case '\\':
@@ -177,7 +178,7 @@ public class ArgumentParser {
/**
* 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
@@ -254,7 +255,7 @@ public class ArgumentParser {
/**
* Returns a List of all entries of the command line.
- *
+ *
* @return The Array
*/
public String[] getTokenArray() {
@@ -263,7 +264,7 @@ public class ArgumentParser {
/**
* Returns a List of all entries of the command line.
- *
+ *
* @return The List
*/
public List getTokenList() {
@@ -273,7 +274,7 @@ public class ArgumentParser {
/**
* 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.
*/
@@ -287,7 +288,7 @@ public class ArgumentParser {
/**
* 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
@@ -305,7 +306,7 @@ public class ArgumentParser {
/**
* 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.
*/
@@ -319,7 +320,7 @@ public class ArgumentParser {
/**
* 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.
*/
@@ -332,7 +333,7 @@ public class ArgumentParser {
/**
* Returns the total number of entries.
- *
+ *
* @return the total number of entries
*/
public int getSize() {
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
index 93279eadf3b..a05278cf799 100644
--- 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
@@ -64,7 +64,7 @@ public class RemoteConnectionManager extends Job {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
@@ -79,15 +79,15 @@ public class RemoteConnectionManager extends Job {
remoteConnection = connType.getConnection(connector.getRemoteSettings().getConnectionName());
}
if (remoteConnection == null) {
- return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(),
- NLS.bind(Messages.RemoteConnectionManager_0, connector.getRemoteSettings().getConnectionName()));
+ 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()));
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), NLS.bind(
+ Messages.RemoteConnectionManager_1, connector.getRemoteSettings().getConnectionName()));
}
}
@@ -104,7 +104,8 @@ public class RemoteConnectionManager extends Job {
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);
+ IRemoteCommandShellService cmdShellSvc = remoteConnection
+ .getService(IRemoteCommandShellService.class);
synchronized (this) {
remoteProcess = cmdShellSvc.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
}
@@ -117,7 +118,8 @@ public class RemoteConnectionManager extends Job {
.getProcessBuilder(new ArgumentParser(terminalShellCommand).getTokenList());
remoteProcess = processBuilder.start(IRemoteProcessBuilder.ALLOCATE_PTY);
} else {
- return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), Messages.RemoteConnectionManager_2);
+ return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(),
+ Messages.RemoteConnectionManager_2);
}
}
@@ -164,7 +166,7 @@ public class RemoteConnectionManager extends Job {
/**
* Read the data from the connection and display it in the terminal.
- *
+ *
* @param in
* @throws IOException
*/
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
index 18b3ec59acc..5b79753f3c9 100644
--- 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
@@ -38,7 +38,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#connect(org.eclipse.tm.internal.terminal.
* provisional.api.ITerminalControl)
@@ -53,7 +53,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#doDisconnect()
*/
@Override
@@ -67,7 +67,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getSettingsSummary()
*/
@Override
@@ -77,7 +77,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/**
* Return the Remote Settings.
- *
+ *
* @return the settings for a concrete connection.
*/
public IRemoteSettings getRemoteSettings() {
@@ -86,7 +86,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getTerminalToRemoteStream()
*/
@Override
@@ -119,7 +119,7 @@ public class RemoteConnector extends TerminalConnectorImpl {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#setTerminalSize(int, int)
*/
@Override
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
index 37dae29bf91..1d880b1da0c 100644
--- 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
@@ -1,9 +1,9 @@
/*******************************************************************************
* 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/
+ * 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;
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
index 8a5958027da..dbd3a5b48b3 100644
--- 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
@@ -40,7 +40,8 @@ public class RemoteSettingsPage extends AbstractSettingsPage {
if (fTerminalSettings != null && fRemoteConnectionWidget != null && !fRemoteConnectionWidget.isDisposed()) {
if (fRemoteConnectionWidget.getConnection() != null) {
if (fRemoteConnectionWidget.getConnection().getConnectionType() != null) {
- fTerminalSettings.setConnectionTypeId(fRemoteConnectionWidget.getConnection().getConnectionType().getId());
+ fTerminalSettings
+ .setConnectionTypeId(fRemoteConnectionWidget.getConnection().getConnectionType().getId());
}
fTerminalSettings.setConnectionName(fRemoteConnectionWidget.getConnection().getName());
}
@@ -50,7 +51,8 @@ public class RemoteSettingsPage extends AbstractSettingsPage {
@Override
public void loadSettings() {
if (fTerminalSettings != null && fRemoteConnectionWidget != null && !fRemoteConnectionWidget.isDisposed()) {
- fRemoteConnectionWidget.setConnection(fTerminalSettings.getConnectionTypeId(), fTerminalSettings.getConnectionName());
+ fRemoteConnectionWidget.setConnection(fTerminalSettings.getConnectionTypeId(),
+ fTerminalSettings.getConnectionName());
}
}
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
index 32fb70edb39..32d77f4e0d7 100644
--- 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
@@ -98,7 +98,8 @@ public class RemoteLauncherDelegate extends AbstractLauncherDelegate {
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;
+ if (title != null)
+ return title;
String connection = (String) properties.get(IRemoteSettings.CONNECTION_NAME);
@@ -107,7 +108,7 @@ public class RemoteLauncherDelegate extends AbstractLauncherDelegate {
String date = format.format(new Date(System.currentTimeMillis()));
return NLS.bind(Messages.RemoteLauncherDelegate_terminalTitle, new String[] { connection, date });
}
-
+
return Messages.RemoteLauncherDelegate_terminalTitle_default;
}
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
index 9b478cbc5c1..1fcd847e784 100644
--- 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
@@ -26,7 +26,7 @@ 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
@@ -37,14 +37,15 @@ public class RemoteMementoHandler implements IMementoHandler {
// 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(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
@@ -55,6 +56,7 @@ public class RemoteMementoHandler implements IMementoHandler {
// 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));
+ 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
index 5a209c22383..12862dc6601 100644
--- 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
@@ -23,7 +23,7 @@ public class Messages extends NLS {
public static String RemoteTerminalPreferencePage_0;
public static String TERMINAL_EXCEPTION;
-
+
public static String RemoteLauncherDelegate_terminalTitle;
public static String RemoteLauncherDelegate_terminalTitle_default;
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
index 45b7e429d76..598f41ef17b 100644
--- 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
@@ -70,28 +70,28 @@ public class UIPlugin extends AbstractUIPlugin {
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 {
+ @Override
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null);
- tracker.open();
+ 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 {
+ public void stop(BundleContext context) throws Exception {
try {
SshConnection.shutdown();
tracker.close();
@@ -106,13 +106,13 @@ public class UIPlugin extends AbstractUIPlugin {
* @return An instance of IJSchService, or null if no
* IJschService service is available.
*/
- public IJSchService getJSchService() {
- return (IJSchService)tracker.getService();
- }
+ public IJSchService getJSchService() {
+ return (IJSchService) tracker.getService();
+ }
- //---------------------------------------------------------------------------
+ //---------------------------------------------------------------------------
//
- //---------------------------------------------------------------------------
+ //---------------------------------------------------------------------------
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
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
index 2bcc30b4681..0d4bd371467 100644
--- 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
@@ -10,17 +10,16 @@
* 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
+ * 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
+ // 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
index 939addb8116..65d2b0c69e4 100644
--- 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
@@ -1,11 +1,11 @@
/*******************************************************************************
* 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:
+ * 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
@@ -18,26 +18,26 @@ 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
- */
+ * @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.
@@ -47,9 +47,9 @@ public interface ISshSettings {
/**
* 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.
+ * 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();
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
index 8e45799ff72..8cbff227e79 100644
--- 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
@@ -33,161 +33,164 @@ import org.eclipse.ui.PlatformUI;
* A dialog for keyboad-interactive authentication for the ssh2 connection.
*/
public class KeyboardInteractiveDialog extends TrayDialog {
- // widgets
- private Text[] texts;
+ // 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;
+ 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));
+ /**
+ * 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$
+ }
- // set F1 help
- PlatformUI.getWorkbench().getHelpSystem().setHelp(main, ISshConstants.HELP_KEYBOARD_INTERACTIVE_DIALOG);
+ /**
+ * @see Window#configureShell
+ */
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(message);
+ }
- 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];
+ /**
+ * @see Window#create
+ */
+ @Override
+ public void create() {
+ super.create();
+ if (texts.length > 0) {
+ texts[0].setFocus();
+ }
+ }
- 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();
- }
+ 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 < prompt.length; i++) {
+ new Label(parent, SWT.NONE).setText(prompt[i]);
+ texts[i] = new Text(parent, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
+ texts[i].setLayoutData(data);
+
+ if (!echo[i]) {
+ texts[i].setEchoChar('*');
+ }
+ new Label(parent, SWT.NONE);
+ }
+
+ }
+
+ /**
+ * Returns the entered values, or null
+ * if the user cancelled.
+ *
+ * @return the entered values
+ */
+ public String[] getResult() {
+ return result;
+ }
+
+ /**
+ * 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() {
+ result = new String[prompt.length];
+ for (int i = 0; i < texts.length; i++) {
+ result[i] = texts[i].getText();
+ }
+ super.okPressed();
+ }
+
+ /**
+ * Notifies that the cancel button of this dialog has been pressed.
+ *
+ * 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
index 954b76aa4ba..ee92426bfe1 100644
--- 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
@@ -54,8 +54,9 @@ public class SshConnection extends Thread {
private final SshConnector fConn;
private Session fSession;
private boolean fDisconnectHasBeenCalled;
- protected SshConnection(SshConnector conn,ITerminalControl control) {
- super("SshConnection-"+fgNo++); //$NON-NLS-1$
+
+ protected SshConnection(SshConnector conn, ITerminalControl control) {
+ super("SshConnection-" + fgNo++); //$NON-NLS-1$
fControl = control;
fConn = conn;
fControl.setState(TerminalState.CONNECTING);
@@ -72,19 +73,20 @@ public class SshConnection extends Thread {
* 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)
+ 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;
- }
+ session.setUserInfo(wrapperUI);
+ return session;
+ }
public static void shutdown() {
//TODO: Store all Jsch sessions in a pool and disconnect them on shutdown
@@ -95,7 +97,7 @@ public class SshConnection extends Thread {
//----------------------------------------------------------------------
@Override
- public void run() {
+ public void run() {
boolean connectSucceeded = false;
String host = ""; //$NON-NLS-1$
int port = ISshSettings.DEFAULT_SSH_PORT;
@@ -107,32 +109,31 @@ public class SshConnection extends Thread {
String password = fConn.getSshSettings().getPassword();
port = fConn.getSshSettings().getPort();
- UserInfo ui=new MyUserInfo(null, user, password);
+ UserInfo ui = new MyUserInfo(null, user, password);
- Session session = createSession(user, password, host, port,
- ui, new NullProgressMonitor());
+ 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
+ //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.
+ session.connect(nTimeout); // making connection with timeout.
// if we got disconnected, do not continue
- if(!isSessionConnected())
+ if (!isSessionConnected())
return;
- ChannelShell channel=(ChannelShell) session.openChannel("shell"); //$NON-NLS-1$
+ 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);
@@ -195,18 +196,19 @@ public class SshConnection extends Thread {
void disconnect() {
interrupt();
synchronized (this) {
- fDisconnectHasBeenCalled=true;
- if(fSession!=null) {
+ 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;
+ fSession = null;
}
}
}
+
/**
* Read the data from the ssh connection and display it in the terminal.
* @param in
@@ -214,45 +216,47 @@ public class SshConnection extends Thread {
*/
private void readDataForever(InputStream in) throws IOException {
// read the data
- byte bytes[]=new byte[32*1024];
+ 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);
+ 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;
- }
+ 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;
+ 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() {
+ public String getPassword() {
return fPassword;
}
+
@Override
- public boolean promptYesNo(final String str) {
+ 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() {
+ public void run() {
// [168197] Replace JFace MessagDialog by SWT MessageBox
//retval[0] = MessageDialog.openQuestion(null, SshMessages.WARNING, str);
if (isSessionConnected()) {
@@ -267,11 +271,12 @@ public class SshConnection extends Thread {
});
return retval[0];
}
+
private String promptSecret(final String message) {
final String[] retval = new String[1];
getStandardDisplay().syncExec(new Runnable() {
@Override
- public void run() {
+ public void run() {
if (isSessionConnected()) {
UserValidationDialog uvd = new UserValidationDialog(null, fConnectionId, fUser, message);
uvd.setUsernameMutable(false);
@@ -287,29 +292,33 @@ public class SshConnection extends Thread {
});
return retval[0];
}
+
@Override
- public String getPassphrase() {
+ public String getPassphrase() {
return fPassphrase;
}
+
@Override
- public boolean promptPassphrase(String message) {
+ public boolean promptPassphrase(String message) {
fPassphrase = promptSecret(message);
- return (fPassphrase!=null);
+ return (fPassphrase != null);
}
+
@Override
- public boolean promptPassword(final String message) {
+ public boolean promptPassword(final String message) {
String _password = promptSecret(message);
- if (_password!=null) {
- fPassword=_password;
- return true;
- }
+ if (_password != null) {
+ fPassword = _password;
+ return true;
+ }
return false;
}
+
@Override
- public void showMessage(final String message) {
+ public void showMessage(final String message) {
Display.getDefault().syncExec(new Runnable() {
@Override
- public void run() {
+ public void run() {
// [168197] Replace JFace MessagDialog by SWT MessageBox
// MessageDialog.openInformation(null, SshMessages.INFO, message);
if (isSessionConnected()) {
@@ -321,50 +330,50 @@ public class SshConnection extends Thread {
}
});
}
+
@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);
+ 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++;
+ }
+ });
+ 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){
+ } catch (OperationCanceledException e) {
return null;
}
}
- }
+ }
- private void connectFailed(String terminalText, String msg) {
+ private void connectFailed(String terminalText, String msg) {
Logger.log(terminalText);
fControl.displayTextInTerminal(terminalText);
// fControl.setMsg(msg);
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
index e940feafdb3..a402fdc8b70 100644
--- 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
@@ -36,24 +36,29 @@ public class SshConnector extends TerminalConnectorImpl {
private final SshSettings fSettings;
private int fWidth;
private int fHeight;
+
public SshConnector() {
this(new SshSettings());
}
+
public SshConnector(SshSettings settings) {
- fSettings=settings;
+ fSettings = settings;
}
+
@Override
- public void initialize() throws Exception {
- fJsch=new JSch();
+ public void initialize() throws Exception {
+ fJsch = new JSch();
}
+
@Override
- public void connect(ITerminalControl control) {
+ public void connect(ITerminalControl control) {
super.connect(control);
- fConnection = new SshConnection(this,control);
+ fConnection = new SshConnection(this, control);
fConnection.start();
}
+
@Override
- synchronized public void doDisconnect() {
+ synchronized public void doDisconnect() {
fConnection.disconnect();
if (getInputStream() != null) {
try {
@@ -71,28 +76,34 @@ public class SshConnector extends TerminalConnectorImpl {
}
}
}
+
@Override
- public void setTerminalSize(int newWidth, int newHeight) {
- if(fChannel!=null && (newWidth!=fWidth || newHeight!=fHeight)) {
+ 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;
+ fChannel.setPtySize(newWidth, newHeight, 8 * newWidth, 8 * newHeight);
+ fWidth = newWidth;
+ fHeight = newHeight;
}
}
+
public InputStream getInputStream() {
return fInputStream;
}
+
@Override
- public OutputStream getTerminalToRemoteStream() {
+ public OutputStream getTerminalToRemoteStream() {
return fOutputStream;
}
+
void setInputStream(InputStream inputStream) {
fInputStream = inputStream;
}
+
void setOutputStream(OutputStream outputStream) {
fOutputStream = outputStream;
}
+
/**
* Return the SSH Settings.
*
@@ -102,31 +113,38 @@ public class SshConnector extends TerminalConnectorImpl {
public ISshSettings getSshSettings() {
return fSettings;
}
+
@Override
public void setDefaultSettings() {
fSettings.load(new NullSettingsStore());
}
+
@Override
- public String getSettingsSummary() {
+ public String getSettingsSummary() {
return fSettings.getSummary();
}
+
@Override
- public void load(ISettingsStore store) {
+ public void load(ISettingsStore store) {
fSettings.load(store);
}
+
@Override
- public void save(ISettingsStore store) {
+ 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;
+ 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
index 74f0334e6e8..3e8bf0cc648 100644
--- 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
@@ -59,7 +59,7 @@ public class SshMessages extends NLS {
public static String java_net_SocketException;
public static String java_net_NoRouteToHostException;
- //
+ //
public static String getMessageFor(Throwable throwable) {
String message = getMessage(getMessageKey(throwable));
@@ -96,4 +96,4 @@ public class SshMessages extends NLS {
//
- }
+}
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
index 70588e272be..70d31247c9e 100644
--- 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
@@ -8,7 +8,7 @@
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
-# Michael Scharf (Wind River) - initial API and implementation
+# 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)
@@ -52,4 +52,4 @@ 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
+# 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
index f39e8c6460f..ea8ad058fbd 100644
--- 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
@@ -19,14 +19,15 @@ 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;
+ protected String fHost;
+ protected String fUser;
+ protected String fPassword;
+ protected String fPort;
+ protected String fTimeout;
+ protected String fKeepalive;
+
@Override
- public String getHost() {
+ public String getHost() {
return fHost;
}
@@ -35,16 +36,16 @@ public class SshSettings implements ISshSettings {
}
@Override
- public String getSummary() {
- String settings = getUser()+'@'+getHost();
- if(getPort()!=ISshSettings.DEFAULT_SSH_PORT) {
+ 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) {
+ 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
@@ -57,7 +58,7 @@ public class SshSettings implements ISshSettings {
}
@Override
- public void save(ISettingsStore store) {
+ 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$
@@ -68,15 +69,15 @@ public class SshSettings implements ISshSettings {
store.put("Keepalive", fKeepalive);//$NON-NLS-1$
}
-
@Override
- public int getTimeout() {
+ public int getTimeout() {
try {
return Integer.parseInt(fTimeout);
} catch (NumberFormatException numberFormatException) {
return 10;
}
}
+
public String getTimeoutString() {
return fTimeout;
}
@@ -86,13 +87,14 @@ public class SshSettings implements ISshSettings {
}
@Override
- public int getKeepalive() {
+ public int getKeepalive() {
try {
return Integer.parseInt(fKeepalive);
} catch (NumberFormatException numberFormatException) {
return 300;
}
}
+
public String getKeepaliveString() {
return fKeepalive;
}
@@ -102,15 +104,16 @@ public class SshSettings implements ISshSettings {
}
@Override
- public String getUser() {
+ public String getUser() {
return fUser;
}
public void setUser(String user) {
fUser = user;
}
+
@Override
- public int getPort() {
+ public int getPort() {
try {
return Integer.parseInt(fPort);
} catch (NumberFormatException numberFormatException) {
@@ -127,7 +130,7 @@ public class SshSettings implements ISshSettings {
}
@Override
- public String getPassword() {
+ public String getPassword() {
return fPassword;
}
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
index 02b9428e9a8..043ea44c959 100644
--- 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
@@ -37,10 +37,11 @@ public class SshSettingsPage extends AbstractSettingsPage {
private Text fPassword;
public SshSettingsPage(SshSettings settings) {
- fTerminalSettings=settings;
+ fTerminalSettings = settings;
}
+
@Override
- public void saveSettings() {
+ public void saveSettings() {
fTerminalSettings.setHost(fHostText.getText());
fTerminalSettings.setUser(fUser.getText());
fTerminalSettings.setPassword(fPassword.getText());
@@ -50,23 +51,25 @@ public class SshSettingsPage extends AbstractSettingsPage {
}
@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$
+ 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$
+ fPassword.setText(get(fTerminalSettings.getPassword(), ""));//$NON-NLS-1$
}
}
+
String get(String value, String def) {
- if(value==null || value.length()==0)
+ if (value == null || value.length() == 0)
return def;
return value;
}
+
@Override
- public boolean validateSettings() {
+ public boolean validateSettings() {
String message = null;
int messageType = IMessageProvider.NONE;
boolean valid = true;
@@ -75,7 +78,10 @@ public class SshSettingsPage extends AbstractSettingsPage {
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; }
+ if (mt > messageType) {
+ message = m;
+ messageType = mt;
+ }
valid = false;
} else {
@@ -85,7 +91,10 @@ public class SshSettingsPage extends AbstractSettingsPage {
String m = "Please enter a username."; //$NON-NLS-1$
int mt = IMessageProvider.INFORMATION;
updateControlDecoration(fUser, m, mt);
- if (mt > messageType) { message = m; messageType = mt; }
+ if (mt > messageType) {
+ message = m;
+ messageType = mt;
+ }
valid = false;
} else {
@@ -97,7 +106,10 @@ public class SshSettingsPage extends AbstractSettingsPage {
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; }
+ if (mt > messageType) {
+ message = m;
+ messageType = mt;
+ }
valid = false;
} else {
@@ -108,7 +120,10 @@ public class SshSettingsPage extends AbstractSettingsPage {
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; }
+ if (mt > messageType) {
+ message = m;
+ messageType = mt;
+ }
valid = false;
} else {
@@ -119,7 +134,10 @@ public class SshSettingsPage extends AbstractSettingsPage {
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; }
+ if (mt > messageType) {
+ message = m;
+ messageType = mt;
+ }
valid = false;
} else {
@@ -132,8 +150,9 @@ public class SshSettingsPage extends AbstractSettingsPage {
setMessage(message, messageType);
return valid;
}
+
@Override
- public void createControl(Composite parent) {
+ 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);
@@ -144,13 +163,14 @@ public class SshSettingsPage extends AbstractSettingsPage {
fHostText = createTextField(composite, SshMessages.HOST);
fUser = createTextField(composite, SshMessages.USER);
- fPassword = createTextField(composite, SshMessages.PASSWORD,SWT.PASSWORD);
+ 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
@@ -159,17 +179,18 @@ public class SshSettingsPage extends AbstractSettingsPage {
// Add control
gridData = new GridData(GridData.FILL_HORIZONTAL);
- final Text text= new Text(composite, SWT.BORDER | textOptions);
+ final Text text = new Text(composite, SWT.BORDER | textOptions);
text.setLayoutData(gridData);
text.addModifyListener(new ModifyListener() {
@Override
- public void modifyText(ModifyEvent e) {
+ 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
index ba862db7d15..8047ac91579 100644
--- 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
@@ -62,26 +62,28 @@ public class UserValidationDialog extends TrayDialog {
*/
public UserValidationDialog(Shell parentShell, String location, String defaultName, String message) {
super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
this.defaultUsername = defaultName;
this.domain = location;
this.message = message;
}
+
/**
* @see Window#configureShell
*/
@Override
- protected void configureShell(Shell newShell) {
+ 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);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, ISshConstants.HELP_USER_VALIDATION_DIALOG);
}
+
/**
* @see Window#create
*/
@Override
- public void create() {
+ public void create() {
super.create();
// add some default values
usernameField.setText(defaultUsername);
@@ -100,7 +102,7 @@ public class UserValidationDialog extends TrayDialog {
* @see Dialog#createDialogArea
*/
@Override
- protected Control createDialogArea(Composite parent) {
+ protected Control createDialogArea(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -142,7 +144,8 @@ public class UserValidationDialog extends TrayDialog {
if (isUsernameMutable) {
label.setText(NLS.bind(SshMessages.UserValidationDialog_labelUser, new String[] { domain }));
} else {
- label.setText(NLS.bind(SshMessages.UserValidationDialog_labelPassword, (new Object[]{defaultUsername, domain})));
+ label.setText(NLS.bind(SshMessages.UserValidationDialog_labelPassword,
+ (new Object[] { defaultUsername, domain })));
}
data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
data.horizontalSpan = 2;
@@ -152,7 +155,7 @@ public class UserValidationDialog extends TrayDialog {
createUsernameFields(main);
createPasswordFields(main);
- if(domain != null) {
+ if (domain != null) {
allowCachingButton = new Button(main, SWT.CHECK);
allowCachingButton.setText(SshMessages.UserValidationDialog_6);
data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
@@ -160,7 +163,7 @@ public class UserValidationDialog extends TrayDialog {
allowCachingButton.setLayoutData(data);
allowCachingButton.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(SelectionEvent e) {
allowCaching = allowCachingButton.getSelection();
}
});
@@ -175,7 +178,8 @@ public class UserValidationDialog extends TrayDialog {
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));
+ 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);
@@ -183,7 +187,7 @@ public class UserValidationDialog extends TrayDialog {
warningText.setLayoutData(data);
}
- Dialog.applyDialogFont(parent);
+ Dialog.applyDialogFont(parent);
return main;
}
@@ -202,6 +206,7 @@ public class UserValidationDialog extends TrayDialog {
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
passwordField.setLayoutData(data);
}
+
/**
* Creates the three widgets that represent the user name entry area.
*
@@ -255,12 +260,13 @@ public class UserValidationDialog extends TrayDialog {
*
*/
@Override
- protected void okPressed() {
+ 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
@@ -276,8 +282,8 @@ public class UserValidationDialog extends TrayDialog {
* @see org.eclipse.jface.dialogs.Dialog#close()
*/
@Override
- public boolean close() {
- if(keyLockImage != null) {
+ 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
index 779b4c718d0..acda0b3d9f4 100644
--- 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
@@ -50,7 +50,7 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
private static final String SAVE_USER = "saveUser"; //$NON-NLS-1$
private static final String SAVE_PASSWORD = "savePassword"; //$NON-NLS-1$
- private SshSettings sshSettings;
+ private SshSettings sshSettings;
private ISettingsPage sshSettingsPage;
private Button userButton;
private Button passwordButton;
@@ -61,8 +61,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
* @param container The configuration panel container or null.
*/
public SshWizardConfigurationPanel(IConfigurationPanelContainer container) {
- super(container);
- }
+ super(container);
+ }
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.interfaces.IConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite)
@@ -75,7 +75,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
panel.setLayoutData(data);
// Create the host selection combo
- if (isWithoutSelection()) createHostsUI(panel, true);
+ if (isWithoutSelection())
+ createHostsUI(panel, true);
SshConnector conn = new SshConnector();
sshSettings = (SshSettings) conn.getSshSettings();
@@ -84,7 +85,7 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
sshSettingsPage = new SshSettingsPage(sshSettings);
if (sshSettingsPage instanceof AbstractSettingsPage) {
- ((AbstractSettingsPage)sshSettingsPage).setHasControlDecoration(true);
+ ((AbstractSettingsPage) sshSettingsPage).setHasControlDecoration(true);
}
sshSettingsPage.createControl(panel);
@@ -92,7 +93,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
sshSettingsPage.addListener(new ISettingsPage.Listener() {
@Override
public void onSettingsPageChanged(Control control) {
- if (getContainer() != null) getContainer().validate();
+ if (getContainer() != null)
+ getContainer().validate();
}
});
@@ -110,34 +112,42 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
*/
@Override
public void setupData(Map data) {
- if (data == null || sshSettings == null || sshSettingsPage == null) return;
+ if (data == null || sshSettings == null || sshSettingsPage == null)
+ return;
- String value = (String)data.get(ITerminalsConnectorConstants.PROP_IP_HOST);
- if (value != null) sshSettings.setHost(value);
+ 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);
+ if (value != null)
+ sshSettings.setPort(value);
v = data.get(ITerminalsConnectorConstants.PROP_TIMEOUT);
value = v != null ? v.toString() : null;
- if (value != null) sshSettings.setTimeout(value);
+ 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);
+ 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_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_SSH_USER);
+ if (value != null)
+ sshSettings.setUser(value);
- value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
- if (value != null) setEncoding(value);
+ value = (String) data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null)
+ setEncoding(value);
sshSettingsPage.loadSettings();
- }
+ }
/**
* Returns the default user name.
@@ -151,7 +161,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
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();
+ if (user instanceof String)
+ return ((String) user).trim();
}
}
@@ -163,20 +174,22 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
*/
@Override
public void extractData(Map data) {
- if (data == null) return;
+ 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$
+ // 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());
+ 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)
@@ -185,8 +198,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
protected void fillSettingsForHost(String host) {
boolean saveUser = true;
boolean savePassword = false;
- if (host != null && host.length() != 0){
- if (hostSettingsMap.containsKey(host)){
+ 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));
@@ -206,7 +219,7 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
if (hostSettings.get(SAVE_PASSWORD) != null) {
savePassword = new Boolean(hostSettings.get(SAVE_PASSWORD)).booleanValue();
}
- if (!savePassword){
+ if (!savePassword) {
sshSettings.setPassword(""); //$NON-NLS-1$
} else {
String password = accessSecurePassword(sshSettings.getHost());
@@ -218,7 +231,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
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$
+ encoding = defaultEncoding != null && !"".equals(defaultEncoding.trim()) ? defaultEncoding.trim() //$NON-NLS-1$
+ : "ISO-8859-1"; //$NON-NLS-1$
}
setEncoding(encoding);
} else {
@@ -238,10 +252,10 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
* @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);
- }
+ 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)
@@ -252,20 +266,20 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
boolean savePassword = passwordButton.getSelection();
String host = getHostFromSettings();
if (host != null && host.length() != 0) {
- if (hostSettingsMap.containsKey(host)){
+ 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()));
+ 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 {
+ } else {
hostSettings.remove(ITerminalsConnectorConstants.PROP_SSH_USER);
}
@@ -280,18 +294,20 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
hostSettings.put(SAVE_USER, Boolean.toString(saveUser));
hostSettings.put(SAVE_PASSWORD, Boolean.toString(savePassword));
- if (savePassword && sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
+ 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);
+ 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()));
+ 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());
@@ -302,7 +318,7 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
hostSettings.put(SAVE_PASSWORD, Boolean.toString(savePassword));
hostSettingsMap.put(host, hostSettings);
- if (savePassword && sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
+ if (savePassword && sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0) {
saveSecurePassword(host, sshSettings.getPassword());
}
}
@@ -328,8 +344,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
if (node != null) {
try {
node.put("password", password, true); //$NON-NLS-1$
- }
- catch (StorageException ex) { /* ignored on purpose */ }
+ } catch (StorageException ex) {
+ /* ignored on purpose */ }
}
}
}
@@ -353,8 +369,8 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
String password = null;
try {
password = node.get("password", null); //$NON-NLS-1$
- }
- catch (StorageException ex) { /* ignored on purpose */ }
+ } catch (StorageException ex) {
+ /* ignored on purpose */ }
return password;
}
@@ -385,7 +401,7 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#isValid()
*/
@Override
- public boolean isValid(){
+ public boolean isValid() {
return isEncodingValid() && sshSettingsPage.validateSettings();
}
@@ -393,10 +409,10 @@ public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPa
* @see org.eclipse.tm.terminal.view.ui.panels.AbstractConfigurationPanel#getHostFromSettings()
*/
@Override
- protected String getHostFromSettings() {
+ protected String getHostFromSettings() {
sshSettingsPage.saveSettings();
- return sshSettings.getHost();
- }
+ return sshSettings.getHost();
+ }
private void createSaveButtonsUI(final Composite parent, boolean separator) {
Assert.isNotNull(parent);
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
index 9de83a43739..6b43937b9c0 100644
--- 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
@@ -92,24 +92,26 @@ public class SshLauncherDelegate extends AbstractLauncherDelegate {
*
* @return The terminal title string or null.
*/
- private String getTerminalTitle(Map properties) {
+ 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;
+ 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);
+ 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) {
+ 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_port,
+ new String[] { user, host, port, date });
}
- return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, new String[]{user, host, date});
+ return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, new String[] { user, host, date });
}
return Messages.SshLauncherDelegate_terminalTitle_default;
@@ -118,40 +120,42 @@ public class SshLauncherDelegate extends AbstractLauncherDelegate {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
- @Override
+ @Override
public Object getAdapter(Class adapter) {
if (IMementoHandler.class.equals(adapter)) {
return mementoHandler;
}
- return super.getAdapter(adapter);
+ return super.getAdapter(adapter);
}
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
*/
- @Override
+ @Override
public ITerminalConnector createTerminalConnector(Map properties) {
- Assert.isNotNull(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$
+ // 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);
+ 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);
+ 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;
+ portOffset = ((Integer) properties.get(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET)).intValue();
+ if (portOffset < 0)
+ portOffset = 0;
}
// The real port to connect to is port + portOffset
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
index 76cf961d282..b7b5f4b65f1 100644
--- 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
@@ -26,7 +26,6 @@ import org.eclipse.ui.IMemento;
*/
public class SshMementoHandler implements IMementoHandler {
-
/* (non-Javadoc)
* @see org.eclipse.tm.terminal.view.ui.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
*/
@@ -37,15 +36,21 @@ public class SshMementoHandler implements IMementoHandler {
// 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));
+ 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);
+ 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.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));
+ 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
//
@@ -55,22 +60,22 @@ public class SshMementoHandler implements IMementoHandler {
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();
+ // 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);
+ 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();
- }
+ 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();
+ }
}
*/
}
@@ -84,50 +89,57 @@ public class SshMementoHandler implements IMementoHandler {
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));
+ 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) {
+ 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$
+ String nodeKey = "/Target Explorer SSH Password/" //$NON-NLS-1$
+ + (String) properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
ISecurePreferences node = preferences.node(nodeKey);
if (node != null) {
try {
password = node.get("password", null); //$NON-NLS-1$
- }
- catch (StorageException ex) { /* ignored on purpose */ }
+ } 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$
+ 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);
+ 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);
+ 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();
- }
- }
- */
+ 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.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
index 0f7a167df9c..a3fc1a3afaa 100644
--- 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
@@ -69,7 +69,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@@ -78,7 +78,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
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
index 901f06ac34b..b59413ca745 100644
--- 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
@@ -30,13 +30,19 @@ public interface ITelnetSettings {
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
index 87687c231de..f72c5f73fe4 100644
--- 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
@@ -22,17 +22,15 @@ 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$
+ 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[][] {
+ String[][] fPortMap = new String[][] {
// portName, port
- {PROP_NAMETGTCONS, PROP_VALUETGTCONS},
- {PROP_NAMETELNET, PROP_VALUETELNET}
- };
+ { PROP_NAMETGTCONS, PROP_VALUETGTCONS }, { PROP_NAMETELNET, PROP_VALUETELNET } };
public String getDefaultNetworkPort() {
return PROP_VALUETELNET;
@@ -40,7 +38,7 @@ public class NetworkPortMap {
public String findPortName(String strPort) {
for (int i = 0; i < fPortMap.length; i++) {
- if(fPortMap[i][1].equals(strPort))
+ if (fPortMap[i][1].equals(strPort))
return fPortMap[i][0];
}
return null;
@@ -48,14 +46,14 @@ public class NetworkPortMap {
public String findPort(String strPortName) {
for (int i = 0; i < fPortMap.length; i++) {
- if(fPortMap[i][0].equals(strPortName))
+ if (fPortMap[i][0].equals(strPortName))
return fPortMap[i][1];
}
return null;
}
public List getNameTable() {
- List names=new ArrayList();
+ List names = new ArrayList();
for (int i = 0; i < fPortMap.length; i++) {
names.add(fPortMap[i][0]);
}
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
index 1d60c75a080..21edea869da 100644
--- 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
@@ -8,10 +8,10 @@
* 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
+ * 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;
@@ -22,75 +22,73 @@ package org.eclipse.tm.terminal.connector.telnet.connector;
* 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;
+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: No-op. */
+ static final byte TELNET_NOP = (byte) 241;
- /** Command code: Data Mark. */
- static final byte TELNET_DM = (byte)242;
+ /** Command code: Data Mark. */
+ static final byte TELNET_DM = (byte) 242;
- /** Command code: Break. */
- static final byte TELNET_BREAK = (byte)243;
+ /** Command code: Break. */
+ static final byte TELNET_BREAK = (byte) 243;
- /** Command code: Interrupt Process. */
- static final byte TELNET_IP = (byte)244;
+ /** Command code: Interrupt Process. */
+ static final byte TELNET_IP = (byte) 244;
- /** Command code: Abort Output. */
- static final byte TELNET_AO = (byte)245;
+ /** 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: Are You There. */
+ static final byte TELNET_AYT = (byte) 246;
- /** Command code: Erase Character. */
- static final byte TELNET_EC = (byte)247;
+ /** Command code: Erase Character. */
+ static final byte TELNET_EC = (byte) 247;
- /** Command code: Erase Line. */
- static final byte TELNET_EL = (byte)248;
+ /** Command code: Erase Line. */
+ static final byte TELNET_EL = (byte) 248;
- /** Command code: Go Ahead. */
- static final byte TELNET_GA = (byte)249;
+ /** Command code: Go Ahead. */
+ static final byte TELNET_GA = (byte) 249;
- /** Command code: Subnegotiation Begin. */
- static final byte TELNET_SB = (byte)250;
+ /** Command code: Subnegotiation Begin. */
+ static final byte TELNET_SB = (byte) 250;
- /** Command code: Will. */
- static final byte TELNET_WILL = (byte)251;
+ /** Command code: Will. */
+ static final byte TELNET_WILL = (byte) 251;
- /** Command code: Won't. */
- static final byte TELNET_WONT = (byte)252;
+ /** Command code: Won't. */
+ static final byte TELNET_WONT = (byte) 252;
- /** Command code: Do. */
- static final byte TELNET_DO = (byte)253;
+ /** Command code: Do. */
+ static final byte TELNET_DO = (byte) 253;
- /** Command code: Don't. */
- static final byte TELNET_DONT = (byte)254;
+ /** 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: Interpret As Command. */
+ static final byte TELNET_IAC = (byte) 255;
- /** Command code: IS. */
- static final byte TELNET_IS = 0;
+ /** Command code: IS. */
+ static final byte TELNET_IS = 0;
- /** Command code: SEND. */
- static final byte TELNET_SEND = 1;
+ /** Command code: SEND. */
+ static final byte TELNET_SEND = 1;
+ /** Option code: Transmit Binary option. */
+ static final byte TELNET_OPTION_TRANSMIT_BINARY = 0;
- /** 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: 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: 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: Terminal Type */
- static final byte TELNET_OPTION_TERMINAL_TYPE = 24;
-
- /** Option code: Negotitate About Window Size (NAWS) */
- static final byte TELNET_OPTION_NAWS = 31;
+ /** 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
index 330e31c1de1..d2ab614884a 100644
--- 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
@@ -32,13 +32,15 @@ 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) {
+
+ protected TelnetConnectWorker(TelnetConnector conn, ITerminalControl control) {
fControl = control;
fConn = conn;
fControl.setState(TerminalState.CONNECTING);
}
+
@Override
- public void run() {
+ 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.
@@ -48,14 +50,18 @@ class TelnetConnectWorker extends Thread {
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 */ }
+ 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 socket = new Socket();
socket.connect(address, nTimeout);
@@ -74,7 +80,7 @@ class TelnetConnectWorker extends Thread {
fConn.setSocket(socket);
- TelnetConnection connection=new TelnetConnection(fConn, socket);
+ TelnetConnection connection = new TelnetConnection(fConn, socket);
socket.setKeepAlive(true);
fConn.setTelnetConnection(connection);
connection.start();
@@ -85,21 +91,22 @@ class TelnetConnectWorker extends Thread {
// 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$
+ 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$
+ 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$
+ connectFailed(connectException.getMessage(), "Connection refused!"); //$NON-NLS-1$
}
} catch (Exception exception) {
// Any other exception on connect. No re-try in this case either
@@ -107,7 +114,7 @@ class TelnetConnectWorker extends Thread {
// Log the exception
Logger.logException(exception);
// And signal failed
- connectFailed(exception.getMessage(),""); //$NON-NLS-1$
+ connectFailed(exception.getMessage(), ""); //$NON-NLS-1$
} finally {
remaining--;
}
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
index 67c1e1a2b2c..63a1afd9a8b 100644
--- 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
@@ -297,7 +297,7 @@ public class TelnetConnection extends Thread implements TelnetCodes {
* display.
*/
@Override
- public void run() {
+ public void run() {
Logger.log("Entered"); //$NON-NLS-1$
try {
@@ -335,7 +335,8 @@ public class TelnetConnection extends Thread implements TelnetCodes {
// 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$
+ if (message != null && !message.equalsIgnoreCase("Socket closed") //$NON-NLS-1$
+ && !message.equalsIgnoreCase("Connection reset")) //$NON-NLS-1$
{
Logger.logException(ex);
}
@@ -345,8 +346,14 @@ public class TelnetConnection extends Thread implements TelnetCodes {
} 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*/ }
+ try {
+ inputStream.close();
+ } catch (IOException ioe) {
+ /*ignore*/ }
+ try {
+ outputStream.close();
+ } catch (IOException ioe) {
+ /*ignore*/ }
}
}
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
index 5ac0865364b..13c994db808 100644
--- 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
@@ -73,21 +73,24 @@ public class TelnetConnector extends TerminalConnectorImpl {
public TelnetConnector() {
this(new TelnetSettings());
}
+
public TelnetConnector(TelnetSettings settings) {
- fSettings=settings;
+ fSettings = settings;
}
+
@Override
- public void connect(ITerminalControl control) {
+ public void connect(ITerminalControl control) {
super.connect(control);
- fWidth=-1;
- fHeight=-1;
+ fWidth = -1;
+ fHeight = -1;
// TERM=xterm implies VT100 line wrapping mode
control.setVT100LineWrapping(true);
- TelnetConnectWorker worker = new TelnetConnectWorker(this,control);
+ TelnetConnectWorker worker = new TelnetConnectWorker(this, control);
worker.start();
}
+
@Override
- public void doDisconnect() {
+ public void doDisconnect() {
if (getSocket() != null) {
try {
getSocket().close();
@@ -113,31 +116,37 @@ public class TelnetConnector extends TerminalConnectorImpl {
}
cleanSocket();
}
+
@Override
- public boolean isLocalEcho() {
- if(fTelnetConnection==null)
+ 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)) {
+ 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;
+ fWidth = newWidth;
+ fHeight = newHeight;
}
}
+
public InputStream getInputStream() {
return fInputStream;
}
+
@Override
- public OutputStream getTerminalToRemoteStream() {
+ public OutputStream getTerminalToRemoteStream() {
return fOutputStream;
}
+
private void setInputStream(InputStream inputStream) {
fInputStream = inputStream;
}
+
private void setOutputStream(OutputStream outputStream) {
if (outputStream == null) {
fOutputStream = null;
@@ -146,6 +155,7 @@ public class TelnetConnector extends TerminalConnectorImpl {
// translate CR to telnet end-of-line sequence - RFC 854
fOutputStream = new TelnetOutputStream(outputStream, fSettings.getEndOfLine());
}
+
Socket getSocket() {
return fSocket;
}
@@ -154,13 +164,13 @@ public class TelnetConnector extends TerminalConnectorImpl {
* sets the socket to null
*/
void cleanSocket() {
- fSocket=null;
+ fSocket = null;
setInputStream(null);
setOutputStream(null);
}
void setSocket(Socket socket) throws IOException {
- if(socket==null) {
+ if (socket == null) {
cleanSocket();
} else {
fSocket = socket;
@@ -169,35 +179,44 @@ public class TelnetConnector extends TerminalConnectorImpl {
}
}
+
public void setTelnetConnection(TelnetConnection connection) {
- fTelnetConnection=connection;
+ fTelnetConnection = connection;
}
+
public void displayTextInTerminal(String text) {
fControl.displayTextInTerminal(text);
}
- public OutputStream getRemoteToTerminalOutputStream () {
+
+ 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());
+ fSettings.load(new NullSettingsStore());
}
+
@Override
- public String getSettingsSummary() {
+ public String getSettingsSummary() {
return fSettings.getSummary();
}
+
@Override
- public void load(ISettingsStore store) {
+ public void load(ISettingsStore store) {
fSettings.load(store);
}
+
@Override
- public void save(ISettingsStore store) {
+ 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
index ed3ed05dfa4..b05c6f03e4e 100644
--- 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
@@ -28,4 +28,4 @@ public class TelnetMessages extends NLS {
*/
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
index 77acc43ec40..561ee4237dc 100644
--- 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
@@ -13,7 +13,7 @@
# Helmut Haigermoser and Ted Williams.
#
# Contributors:
-# Michael Scharf (Wind River) - split into core, view and connector plugins
+# Michael Scharf (Wind River) - split into core, view and connector plugins
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
###############################################################################
PORT = Port
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
index e97c9a1baa6..3889188dc38 100644
--- 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
@@ -43,207 +43,204 @@ import org.eclipse.tm.internal.terminal.provisional.api.Logger;
*
* @author Fran Litterio (francis.litterio@windriver.com)
*/
-class TelnetOption implements TelnetCodes
-{
- /**
- * This array of Strings maps an integer TELNET option code value to the symbolic
- * name of the option. Array elements of the form "?" represent unassigned option
- * values.
- */
- protected static final String[] optionNames =
- {
- "BINARY", // 0 //$NON-NLS-1$
- "ECHO", // 1 //$NON-NLS-1$
- "RECONNECTION", // 2 //$NON-NLS-1$
- "SUPPRESS GO AHEAD", // 3 //$NON-NLS-1$
- "MSG SIZE NEGOTIATION", // 4 //$NON-NLS-1$
- "STATUS", // 5 //$NON-NLS-1$
- "TIMING MARK", // 6 //$NON-NLS-1$
- "REMOTE CTRL TRANS+ECHO", // 7 //$NON-NLS-1$
- "OUTPUT LINE WIDTH", // 8 //$NON-NLS-1$
- "OUTPUT PAGE SIZE", // 9 //$NON-NLS-1$
- "OUTPUT CR DISPOSITION", // 10 //$NON-NLS-1$
- "OUTPUT HORIZ TABSTOPS", // 11 //$NON-NLS-1$
- "OUTPUT HORIZ TAB DISPOSITION", // 12 //$NON-NLS-1$
- "OUTPUT FORMFEED DISPOSITION", // 13 //$NON-NLS-1$
- "OUTPUT VERTICAL TABSTOPS", // 14 //$NON-NLS-1$
- "OUTPUT VT DISPOSITION", // 15 //$NON-NLS-1$
- "OUTPUT LF DISPOSITION", // 16 //$NON-NLS-1$
- "EXTENDED ASCII", // 17 //$NON-NLS-1$
- "LOGOUT", // 18 //$NON-NLS-1$
- "BYTE MACRO", // 19 //$NON-NLS-1$
- "DATA ENTRY TERMINAL", // 20 //$NON-NLS-1$
- "SUPDUP", // 21 //$NON-NLS-1$
- "SUPDUP OUTPUT", // 22 //$NON-NLS-1$
- "SEND LOCATION", // 23 //$NON-NLS-1$
- "TERMINAL TYPE", // 24 //$NON-NLS-1$
- "END OF RECORD", // 25 //$NON-NLS-1$
- "TACACS USER IDENTIFICATION", // 26 //$NON-NLS-1$
- "OUTPUT MARKING", // 27 //$NON-NLS-1$
- "TERMINAL LOCATION NUMBER", // 28 //$NON-NLS-1$
- "3270 REGIME", // 29 //$NON-NLS-1$
- "X.3 PAD", // 30 //$NON-NLS-1$
- "NEGOTIATE ABOUT WINDOW SIZE", // 31 //$NON-NLS-1$
- "TERMINAL SPEED", // 32 //$NON-NLS-1$
- "REMOTE FLOW CONTROL", // 33 //$NON-NLS-1$
- "LINEMODE", // 34 //$NON-NLS-1$
- "X DISPLAY LOCATION", // 35 //$NON-NLS-1$
- "ENVIRONMENT OPTION", // 36 //$NON-NLS-1$
- "AUTHENTICATION OPTION", // 37 //$NON-NLS-1$
- "ENCRYPTION OPTION", // 38 //$NON-NLS-1$
- "NEW ENVIRONMENT OPTION", // 39 //$NON-NLS-1$
- "TN3270E", // 40 //$NON-NLS-1$
- "XAUTH", // 41 //$NON-NLS-1$
- "CHARSET", // 42 //$NON-NLS-1$
- "REMOTE SERIAL PORT", // 43 //$NON-NLS-1$
- "COM PORT CONTROL OPTION", // 44 //$NON-NLS-1$
- "SUPPRESS LOCAL ECHO", // 45 //$NON-NLS-1$
- "START TLS", // 46 //$NON-NLS-1$
- "KERMIT", // 47 //$NON-NLS-1$
- "SEND URL", // 48 //$NON-NLS-1$
- "FORWARD X", // 49 //$NON-NLS-1$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 50 ... //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", // ... 137 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- "TELOPT PRAGMA LOGON", // 138 //$NON-NLS-1$
- "TELOPT SSPI LOGON", // 139 //$NON-NLS-1$
- "TELOPT PRAGMA HEARTBEAT", // 140 //$NON-NLS-1$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 141 ... //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "?", "?", "?", "?", // ... 254 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "EXTENDED OPTIONS LIST" // 255 //$NON-NLS-1$
- };
+class TelnetOption implements TelnetCodes {
+ /**
+ * This array of Strings maps an integer TELNET option code value to the symbolic
+ * name of the option. Array elements of the form "?" represent unassigned option
+ * values.
+ */
+ protected static final String[] optionNames = { "BINARY", // 0 //$NON-NLS-1$
+ "ECHO", // 1 //$NON-NLS-1$
+ "RECONNECTION", // 2 //$NON-NLS-1$
+ "SUPPRESS GO AHEAD", // 3 //$NON-NLS-1$
+ "MSG SIZE NEGOTIATION", // 4 //$NON-NLS-1$
+ "STATUS", // 5 //$NON-NLS-1$
+ "TIMING MARK", // 6 //$NON-NLS-1$
+ "REMOTE CTRL TRANS+ECHO", // 7 //$NON-NLS-1$
+ "OUTPUT LINE WIDTH", // 8 //$NON-NLS-1$
+ "OUTPUT PAGE SIZE", // 9 //$NON-NLS-1$
+ "OUTPUT CR DISPOSITION", // 10 //$NON-NLS-1$
+ "OUTPUT HORIZ TABSTOPS", // 11 //$NON-NLS-1$
+ "OUTPUT HORIZ TAB DISPOSITION", // 12 //$NON-NLS-1$
+ "OUTPUT FORMFEED DISPOSITION", // 13 //$NON-NLS-1$
+ "OUTPUT VERTICAL TABSTOPS", // 14 //$NON-NLS-1$
+ "OUTPUT VT DISPOSITION", // 15 //$NON-NLS-1$
+ "OUTPUT LF DISPOSITION", // 16 //$NON-NLS-1$
+ "EXTENDED ASCII", // 17 //$NON-NLS-1$
+ "LOGOUT", // 18 //$NON-NLS-1$
+ "BYTE MACRO", // 19 //$NON-NLS-1$
+ "DATA ENTRY TERMINAL", // 20 //$NON-NLS-1$
+ "SUPDUP", // 21 //$NON-NLS-1$
+ "SUPDUP OUTPUT", // 22 //$NON-NLS-1$
+ "SEND LOCATION", // 23 //$NON-NLS-1$
+ "TERMINAL TYPE", // 24 //$NON-NLS-1$
+ "END OF RECORD", // 25 //$NON-NLS-1$
+ "TACACS USER IDENTIFICATION", // 26 //$NON-NLS-1$
+ "OUTPUT MARKING", // 27 //$NON-NLS-1$
+ "TERMINAL LOCATION NUMBER", // 28 //$NON-NLS-1$
+ "3270 REGIME", // 29 //$NON-NLS-1$
+ "X.3 PAD", // 30 //$NON-NLS-1$
+ "NEGOTIATE ABOUT WINDOW SIZE", // 31 //$NON-NLS-1$
+ "TERMINAL SPEED", // 32 //$NON-NLS-1$
+ "REMOTE FLOW CONTROL", // 33 //$NON-NLS-1$
+ "LINEMODE", // 34 //$NON-NLS-1$
+ "X DISPLAY LOCATION", // 35 //$NON-NLS-1$
+ "ENVIRONMENT OPTION", // 36 //$NON-NLS-1$
+ "AUTHENTICATION OPTION", // 37 //$NON-NLS-1$
+ "ENCRYPTION OPTION", // 38 //$NON-NLS-1$
+ "NEW ENVIRONMENT OPTION", // 39 //$NON-NLS-1$
+ "TN3270E", // 40 //$NON-NLS-1$
+ "XAUTH", // 41 //$NON-NLS-1$
+ "CHARSET", // 42 //$NON-NLS-1$
+ "REMOTE SERIAL PORT", // 43 //$NON-NLS-1$
+ "COM PORT CONTROL OPTION", // 44 //$NON-NLS-1$
+ "SUPPRESS LOCAL ECHO", // 45 //$NON-NLS-1$
+ "START TLS", // 46 //$NON-NLS-1$
+ "KERMIT", // 47 //$NON-NLS-1$
+ "SEND URL", // 48 //$NON-NLS-1$
+ "FORWARD X", // 49 //$NON-NLS-1$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 50 ... //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", // ... 137 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "TELOPT PRAGMA LOGON", // 138 //$NON-NLS-1$
+ "TELOPT SSPI LOGON", // 139 //$NON-NLS-1$
+ "TELOPT PRAGMA HEARTBEAT", // 140 //$NON-NLS-1$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 141 ... //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "?", "?", "?", "?", // ... 254 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "EXTENDED OPTIONS LIST" // 255 //$NON-NLS-1$
+ };
- /**
- * Negotiation state: Negotiation not yet started for this option.
- *
- * 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 not yet started for this option.
+ *
+ * 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 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;
+ /** 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;
+ /**
+ * 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 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);
+ /**
+ * 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 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 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;
+ /**
+ * 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;
+ /**
+ * 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 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.
- *
- * @see #setDesired(boolean)
- */
- protected boolean desired = 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.