From bbb05511efe8d28c910736374a16b017a0a78766 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Thu, 16 Apr 2015 11:01:01 +0200 Subject: [PATCH] Terminal: Terminal widget moved to o.e.tm.terminal.git - Updated target platform definitions to remove no longer necessary dependencies - Removed Terminal modules from build and repository - Removed Terminal subdirectory --- admin/findbugs-exclude.xml | 5 - admin/pom-config.xml | 28 +- admin/target-defs/eclipse-3.8.2-juno.target | 14 - admin/target-defs/eclipse-4.3.x-kepler.target | 11 - admin/target-defs/eclipse-4.4.x-luna.target | 10 - pom.xml | 19 - releng/org.eclipse.tm.repo/category.xml | 41 +- .../org.eclipse.tm.terminal.feature/.project | 17 - .../build.properties | 13 - .../feature.properties | 169 -- .../feature.xml | 52 - .../org.eclipse.tm.terminal.feature/pom.xml | 30 - .../.project | 17 - .../build.properties | 9 - .../feature.properties | 165 -- .../feature.xml | 57 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 12 - .../feature.properties | 165 -- .../feature.xml | 52 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 169 -- .../feature.xml | 50 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 53 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 53 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 55 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 53 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 53 - .../pom.xml | 30 - .../.project | 17 - .../build.properties | 13 - .../feature.properties | 168 -- .../feature.xml | 53 - .../pom.xml | 30 - .../org.eclipse.tm.terminal.remote/.classpath | 7 - .../org.eclipse.tm.terminal.remote/.cvsignore | 1 - .../org.eclipse.tm.terminal.remote/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 61 - .../.settings/org.eclipse.jdt.ui.prefs | 3 - .../META-INF/MANIFEST.MF | 23 - .../org.eclipse.tm.terminal.remote/about.html | 28 - .../build.properties | 15 - .../plugin.properties | 11 - .../org.eclipse.tm.terminal.remote/plugin.xml | 33 - .../org.eclipse.tm.terminal.remote/pom.xml | 16 - .../schema/parsers.exsd | 109 -- .../internal/terminal/remote/Activator.java | 125 -- .../terminal/remote/ArgumentParser.java | 361 ----- .../remote/RemoteConnectionManager.java | 180 --- .../terminal/remote/RemoteConnector.java | 177 --- .../terminal/remote/RemoteSettings.java | 61 - .../terminal/remote/RemoteSettingsPage.java | 66 - .../terminal/remote/messages/Messages.java | 29 - .../remote/messages/messages.properties | 13 - .../RemoteTerminalPreferenceInitializer.java | 26 - .../RemoteTerminalPreferencePage.java | 37 - .../tm/terminal/remote/IRemoteSettings.java | 27 - .../remote/IRemoteTerminalConstants.java | 12 - .../remote/IRemoteTerminalParser.java | 37 - .../org.eclipse.tm.terminal.serial/.classpath | 7 - .../org.eclipse.tm.terminal.serial/.cvsignore | 1 - .../org.eclipse.tm.terminal.serial/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 61 - .../META-INF/MANIFEST.MF | 18 - .../org.eclipse.tm.terminal.serial/README.txt | 64 - .../org.eclipse.tm.terminal.serial/about.html | 28 - .../org.eclipse.tm.terminal.serial/about.ini | 27 - .../about.properties | 24 - .../build.properties | 29 - .../plugin.properties | 19 - .../org.eclipse.tm.terminal.serial/plugin.xml | 21 - .../org.eclipse.tm.terminal.serial/pom.xml | 15 - .../internal/terminal/serial/Activator.java | 65 - .../terminal/serial/ISerialSettings.java | 28 - .../terminal/serial/SerialConnectWorker.java | 212 --- .../terminal/serial/SerialConnector.java | 230 --- .../terminal/serial/SerialMessages.java | 44 - .../terminal/serial/SerialMessages.properties | 49 - .../terminal/serial/SerialPortHandler.java | 113 -- .../terminal/serial/SerialProperties.java | 163 -- .../terminal/serial/SerialSettings.java | 193 --- .../terminal/serial/SerialSettingsPage.java | 183 --- .../org.eclipse.tm.terminal.serial/tm32.png | Bin 2275 -> 0 bytes .../org.eclipse.tm.terminal.ssh/.classpath | 7 - .../org.eclipse.tm.terminal.ssh/.cvsignore | 1 - .../org.eclipse.tm.terminal.ssh/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 61 - .../.settings/org.eclipse.jdt.ui.prefs | 3 - .../META-INF/MANIFEST.MF | 17 - .../org.eclipse.tm.terminal.ssh/about.html | 29 - .../org.eclipse.tm.terminal.ssh/about.ini | 27 - .../about.properties | 24 - .../build.properties | 22 - .../plugin.properties | 13 - .../org.eclipse.tm.terminal.ssh/plugin.xml | 22 - .../org.eclipse.tm.terminal.ssh/pom.xml | 15 - .../tm/internal/terminal/ssh/Activator.java | 94 -- .../internal/terminal/ssh/ISshConstants.java | 26 - .../internal/terminal/ssh/ISshSettings.java | 78 - .../ssh/KeyboardInteractiveDialog.java | 185 --- .../internal/terminal/ssh/SshConnection.java | 367 ----- .../internal/terminal/ssh/SshConnector.java | 121 -- .../tm/internal/terminal/ssh/SshMessages.java | 97 -- .../terminal/ssh/SshMessages.properties | 53 - .../tm/internal/terminal/ssh/SshSettings.java | 127 -- .../terminal/ssh/SshSettingsPage.java | 170 -- .../terminal/ssh/UserValidationDialog.java | 277 ---- .../org.eclipse.tm.terminal.ssh/tm32.png | Bin 2275 -> 0 bytes .../org.eclipse.tm.terminal.telnet/.classpath | 7 - .../org.eclipse.tm.terminal.telnet/.cvsignore | 1 - .../org.eclipse.tm.terminal.telnet/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 61 - .../.settings/org.eclipse.jdt.ui.prefs | 3 - .../META-INF/MANIFEST.MF | 12 - .../org.eclipse.tm.terminal.telnet/about.html | 29 - .../org.eclipse.tm.terminal.telnet/about.ini | 27 - .../about.properties | 24 - .../build.properties | 29 - .../plugin.properties | 19 - .../org.eclipse.tm.terminal.telnet/plugin.xml | 21 - .../org.eclipse.tm.terminal.telnet/pom.xml | 15 - .../terminal/telnet/ITelnetSettings.java | 23 - .../terminal/telnet/NetworkPortMap.java | 62 - .../internal/terminal/telnet/TelnetCodes.java | 94 -- .../terminal/telnet/TelnetConnectWorker.java | 121 -- .../terminal/telnet/TelnetConnection.java | 693 -------- .../terminal/telnet/TelnetConnector.java | 160 -- .../terminal/telnet/TelnetMessages.java | 25 - .../terminal/telnet/TelnetMessages.properties | 20 - .../terminal/telnet/TelnetOption.java | 704 --------- .../terminal/telnet/TelnetProperties.java | 42 - .../terminal/telnet/TelnetSettings.java | 83 - .../terminal/telnet/TelnetSettingsPage.java | 214 --- .../org.eclipse.tm.terminal.telnet/tm32.png | Bin 2275 -> 0 bytes .../org.eclipse.tm.terminal.test/.classpath | 7 - .../org.eclipse.tm.terminal.test/.cvsignore | 1 - .../org.eclipse.tm.terminal.test/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 69 - .../META-INF/MANIFEST.MF | 21 - .../org.eclipse.tm.terminal.test/about.html | 29 - .../org.eclipse.tm.terminal.test/about.ini | 27 - .../about.properties | 24 - .../build.properties | 23 - .../plugin.properties | 17 - .../org.eclipse.tm.terminal.test/plugin.xml | 23 - .../org.eclipse.tm.terminal.test/pom.xml | 32 - .../TerminalConnectorFactoryTest.java | 291 ---- .../TerminalConnectorPluginTest.java | 62 - .../connector/TerminalConnectorTest.java | 259 --- ...inalToRemoteInjectionOutputStreamTest.java | 175 --- .../internal/terminal/emulator/AllTests.java | 36 - .../emulator/VT100EmulatorBackendTest.java | 1381 ---------------- .../model/AbstractITerminalTextDataTest.java | 832 ---------- .../tm/internal/terminal/model/AllTests.java | 45 - .../terminal/model/SnapshotChangesTest.java | 679 -------- .../SynchronizedTerminalTextDataTest.java | 20 - .../model/TerminalTextDataFastScrollTest.java | 20 - ...rminalTextDataFastScrollTestMaxHeigth.java | 20 - .../TerminalTextDataPerformanceTest.java | 224 --- .../model/TerminalTextDataSnapshotTest.java | 1344 ---------------- .../TerminalTextDataSnapshotWindowTest.java | 191 --- .../model/TerminalTextDataStoreTest.java | 20 - .../terminal/model/TerminalTextDataTest.java | 20 - .../model/TerminalTextDataWindowTest.java | 494 ------ .../model/TerminalTextTestHelper.java | 108 -- .../speedtest/SpeedTestConnection.java | 116 -- .../speedtest/SpeedTestConnector.java | 104 -- .../terminal/speedtest/SpeedTestSettings.java | 62 - .../speedtest/SpeedTestSettingsPage.java | 68 - .../terminal/test/terminalcanvas/Main.java | 36 - .../test/terminalcanvas/Snippet48.java | 119 -- .../terminalcanvas/TerminalTextCanvas.java | 103 -- .../test/terminalcanvas/VirtualCanvas.java | 333 ---- .../ui/AbstractLineOrientedDataSource.java | 42 - .../internal/terminal/test/ui/DataReader.java | 87 -- .../terminal/test/ui/FastDataSource.java | 35 - .../terminal/test/ui/FileDataSource.java | 72 - .../terminal/test/ui/IDataSource.java | 21 - .../tm/internal/terminal/test/ui/IStatus.java | 15 - .../test/ui/LineCountingDataSource.java | 43 - .../terminal/test/ui/RandomDataSource.java | 49 - .../terminal/test/ui/TerminalTextUITest.java | 253 --- .../terminal/test/ui/VT100DataSource.java | 131 -- .../PipedInputStreamPerformanceTest.java | 32 - .../terminal/textcanvas/PipedStreamTest.java | 113 -- .../eclipse/tm/terminal/model/AllTests.java | 37 - .../tm/terminal/model/StyleColorTest.java | 36 - .../eclipse/tm/terminal/model/StyleTest.java | 116 -- .../terminal/test/AutomatedPluginTests.java | 37 - .../tm/terminal/test/AutomatedTests.java | 44 - .../teamConfig/Terminal All Unit Tests.launch | 16 - .../teamConfig/Terminal AutomatedTests.launch | 16 - .../teamConfig/Terminal Plugin Tests.launch | 41 - .../org.eclipse.tm.terminal.test/test.xml | 114 -- .../org.eclipse.tm.terminal.test/tm32.png | Bin 2275 -> 0 bytes .../org.eclipse.tm.terminal/.classpath | 7 - .../org.eclipse.tm.terminal/.cvsignore | 1 - .../plugins/org.eclipse.tm.terminal/.options | 3 - .../plugins/org.eclipse.tm.terminal/.project | 34 - .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 100 -- .../org.eclipse.tm.terminal/HelpContexts.xml | 18 - .../META-INF/MANIFEST.MF | 35 - .../org.eclipse.tm.terminal/README.txt | 18 - .../org.eclipse.tm.terminal/about.html | 28 - .../plugins/org.eclipse.tm.terminal/about.ini | 27 - .../org.eclipse.tm.terminal/about.properties | 24 - .../org.eclipse.tm.terminal/build.properties | 36 - ...rg.eclipse.tm.terminal.stylesheet.dark.css | 15 - .../icons/clcl16/clear_co.gif | Bin 595 -> 0 bytes .../icons/dlcl16/clear_co.gif | Bin 364 -> 0 bytes .../icons/elcl16/clear_co.gif | Bin 595 -> 0 bytes .../org.eclipse.tm.terminal/plugin.properties | 42 - .../org.eclipse.tm.terminal/plugin.xml | 274 ---- .../plugins/org.eclipse.tm.terminal/pom.xml | 15 - .../schema/terminalConnectors.exsd | 111 -- .../terminal/connector/TerminalConnector.java | 223 --- ...TerminalToRemoteInjectionOutputStream.java | 163 -- .../control/CommandInputFieldWithHistory.java | 322 ---- .../terminal/control/ICommandInputField.java | 35 - .../terminal/control/ITerminalListener.java | 33 - .../control/ITerminalViewControl.java | 121 -- .../control/TerminalViewControlFactory.java | 44 - .../actions/AbstractTerminalAction.java | 101 -- .../control/actions/ActionMessages.java | 34 - .../control/actions/ActionMessages.properties | 25 - .../terminal/control/actions/ImageConsts.java | 31 - .../actions/TerminalActionClearAll.java | 53 - .../control/actions/TerminalActionCopy.java | 67 - .../control/actions/TerminalActionCut.java | 54 - .../control/actions/TerminalActionPaste.java | 67 - .../actions/TerminalActionSelectAll.java | 50 - .../control/impl/ITerminalControlForText.java | 41 - .../control/impl/TerminalInputStream.java | 334 ---- .../control/impl/TerminalMessages.java | 32 - .../control/impl/TerminalMessages.properties | 28 - .../terminal/control/impl/TerminalPlugin.java | 90 -- .../emulator/EditActionAccelerators.java | 68 - .../emulator/IVT100EmulatorBackend.java | 222 --- .../emulator/LoggingOutputStream.java | 48 - .../emulator/VT100BackendTraceDecorator.java | 176 --- .../terminal/emulator/VT100Emulator.java | 1390 ----------------- .../emulator/VT100EmulatorBackend.java | 494 ------ .../emulator/VT100TerminalControl.java | 1353 ---------------- .../terminal/model/ISnapshotChanges.java | 90 -- .../terminal/model/SnapshotChanges.java | 391 ----- .../model/SynchronizedTerminalTextData.java | 107 -- .../terminal/model/TerminalTextData.java | 274 ---- .../model/TerminalTextDataFastScroll.java | 259 --- .../model/TerminalTextDataSnapshot.java | 303 ---- .../terminal/model/TerminalTextDataStore.java | 344 ---- .../model/TerminalTextDataWindow.java | 207 --- .../preferences/ITerminalConstants.java | 26 - .../TerminalPreferenceInitializer.java | 33 - .../preferences/TerminalPreferencePage.java | 68 - .../provisional/api/AbstractSettingsPage.java | 181 --- .../provisional/api/ISettingsPage.java | 80 - .../provisional/api/ISettingsStore.java | 45 - .../provisional/api/ITerminalConnector.java | 154 -- .../provisional/api/ITerminalControl.java | 160 -- .../provisional/api/LayeredSettingsStore.java | 62 - .../terminal/provisional/api/Logger.java | 195 --- .../api/PreferenceSettingStore.java | 59 - .../api/TerminalConnectorExtension.java | 98 -- .../provisional/api/TerminalState.java | 52 - .../api/provider/TerminalConnectorImpl.java | 161 -- .../textcanvas/AbstractTextCanvasModel.java | 348 ----- .../terminal/textcanvas/GridCanvas.java | 232 --- .../terminal/textcanvas/ILinelRenderer.java | 37 - .../terminal/textcanvas/ITextCanvasModel.java | 84 - .../textcanvas/ITextCanvasModelListener.java | 24 - .../terminal/textcanvas/PipedInputStream.java | 312 ---- .../textcanvas/PollingTextCanvasModel.java | 49 - .../terminal/textcanvas/StyleMap.java | 276 ---- .../terminal/textcanvas/TextCanvas.java | 424 ----- .../terminal/textcanvas/TextLineRenderer.java | 168 -- .../terminal/textcanvas/VirtualCanvas.java | 348 ----- .../tm/terminal/model/ITerminalTextData.java | 150 -- .../model/ITerminalTextDataReadOnly.java | 85 - .../model/ITerminalTextDataSnapshot.java | 226 --- .../tm/terminal/model/LineSegment.java | 35 - .../org/eclipse/tm/terminal/model/Style.java | 154 -- .../eclipse/tm/terminal/model/StyleColor.java | 54 - .../model/TerminalTextDataFactory.java | 20 - .../plugins/org.eclipse.tm.terminal/tm32.png | Bin 2275 -> 0 bytes terminal/readme.txt | 4 - 309 files changed, 7 insertions(+), 32117 deletions(-) delete mode 100644 terminal/features/org.eclipse.tm.terminal.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.sdk.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.feature/pom.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/.project delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/build.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.properties delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.xml delete mode 100644 terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/README.txt delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/about.ini delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/about.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Activator.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.serial/tm32.png delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/about.ini delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/about.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/Activator.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshConstants.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/KeyboardInteractiveDialog.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/UserValidationDialog.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.ssh/tm32.png delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/about.ini delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/about.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/NetworkPortMap.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetCodes.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnectWorker.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetProperties.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.telnet/tm32.png delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/about.ini delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/about.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorPluginTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStreamTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/AllTests.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AllTests.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SnapshotChangesTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextDataTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScrollTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScrollTestMaxHeigth.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataPerformanceTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotWindowTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStoreTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextTestHelper.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnection.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Main.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/TerminalTextCanvas.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/VirtualCanvas.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/AbstractLineOrientedDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/DataReader.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FastDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FileDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IStatus.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/LineCountingDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/RandomDataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/TerminalTextUITest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/VT100DataSource.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStreamPerformanceTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedStreamTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/AllTests.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleColorTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleTest.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedPluginTests.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedTests.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal All Unit Tests.launch delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal AutomatedTests.launch delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal Plugin Tests.launch delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/test.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal.test/tm32.png delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.classpath delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.cvsignore delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.options delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.project delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.core.resources.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/HelpContexts.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/README.txt delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/about.html delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/about.ini delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/about.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/build.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/css/org.eclipse.tm.terminal.stylesheet.dark.css delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/icons/clcl16/clear_co.gif delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/icons/dlcl16/clear_co.gif delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/icons/elcl16/clear_co.gif delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/plugin.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/plugin.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/pom.xml delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/schema/terminalConnectors.exsd delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ICommandInputField.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalListener.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalViewControl.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/TerminalViewControlFactory.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/AbstractTerminalAction.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ImageConsts.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionClearAll.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCopy.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCut.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionPaste.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionSelectAll.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/ITerminalControlForText.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalInputStream.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalMessages.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalMessages.properties delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalPlugin.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/EditActionAccelerators.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/IVT100EmulatorBackend.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/LoggingOutputStream.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100BackendTraceDecorator.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/ISnapshotChanges.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SnapshotChanges.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/ITerminalConstants.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferenceInitializer.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferencePage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsPage.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalConnectorExtension.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalState.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/GridCanvas.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ILinelRenderer.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModel.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModelListener.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStream.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PollingTextCanvasModel.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/StyleMap.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/TextCanvas.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/TextLineRenderer.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/VirtualCanvas.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/LineSegment.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/Style.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/StyleColor.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/TerminalTextDataFactory.java delete mode 100644 terminal/plugins/org.eclipse.tm.terminal/tm32.png delete mode 100644 terminal/readme.txt diff --git a/admin/findbugs-exclude.xml b/admin/findbugs-exclude.xml index e0cffd01702..bd0ae90ce5e 100644 --- a/admin/findbugs-exclude.xml +++ b/admin/findbugs-exclude.xml @@ -7,11 +7,6 @@ - - - - - diff --git a/admin/pom-config.xml b/admin/pom-config.xml index 2fc3d98dcef..b4ba75f541c 100644 --- a/admin/pom-config.xml +++ b/admin/pom-config.xml @@ -60,11 +60,8 @@ http://download.eclipse.org/cbi/updates/license http://download.eclipse.org/eclipse/updates/${sdk-version}milestones - http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/ - http://download.eclipse.org/tools/cdt/releases/8.5 - http://download.eclipse.org/tools/ptp/builds/remote/mars/milestones - http://download.eclipse.org/technology/swtbot/releases/latest/ - http://archive.eclipse.org/tm/updates/rxtx + http://download.eclipse.org/tools/orbit/downloads/drops/S20150316021154/repository/ + http://download.eclipse.org/tools/cdt/releases/8.6 @@ -88,21 +85,6 @@ ${cdt-site} p2 - - remote - ${remote-site} - p2 - - - swtbot - ${swtbot-site} - p2 - - - rxtx - ${rxtx-site} - p2 - @@ -131,7 +113,7 @@ kepler 4.3 http://download.eclipse.org/eclipse/updates/${sdk-version} - http://download.eclipse.org/tools/cdt/releases/kepler + http://download.eclipse.org/tools/cdt/releases/8.4 @@ -142,7 +124,7 @@ luna 4.4 http://download.eclipse.org/eclipse/updates/${sdk-version} - http://download.eclipse.org/tools/cdt/releases/8.4 + http://download.eclipse.org/tools/cdt/releases/8.5 @@ -380,7 +362,7 @@ - http://download.eclipse.org/tools/tcf/builds/${tcf-stream}/nightly + http://download.eclipse.org/tools/tm/builds/${tm-stream}/nightly diff --git a/admin/target-defs/eclipse-3.8.2-juno.target b/admin/target-defs/eclipse-3.8.2-juno.target index 69664abcbf0..91318866ac6 100644 --- a/admin/target-defs/eclipse-3.8.2-juno.target +++ b/admin/target-defs/eclipse-3.8.2-juno.target @@ -6,15 +6,6 @@ - - - - - - - - - @@ -23,10 +14,5 @@ - - - - - diff --git a/admin/target-defs/eclipse-4.3.x-kepler.target b/admin/target-defs/eclipse-4.3.x-kepler.target index 23ea23b021b..be0153055af 100644 --- a/admin/target-defs/eclipse-4.3.x-kepler.target +++ b/admin/target-defs/eclipse-4.3.x-kepler.target @@ -6,7 +6,6 @@ - @@ -16,18 +15,8 @@ - - - - - - - - - - diff --git a/admin/target-defs/eclipse-4.4.x-luna.target b/admin/target-defs/eclipse-4.4.x-luna.target index 25059fc1b46..2493d0d88df 100644 --- a/admin/target-defs/eclipse-4.4.x-luna.target +++ b/admin/target-defs/eclipse-4.4.x-luna.target @@ -10,16 +10,6 @@ - - - - - - - - - - diff --git a/pom.xml b/pom.xml index 4d73193a720..d090c8567fe 100644 --- a/pom.xml +++ b/pom.xml @@ -99,23 +99,6 @@ wince/org.eclipse.rse.subsystems.wince wince/org.eclipse.tm.rapi - - terminal/plugins/org.eclipse.tm.terminal - terminal/plugins/org.eclipse.tm.terminal.serial - terminal/plugins/org.eclipse.tm.terminal.ssh - terminal/plugins/org.eclipse.tm.terminal.telnet - terminal/plugins/org.eclipse.tm.terminal.remote - terminal/features/org.eclipse.tm.terminal.feature - terminal/features/org.eclipse.tm.terminal.sdk.feature - terminal/features/org.eclipse.tm.terminal.serial.feature - terminal/features/org.eclipse.tm.terminal.serial.sdk.feature - terminal/features/org.eclipse.tm.terminal.ssh.feature - terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature - terminal/features/org.eclipse.tm.terminal.telnet.feature - terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature - terminal/features/org.eclipse.tm.terminal.remote.feature - terminal/features/org.eclipse.tm.terminal.remote.sdk.feature - releng/org.eclipse.tm.repo @@ -127,8 +110,6 @@ rse/tests/org.eclipse.rse.tests-feature rse/tests/org.eclipse.rse.tests.framework rse/tests/org.eclipse.rse.tests.framework.examples - - terminal/plugins/org.eclipse.tm.terminal.test diff --git a/releng/org.eclipse.tm.repo/category.xml b/releng/org.eclipse.tm.repo/category.xml index 30c3e3723d9..0296ae587ac 100644 --- a/releng/org.eclipse.tm.repo/category.xml +++ b/releng/org.eclipse.tm.repo/category.xml @@ -22,51 +22,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TM Terminal Main Features - - - TM Terminal and RSE Main Features + RSE Main Features - Examples, Tests and Incubation Plug-ins. + RSE Examples, Tests and Incubation Plug-ins. diff --git a/terminal/features/org.eclipse.tm.terminal.feature/.project b/terminal/features/org.eclipse.tm.terminal.feature/.project deleted file mode 100644 index c72dafff564..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.feature/build.properties deleted file mode 100644 index f398bf802a8..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.feature/feature.properties deleted file mode 100644 index 48eaef3ee38..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.feature/feature.properties +++ /dev/null @@ -1,169 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Widget - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An ANSI (vt102) compatible Terminal widget \ -with RCP-only dependencies. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.feature/feature.xml deleted file mode 100644 index 3773fc24998..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.feature/feature.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.feature/pom.xml deleted file mode 100644 index da1106db887..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.feature/.project b/terminal/features/org.eclipse.tm.terminal.remote.feature/.project deleted file mode 100644 index 3dbd83bf56c..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.remote.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.remote.feature/build.properties deleted file mode 100644 index cd19ac2ddfd..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.feature/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corp. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -bin.includes = feature.xml,\ - feature.properties diff --git a/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.properties deleted file mode 100644 index ddc31e1b159..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.properties +++ /dev/null @@ -1,165 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Remote Connector - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An remote connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2015 IBM Corporation and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.xml deleted file mode 100644 index 9e5c25db581..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.feature/feature.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.remote.feature/pom.xml deleted file mode 100644 index db3f4eba50e..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.remote.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/.project deleted file mode 100644 index 974f53b28e2..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.remote.sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/build.properties deleted file mode 100644 index 6496f1dba2f..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corp. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### - -bin.includes = feature.xml,\ - feature.properties - -generate.plugin@org.eclipse.tm.terminal.remote.source=org.eclipse.tm.terminal.remote diff --git a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.properties deleted file mode 100644 index 2bd5c2af108..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.properties +++ /dev/null @@ -1,165 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Remote Connector, SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An remote connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2015 IBM Corporation and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.xml deleted file mode 100644 index 86bf1fb39ec..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/feature.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/pom.xml deleted file mode 100644 index 23827bd677b..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.remote.sdk.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.remote.sdk.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project deleted file mode 100644 index 074cff92746..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties deleted file mode 100644 index f398bf802a8..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.sdk.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties deleted file mode 100644 index 21350113ad1..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.properties +++ /dev/null @@ -1,169 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Widget, SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An ANSI (vt102) compatible Terminal widget \ -with RCP-only dependencies. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml deleted file mode 100644 index 6076545e181..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.sdk.feature/feature.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml deleted file mode 100644 index f0544bbf64f..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.sdk.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.sdk.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.feature/.project b/terminal/features/org.eclipse.tm.terminal.serial.feature/.project deleted file mode 100644 index 4664f91a3e3..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.serial.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.serial.feature/build.properties deleted file mode 100644 index 400f7fd68ee..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.serial.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.serial.feature/feature.properties deleted file mode 100644 index 7ca7bbcfcb5..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Serial Connector - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=A serial line connector for the Terminal using RXTX API - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.serial.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.serial.feature/feature.xml deleted file mode 100644 index f79d015fe64..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.feature/feature.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.serial.feature/pom.xml deleted file mode 100644 index 04701647b9a..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.serial.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/.project deleted file mode 100644 index 36ee0af9873..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.serial.sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/build.properties deleted file mode 100644 index 400f7fd68ee..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.serial.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.properties deleted file mode 100644 index d083ad76653..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Serial Connector, SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=A serial line connector for the Terminal using RXTX API - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.xml deleted file mode 100644 index d88009ad936..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/feature.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/pom.xml deleted file mode 100644 index 15eb72bbbb8..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.serial.sdk.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.serial.sdk.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.feature/.project b/terminal/features/org.eclipse.tm.terminal.ssh.feature/.project deleted file mode 100644 index e3330c4a45b..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.ssh.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.ssh.feature/build.properties deleted file mode 100644 index bd43ebc25ce..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.ssh.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.properties deleted file mode 100644 index d541fa42cfb..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal SSH Connector - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An SSH connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2000, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.xml deleted file mode 100644 index 62d03196a60..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.feature/feature.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.ssh.feature/pom.xml deleted file mode 100644 index 1e6ef93121b..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.ssh.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/.project deleted file mode 100644 index 5559076f138..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.ssh.sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/build.properties deleted file mode 100644 index bd43ebc25ce..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.ssh.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.properties deleted file mode 100644 index e2791a5bd63..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal SSH Connector, SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=An SSH connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2000, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.xml deleted file mode 100644 index 9057e585ef6..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/feature.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/pom.xml deleted file mode 100644 index 3f0f7429bc7..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.ssh.sdk.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.ssh.sdk.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.feature/.project b/terminal/features/org.eclipse.tm.terminal.telnet.feature/.project deleted file mode 100644 index 4d78b79db3c..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.telnet.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.telnet.feature/build.properties deleted file mode 100644 index 400f7fd68ee..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.telnet.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.properties deleted file mode 100644 index 68ee0271eaf..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Telnet Connector - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=A Telnet connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.xml deleted file mode 100644 index 9602035210b..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.feature/feature.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.telnet.feature/pom.xml deleted file mode 100644 index c82be495822..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.telnet.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/.project b/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/.project deleted file mode 100644 index 7c3cd363468..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.tm.terminal.telnet.sdk.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/build.properties b/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/build.properties deleted file mode 100644 index 400f7fd68ee..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# 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.telnet.sdk.feature/feature.properties b/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.properties deleted file mode 100644 index 054f79a897a..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.properties +++ /dev/null @@ -1,168 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Target Management Terminal Telnet Connector, SDK - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse TM Project - -# "tmUpdateSiteName" property - label for the update site -tmUpdateSiteName=Target Management 3.7 Updates - -# "description" property - description of the feature -description=A Telnet connector implementation for the Terminal. - -# "copyright" property - text of the "Feature Update Copyright" -copyright=\ -Copyright (c) 2003, 2015 Wind River Systems, Inc. and others.\n\ -All rights reserved. This program and the accompanying materials\n\ -are made available under the terms of the Eclipse Public License v1.0\n\ -which accompanies this distribution, and is available at\n\ -http://www.eclipse.org/legal/epl-v10.html -################ end of copyright property #################################### - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -February 1, 2011\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ - - Content may be structured and packaged into modules to facilitate delivering,\n\ - extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ - plug-in fragments ("Fragments"), and features ("Features").\n\ - - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ - in a directory named "plugins".\n\ - - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ - Each Feature may be packaged as a sub-directory in a directory named "features".\n\ - Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ - numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ - - Features may also include other Features ("Included Features"). Within a Feature, files\n\ - named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Inside Plug-ins and Fragments packaged as JARs\n\ - - Sub-directories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ - - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ - - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ - - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ - - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ - - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ - - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ - 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ - the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ - extending or updating the functionality of an Eclipse-based product.\n\ - 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ - Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ - 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ - govern the use of the Installable Software ("Installable Software Agreement") and such\n\ - Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ - with the Specification. Such Installable Software Agreement must inform the user of the\n\ - terms and conditions that govern the Installable Software and must solicit acceptance by\n\ - the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ - indication of agreement by the user, the provisioning Technology will complete installation\n\ - of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.xml deleted file mode 100644 index 37148d190eb..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/feature.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - diff --git a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/pom.xml b/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/pom.xml deleted file mode 100644 index 7d2150e6ece..00000000000 --- a/terminal/features/org.eclipse.tm.terminal.telnet.sdk.feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm.features - org.eclipse.tm.terminal.telnet.sdk.feature - 4.0.0.qualifier - eclipse-feature - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - default - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/.classpath b/terminal/plugins/org.eclipse.tm.terminal.remote/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.remote/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/.project b/terminal/plugins/org.eclipse.tm.terminal.remote/.project deleted file mode 100644 index 772df90ccb9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.tm.terminal.remote - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94637dfe13b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,61 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 0b831f584d6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Dec 07 03:43:08 CET 2006 -eclipse.preferences.version=1 -internal.default.compliance=user diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF deleted file mode 100644 index 03f058c1d27..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal.remote;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.tm.terminal, - org.eclipse.remote.core, - org.eclipse.remote.ui, - org.eclipse.core.resources, - org.eclipse.swt, - org.eclipse.jface -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.tm.internal.terminal.remote;x-internal:=true, - org.eclipse.tm.terminal.remote -Bundle-Activator: org.eclipse.tm.internal.terminal.remote.Activator -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Import-Package: org.eclipse.core.resources, - org.eclipse.ui.ide diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/about.html b/terminal/plugins/org.eclipse.tm.terminal.remote/about.html deleted file mode 100644 index d4cc693f9f0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/build.properties b/terminal/plugins/org.eclipse.tm.terminal.remote/build.properties deleted file mode 100644 index 3ca651cc829..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - about.html - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.properties deleted file mode 100644 index e20f519925c..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2015 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -pluginName = Target Management Terminal Remote Services Connector -providerName = Eclipse PTP -connectionName = Remote Services -RemoteTerminalPage.name = Remote Terminal diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.xml deleted file mode 100644 index c3aa141f19e..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/plugin.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.remote/pom.xml deleted file mode 100644 index 6b257540a07..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - - org.eclipse.tm - org.eclipse.tm.maven-build - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal.remote - 1.0.0-SNAPSHOT - eclipse-plugin - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd b/terminal/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd deleted file mode 100644 index 4fa0ed65b15..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/schema/parsers.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - Extension point that allows a parser to be added to the terminal view. The parser is intended to process output generated by the remote shell and perform an action based on the content. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unique identifier for this parser - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java deleted file mode 100644 index 2e5ecad2515..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/Activator.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.tm.internal.terminal.remote.messages.Messages; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - public static final String PLUGIN_ID = "org.eclipse.tm.terminal.remote"; //$NON-NLS-1$ - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - super(); - plugin = this; - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given plug-in relative path. - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - /** - * Create log entry from an IStatus - * - * @param status - * status to log - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - - /** - * Create log entry from a string - * - * @param msg - * message to log - */ - public static void log(String msg) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, msg, null)); - } - - /** - * Create log entry from a Throwable - * - * @param e - * throwable to log - */ - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, Messages.TERMINAL_EXCEPTION, e)); - } - - // Get rid of edu.lsu.cct tags - - /** - * Generate a unique identifier - * - * @return unique identifier string - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return PLUGIN_ID; - } - return getDefault().getBundle().getSymbolicName(); - } - - /** - * Return the OSGi service with the given service interface. - * - * @param service - * service interface - * @return the specified service or null if it's not registered - */ - public static T getService(Class service) { - final BundleContext context = plugin.getBundle().getBundleContext(); - final ServiceReference ref = context.getServiceReference(service); - return ref != null ? context.getService(ref) : null; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java deleted file mode 100644 index 28add0f3f99..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/ArgumentParser.java +++ /dev/null @@ -1,361 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -/** - * Utility class for managing command line arguments. - */ -public class ArgumentParser { - private final List tokens; - - /** - * Create a command line representation from the string with a shell command - * line. The command line is parsed and split on spaces. Quoted or escaped - * spaces are preserved.. - */ - public ArgumentParser(String commandline) { - this.tokens = parseCommandline(commandline); - } - - /** - * Create a command line representation from an array of strings. The first - * element of the array is assumed to be the command, the remaining, the - * arguments. The elements are not parsed not (un)escaped., but taked as the - * are. - */ - public ArgumentParser(String tokenArray[]) { - this(Arrays.asList(tokenArray)); - } - - /** - * Create a command line representation from an array of strings. The first - * element of the list is assumed to be the command, the remaining, the - * arguments. The elements are not parsed not (un)escaped., but taked as the - * are. - */ - public ArgumentParser(List tokenList) { - this.tokens = new ArrayList(tokenList); - } - - /** - * Create a command line representation from the command and an array of - * parameters. The elements are not parsed not (un)escaped., but taked as - * the are. - */ - public ArgumentParser(String command, String parameterArray[]) { - this(command, Arrays.asList(parameterArray)); - } - - /** - * Create a command line representation from the command and an list of - * parameters. The elements are not parsed not (un)escaped., but taked as - * the are. - */ - public ArgumentParser(String command, List parameterList) { - this.tokens = new ArrayList(); - this.tokens.add(command); - this.tokens.addAll(parameterList); - } - - private static List parseCommandline(String commandline) { - ArrayList result = new ArrayList(); - StringCharacterIterator iterator = new StringCharacterIterator(commandline); - - for (iterator.first(); iterator.current() != CharacterIterator.DONE; iterator.next()) { - - // Restart to skip white space - if (Character.isWhitespace(iterator.current())) { - continue; - } - - // Read token - StringBuffer buffer = new StringBuffer(); - token_reader: for (; iterator.current() != CharacterIterator.DONE; iterator.next()) { - char tokenChar = iterator.current(); - - // A white space terminates the token - if (Character.isWhitespace(tokenChar)) { - break token_reader; - } - - // Handle character that composes the token - switch (tokenChar) { - case '"': { - /* - * Read all text within double quotes or until end of - * string. Allows escaping. - */ - iterator.next(); // Skip quote - quoted_reader: while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '"')) { - char innerChar = iterator.current(); - switch (innerChar) { - case '\\': - char nextChar = iterator.next(); - switch (nextChar) { - case CharacterIterator.DONE: - break quoted_reader; - case '"': - // Add the character, but remove the escape - buffer.append(nextChar); - iterator.next(); - continue quoted_reader; - default: - // Add the character and keep escape - buffer.append(innerChar); - buffer.append(nextChar); - iterator.next(); - continue quoted_reader; - } - default: - buffer.append(innerChar); - iterator.next(); - continue quoted_reader; - } - } - continue token_reader; - } - case '\'': { - /* - * Read all text within single quotes or until end of - * string. No escaping. - */ - iterator.next(); // Skip the quote - while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '\'')) { - buffer.append(iterator.current()); - iterator.next(); - } - continue token_reader; - } - case '\\': { - /* - * Read escaped char. - */ - char nextChar = iterator.next(); - switch (nextChar) { - case CharacterIterator.DONE: - break token_reader; - case '\n': - // Ignore newline. Both lines are concatenated. - continue token_reader; - default: - // Add the character, but remove the escape - buffer.append(nextChar); - continue token_reader; - } - } - default: - /* - * Any other char, add to the buffer. - */ - buffer.append(tokenChar); - continue token_reader; - } - } - result.add(buffer.toString()); - } - - return result; - } - - /** - * Convert all tokens in a full command line that can be executed in a - * shell. - * - * @param fullEscape - * If every special character shall be escaped. If false, only - * white spaces are escaped and the shell will interpret the - * special chars. If true, then all special chars are quoted. - */ - public String getCommandLine(boolean fullEscape) { - StringBuffer buffer = new StringBuffer(); - Iterator iterator = this.tokens.iterator(); - boolean first = true; - while (iterator.hasNext()) { - String token = iterator.next(); - if (!first) { - buffer.append(' '); - } else { - first = false; - } - buffer.append(escapeToken(token, fullEscape)); - } - return buffer.toString(); - } - - private StringBuffer escapeToken(String token, boolean fullEscape) { - StringBuffer buffer = new StringBuffer(); - StringCharacterIterator iter = new StringCharacterIterator(token); - for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { - if (Character.isWhitespace(c)) { - buffer.append('\\'); - buffer.append(c); - continue; - } - switch (c) { - case '(': - case ')': - case '[': - case ']': - case '{': - case '}': - case '|': - case '\\': - case '*': - case '&': - case '^': - case '%': - case '$': - case '#': - case '@': - case '!': - case '~': - case '`': - case '\'': - case '"': - case ':': - case ';': - case '?': - case '>': - case '<': - case '\n': - if (fullEscape) { - buffer.append('\\'); - } - buffer.append(c); - continue; - case ' ': - buffer.append('\\'); - buffer.append(c); - continue; - default: - buffer.append(c); - continue; - } - } - return buffer; - } - - /** - * Returns a List of all entries of the command line. - * - * @return The Array - */ - public String[] getTokenArray() { - return this.tokens.toArray(new String[this.tokens.size()]); - } - - /** - * Returns a List of all entries of the command line. - * - * @return The List - */ - public List getTokenList() { - return new ArrayList(this.tokens); - } - - /** - * Returns the command of the command line, assuming that the first entry is - * always the command. - * - * @return The command or null if the command lines has no command nor - * arguments. - */ - public String getCommand() { - if (this.tokens.size() == 0) { - return null; - } - return this.tokens.get(0); - } - - /** - * Returns the command of the command line, assuming that the first entry is - * always the command. - * - * @return The command or null if the command lines has no command nor - * arguments. - * @param fullEscape - * If every special character shall be escaped. If false, only - * white spaces are escaped and the shell will interpret the - * special chars. If true, then all special chars are quoted. - */ - public String getEscapedCommand(boolean fullEscape) { - if (this.tokens.size() == 0) { - return null; - } - return escapeToken(this.tokens.get(0), fullEscape).toString(); - } - - /** - * Returns a list of all arguments, assuming that the first entry is the - * command name. - * - * @return The Array or null if the command lines has no command nor - * arguments. - */ - public String[] getParameterArray() { - if (this.tokens.size() == 0) { - return null; - } - return this.tokens.subList(1, this.tokens.size()).toArray(new String[this.tokens.size() - 1]); - } - - /** - * Returns a list of all arguments, assuming that the first entry is the - * command name. - * - * @return The List or null if the command lines has no command nor - * arguments. - */ - public List getParameterList() { - if (this.tokens.size() == 0) { - return null; - } - return new ArrayList(this.tokens.subList(1, this.tokens.size())); - } - - /** - * Returns the total number of entries. - * - * @return the total number of entries - */ - public int getSize() { - return this.tokens.size(); - } - - /** - * Returns a representation of the command line for debug purposes. - */ - @Override - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("<"); //$NON-NLS-1$ - Iterator iterator = this.tokens.iterator(); - boolean first = true; - while (iterator.hasNext()) { - String token = iterator.next(); - if (!first) { - buffer.append('\n'); - } else { - first = false; - } - buffer.append(token); - } - buffer.append(">"); //$NON-NLS-1$ - return buffer.toString(); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java deleted file mode 100644 index 5b3a7e30480..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnectionManager.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.RegistryFactory; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.osgi.util.NLS; -import org.eclipse.remote.core.IRemoteCommandShellService; -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteConnectionType; -import org.eclipse.remote.core.IRemoteProcess; -import org.eclipse.remote.core.IRemoteProcessBuilder; -import org.eclipse.remote.core.IRemoteProcessService; -import org.eclipse.remote.core.IRemoteServicesManager; -import org.eclipse.remote.core.exception.RemoteConnectionException; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.remote.messages.Messages; -import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants; -import org.eclipse.tm.terminal.remote.IRemoteTerminalParser; - -@SuppressWarnings("restriction") -public class RemoteConnectionManager extends Job { - private final static String PARSERS_EXTENSION_POINT = "parsers"; //$NON-NLS-1$ - private final static String PARSER_ELEMENT = "parser"; //$NON-NLS-1$ - private static int fgNo; - - private final ITerminalControl control; - private final RemoteConnector connector; - - private IRemoteTerminalParser parser; - - protected RemoteConnectionManager(RemoteConnector conn, ITerminalControl control) { - super("Remote Terminal-" + fgNo++); //$NON-NLS-1$ - this.control = control; - this.connector = conn; - setSystem(true); - loadParserExtension(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - @Override - protected IStatus run(IProgressMonitor monitor) { - IRemoteProcess remoteProcess = null; - IRemoteConnection remoteConnection = null; - - try { - IRemoteServicesManager svcMgr = Activator.getService(IRemoteServicesManager.class); - String connTypeId = connector.getSshSettings().getRemoteServices(); - IRemoteConnectionType connType = svcMgr.getConnectionType(connTypeId); - if (connType != null) { - remoteConnection = connType.getConnection(connector.getSshSettings().getConnectionName()); - } - if (remoteConnection == null) { - throw new RemoteConnectionException(NLS.bind(Messages.RemoteConnectionManager_0, connector.getSshSettings() - .getConnectionName())); - } - - if (!remoteConnection.isOpen()) { - remoteConnection.open(monitor); - if (!remoteConnection.isOpen()) { - throw new RemoteConnectionException(NLS.bind(Messages.RemoteConnectionManager_1, connector.getSshSettings() - .getConnectionName())); - } - } - - if (parser != null) { - remoteProcess = parser.initialize(remoteConnection); - } else { - /* - * Check the terminal shell command preference. If the preference is empty and we support a command shell, - * just use that. Otherwise use the preference value if it is set, or fall back to a default if not. - */ - IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(Activator.getUniqueIdentifier()); - String terminalShellCommand = prefs.get(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, ""); //$NON-NLS-1$ - if (!("".equals(terminalShellCommand)) //$NON-NLS-1$ - && remoteConnection.hasService(IRemoteCommandShellService.class)) { - IRemoteCommandShellService cmdShellSvc = remoteConnection.getService(IRemoteCommandShellService.class); - remoteProcess = cmdShellSvc.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY); - } else { - if ("".equals(terminalShellCommand)) { //$NON-NLS-1$ - terminalShellCommand = "/bin/bash -l"; //$NON-NLS-1$ - } - IRemoteProcessService procSvc = remoteConnection.getService(IRemoteProcessService.class); - IRemoteProcessBuilder processBuilder = procSvc.getProcessBuilder(new ArgumentParser(terminalShellCommand) - .getTokenList()); - remoteProcess = processBuilder.start(IRemoteProcessBuilder.ALLOCATE_PTY); - } - } - - connector.setInputStream(remoteProcess.getInputStream()); - control.setState(TerminalState.CONNECTED); - control.setTerminalTitle(remoteConnection.getName()); - connector.setOutputStream(remoteProcess.getOutputStream()); - - // read data until the connection gets terminated - readData(connector.getInputStream()); - } catch (IOException e) { - return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getMessage()); - } catch (RemoteConnectionException e) { - return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getMessage()); - } finally { - // make sure the terminal is disconnected when the thread ends - connector.disconnect(); - synchronized (this) { - if (remoteProcess != null && !remoteProcess.isCompleted()) { - remoteProcess.destroy(); - } - } - } - return Status.OK_STATUS; - } - - public void setTerminalSize(int cols, int rows, int width, int height) { - // Enable for org.eclipse.remote v1.2 - // if (remoteProcess instanceof IRemoteTerminal) { - // ((IRemoteTerminal) remoteProcess).setTerminalSize(cols, rows, width, height); - // } - } - - /** - * Read the data from the connection and display it in the terminal. - * - * @param in - * @throws IOException - */ - private void readData(InputStream in) throws IOException { - byte[] buf = new byte[32 * 1024]; - while (getState() == Job.RUNNING) { - int n = in.read(buf, 0, buf.length); - if (n <= 0) { - break; - } - if (parser == null || parser.parse(buf)) { - control.getRemoteToTerminalOutputStream().write(buf, 0, n); - } - } - } - - private void loadParserExtension() { - IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(Activator.getUniqueIdentifier(), - PARSERS_EXTENSION_POINT); - if (point != null) { - IExtension[] extensions = point.getExtensions(); - for (IExtension extension : extensions) { - IConfigurationElement[] elements = extension.getConfigurationElements(); - for (IConfigurationElement element : elements) { - if (PARSER_ELEMENT.equals(element.getName())) { - try { - parser = (IRemoteTerminalParser) element.createExecutableExtension("class"); //$NON-NLS-1$ - } catch (CoreException e) { - Activator.log(e); - } - } - } - } - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java deleted file mode 100644 index f97ec007898..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteConnector.java +++ /dev/null @@ -1,177 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; -import org.eclipse.tm.terminal.remote.IRemoteSettings; - -@SuppressWarnings("restriction") -public class RemoteConnector extends TerminalConnectorImpl { - private OutputStream fOutputStream; - private InputStream fInputStream; - private RemoteConnectionManager fConnection; - private int fWidth; - private int fHeight; - private final RemoteSettings fSettings; - - public RemoteConnector() { - this(new RemoteSettings()); - } - - public RemoteConnector(RemoteSettings settings) { - fSettings = settings; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#connect(org.eclipse.tm.internal.terminal. - * provisional.api.ITerminalControl) - */ - @Override - public void connect(ITerminalControl control) { - super.connect(control); - fControl.setState(TerminalState.CONNECTING); - fConnection = new RemoteConnectionManager(this, control); - fConnection.schedule(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#doDisconnect() - */ - @Override - public synchronized void doDisconnect() { - if (getInputStream() != null) { - try { - getInputStream().close(); - } catch (Exception exception) { - Activator.log(exception); - } - } - - if (getTerminalToRemoteStream() != null) { - try { - getTerminalToRemoteStream().close(); - } catch (Exception exception) { - Activator.log(exception); - } - } - - fConnection.cancel(); - } - - public InputStream getInputStream() { - return fInputStream; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getSettingsSummary() - */ - @Override - public String getSettingsSummary() { - return fSettings.getSummary(); - } - - /** - * Return the SSH Settings. - * - * @return the settings for a concrete connection. - * @since org.eclipse.tm.terminal.ssh 2.0 renamed from getTelnetSettings() - */ - public IRemoteSettings getSshSettings() { - return fSettings; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#getTerminalToRemoteStream() - */ - @Override - public OutputStream getTerminalToRemoteStream() { - return fOutputStream; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#initialize() - */ - @Override - public void initialize() throws Exception { - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#load(org.eclipse.tm.internal.terminal.provisional - * .api.ISettingsStore) - */ - @Override - public void load(ISettingsStore store) { - fSettings.load(store); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#makeSettingsPage() - */ - @Override - public ISettingsPage makeSettingsPage() { - return new RemoteSettingsPage(fSettings); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#save(org.eclipse.tm.internal.terminal.provisional - * .api.ISettingsStore) - */ - @Override - public void save(ISettingsStore store) { - fSettings.save(store); - } - - public void setInputStream(InputStream inputStream) { - fInputStream = inputStream; - } - - public void setOutputStream(OutputStream outputStream) { - fOutputStream = outputStream; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl#setTerminalSize(int, int) - */ - @Override - public void setTerminalSize(int newWidth, int newHeight) { - if (fConnection != null && (newWidth != fWidth || newHeight != fHeight)) { - // avoid excessive communications due to change size requests by caching previous size - fConnection.setTerminalSize(newWidth, newHeight, 8 * newWidth, 8 * newHeight); - fWidth = newWidth; - fHeight = newHeight; - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java deleted file mode 100644 index e71e9f65eb9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettings.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.terminal.remote.IRemoteSettings; - -@SuppressWarnings("restriction") -public class RemoteSettings implements IRemoteSettings { - protected String fRemoteServices; - protected String fConnectionName; - - public RemoteSettings() { - } - - public String getConnectionName() { - return fConnectionName; - } - - public String getRemoteServices() { - return fRemoteServices; - } - - public String getSummary() { - return "Remote:" + getRemoteServices() + '_' + getConnectionName(); //$NON-NLS-1$ - } - - @Override - public String toString() { - return getSummary(); - } - - /** - * Load information into the RemoteSettings object. - */ - public void load(ISettingsStore store) { - fRemoteServices = store.get(REMOTE_SERVICES); - fConnectionName = store.get(CONNECTION_NAME); - } - - /** - * Extract information from the RemoteSettings object. - */ - public void save(ISettingsStore store) { - store.put(REMOTE_SERVICES, fRemoteServices); - store.put(CONNECTION_NAME, fConnectionName); - } - - public void setConnectionName(String name) { - fConnectionName = name; - } - - public void setRemoteServices(String remoteServices) { - fRemoteServices = remoteServices; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java deleted file mode 100644 index 646274136e0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/RemoteSettingsPage.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote; - -import org.eclipse.remote.ui.widgets.RemoteConnectionWidget; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage; - -@SuppressWarnings("restriction") -public class RemoteSettingsPage extends AbstractSettingsPage { - private final RemoteSettings fTerminalSettings; - private RemoteConnectionWidget fRemoteConnectionWidget; - - public RemoteSettingsPage(RemoteSettings settings) { - fTerminalSettings = settings; - } - - @Override - public void saveSettings() { - fTerminalSettings.setRemoteServices(fRemoteConnectionWidget.getConnection().getConnectionType().getId()); - fTerminalSettings.setConnectionName(fRemoteConnectionWidget.getConnection().getName()); - } - - @Override - public void loadSettings() { - if (fTerminalSettings != null) { - fRemoteConnectionWidget.setConnection(fTerminalSettings.getRemoteServices(), fTerminalSettings.getConnectionName()); - } - } - - String get(String value, String def) { - if (value == null || value.length() == 0) { - return def; - } - return value; - } - - @Override - public boolean validateSettings() { - if (fRemoteConnectionWidget.getConnection() == null) { - return false; - } - return true; - } - - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(2, false); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - - composite.setLayout(gridLayout); - composite.setLayoutData(gridData); - - fRemoteConnectionWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0); - loadSettings(); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java deleted file mode 100644 index a0df4052781..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/Messages.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote.messages; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.tm.internal.terminal.remote.messages.messages"; //$NON-NLS-1$ - - public static String RemoteConnectionManager_0; - - public static String RemoteConnectionManager_1; - - public static String RemoteTerminalPreferencePage_0; - - public static String TERMINAL_EXCEPTION; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties deleted file mode 100644 index 0690775e652..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/messages/messages.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved. -# This program and the accompanying materials are made available under the terms -# of the Eclipse Public License v1.0 which accompanies this distribution, and is -# available at http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Wind River Systems - initial API and implementation -############################################################################### -RemoteConnectionManager_0=Unable to create connection: {0} -RemoteConnectionManager_1=Unable to to open connection: {0} -RemoteTerminalPreferencePage_0=Initial Shell Command -TERMINAL_EXCEPTION=Remote Terminal Exception diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java deleted file mode 100644 index 99d3a8ac91c..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferenceInitializer.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.tm.internal.terminal.remote.Activator; -import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants; - -public class RemoteTerminalPreferenceInitializer extends AbstractPreferenceInitializer { - - public RemoteTerminalPreferenceInitializer() { - } - - @Override - public void initializeDefaultPreferences() { - IEclipsePreferences defaultPrefs = DefaultScope.INSTANCE.getNode(Activator.getUniqueIdentifier()); - defaultPrefs.put(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, ""); //$NON-NLS-1$ - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java deleted file mode 100644 index cfc75187ddf..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/internal/terminal/remote/preferences/RemoteTerminalPreferencePage.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.remote.preferences; - -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.tm.internal.terminal.remote.Activator; -import org.eclipse.tm.internal.terminal.remote.messages.Messages; -import org.eclipse.tm.terminal.remote.IRemoteTerminalConstants; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -public class RemoteTerminalPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - protected void createFieldEditors() { - Composite parent = getFieldEditorParent(); - addField(new StringFieldEditor(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, - Messages.RemoteTerminalPreferencePage_0, parent)); - } - - @Override - public IPreferenceStore doGetPreferenceStore() { - return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.getUniqueIdentifier()); - } - - public void init(IWorkbench workbench) { - // Nothing - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java deleted file mode 100644 index 22b07d0107d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteSettings.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.terminal.remote; - -public interface IRemoteSettings { - public static final String CONNECTION_NAME = "ConnectionName"; //$NON-NLS-1$ - public static final String REMOTE_SERVICES = "RemoteServices"; //$NON-NLS-1$ - - /** - * Get the host name or IP address of remote system to connect. - * - * @return host name or IP address of the remote system. - */ - String getRemoteServices(); - - /** - * Get the login name for connecting to the remote system. - * - * @return remote login name - */ - String getConnectionName(); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java deleted file mode 100644 index d0f29e085c8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalConstants.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.terminal.remote; - -public interface IRemoteTerminalConstants { - public static final String PREF_TERMINAL_SHELL_COMMAND = "TERMINAL_SHELL_COMMAND"; //$NON-NLS-1$ -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java b/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java deleted file mode 100644 index f951e2309e8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.remote/src/org/eclipse/tm/terminal/remote/IRemoteTerminalParser.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.tm.terminal.remote; - -import java.io.IOException; - -import org.eclipse.remote.core.IRemoteConnection; -import org.eclipse.remote.core.IRemoteProcess; - -public interface IRemoteTerminalParser { - /** - * Initialize the remote shell. This method will be called after the connection has been initialized. Implementors can assume - * that the connection is open when this is called. - * - * @param connection - * terminal shell connection - * @return IRemoteProcess a remote process corresponding to the remote shell - * @throws IOException - * if the remote shell fails to start for some reason - */ - IRemoteProcess initialize(IRemoteConnection connection) throws IOException; - - /** - * Parse the input stream. This method will be called with a buffer of characters read from the input stream. If the method - * returns true, the characters will be displayed in the terminal view, otherwise they will be ignored. - * - * @param buf - * buffer containing characters from the terminal input stream - * @return true if the characters should be displayed in the terminal - */ - boolean parse(byte[] buf); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/.classpath b/terminal/plugins/org.eclipse.tm.terminal.serial/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.serial/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/.project b/terminal/plugins/org.eclipse.tm.terminal.serial/.project deleted file mode 100644 index a06d0caecb3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.tm.terminal.serial - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94637dfe13b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,61 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF deleted file mode 100644 index b27bc126daa..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal.serial;singleton:=true -Bundle-Version: 2.1.400.qualifier -Bundle-Localization: plugin -Import-Package: gnu.io;resolution:=optional -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.tm.terminal;bundle-version="3.3.0" -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Eclipse-BuddyPolicy: ext -Bundle-Vendor: %providerName -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-ClassPath: . -Bundle-Activator: org.eclipse.tm.internal.terminal.serial.Activator -Export-Package: org.eclipse.tm.internal.terminal.serial;x-internal:=true diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/README.txt b/terminal/plugins/org.eclipse.tm.terminal.serial/README.txt deleted file mode 100644 index f06224544a0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/README.txt +++ /dev/null @@ -1,64 +0,0 @@ -Important note: ---------------- -This README is for terminal.serial version 1.0.0 and later, corresponding -to RSE downloads after 2.0M4. Instructions for previous versions (using -Sun javacomm / javax.comm package instead of gnu.io) are still available from -http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/README.txt?root=Tools_Project&view=markup&pathrev=R1_0_1 - - -Prerequisites: --------------- -In order to compile and run this plugin, RXTX has to be installed. -There are two options: Either installing RXTX as an Eclipse plugin, -or installing RXTX as a JVM extension. For installation as plugin, -you can download a ZIP archive or use the Update Manager; if an -Eclipse plugin is not available for your Platform, you'll need -to install RXTX into the JVM (option B, below). - -In either case, once RXTX is installed, you'll need to quit and -re-start Eclipse PDE in order to recompute the classpath. - - -Option A.1: Installation as an Eclipse Plugin via Update Manager: ------------------------------------------------------------------ -* In Eclipse, choose Help > Software Updates... - - Add New Remote Site: - Name = RXTX - URL = http://rxtx.qbang.org/eclipse/ - - Finish, select proper version, Install All - - -Option A.2: Installation as an Eclipse Plugin via Download: ------------------------------------------------------------ -* Download RXTX SDK or Runtime ZIP from - http://rxtx.qbang.org/eclipse/downloads/ - and extract it into your Eclipse installation. The download - link mentioned also has a README with version and licensing - information. - - -Option B: Installation as a JVM Extension: ------------------------------------------- -* Get RXTX binaries from - ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip -* Copy RXTXcomm.jar into $JRE/lib/ext -* Copy the native libs for your Platform (*.so, *.jnilib, *.dll) - into the respective native lib folder of your RSE -* More installation instructions are at - http://rxtx.qbang.org/wiki/index.php/Main_Page -* More downloads for other platforms (currently about 30) - are available from the "ToyBox" link on - http://users.frii.com/jarvi/rxtx/download.html - - -For help, contact the RXTX mailing list available via the -RXTX website at http://www.rxtx.org or see the notes on -https://bugs.eclipse.org/bugs/show_bug.cgi?id=175336 - - -Changelog: ----------- -2.0.1 - Revised Update Site text to comply with P2 in Eclipse 3.4 -1.0.1 - Added options for installing RXTX as an Eclipse Plugin -0.9.100 - switched from Sun javax.comm to rxtx gnu.io for serial support -0.9.0 - first version diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/about.html b/terminal/plugins/org.eclipse.tm.terminal.serial/about.html deleted file mode 100644 index d4cc693f9f0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/about.ini b/terminal/plugins/org.eclipse.tm.terminal.serial/about.ini deleted file mode 100644 index 3adc27ab587..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=tm32.png - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (not translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/about.properties b/terminal/plugins/org.eclipse.tm.terminal.serial/about.properties deleted file mode 100644 index d3b0791fe45..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber - initial API and implementation -################################################################################ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. -# -# Do not translate any values surrounded by {} - -blurb=Target Management Terminal Serial Connector\n\ -\n\ -Version: {featureVersion}\n\ -\n\ -(c) Copyright Wind River Systems, Inc. and others 2003, 2015. All rights reserved.\n\ -Visit http://www.eclipse.org/tm diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/build.properties b/terminal/plugins/org.eclipse.tm.terminal.serial/build.properties deleted file mode 100644 index 6da951b9f99..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/build.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - README.txt,\ - about.html,\ - about.ini,\ - about.properties,\ - tm32.png -src.includes = README.txt,\ - about.html diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.properties deleted file mode 100644 index 9d225da7bd2..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -pluginName = Target Management Terminal Serial Connector -providerName = Eclipse TM Project -serialConnection = Serial \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.xml deleted file mode 100644 index 9fe07138de0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/plugin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml deleted file mode 100644 index d4ae3c31e90..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal.serial - 2.1.400.qualifier - eclipse-plugin - diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Activator.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Activator.java deleted file mode 100644 index f758aa790e6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.tm.terminal.serial"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - String prop = System.getProperty("gnu.io.rxtx.NoVersionOutput"); //$NON-NLS-1$ - if (prop==null) { - System.setProperty("gnu.io.rxtx.NoVersionOutput", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java deleted file mode 100644 index 671ef8b7f6d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/ISerialSettings.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public interface ISerialSettings { - - String getSerialPort(); - int getBaudRate(); - int getDataBits(); - int getStopBits(); - int getParity(); - int getFlowControl(); - int getTimeout(); - String getSummary(); - void load(ISettingsStore store); - void save(ISettingsStore store); -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java deleted file mode 100644 index 936b5cf70dc..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java +++ /dev/null @@ -1,212 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalControl - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [207158] improve error message when port not available - * Martin Oberhuber (Wind River) - [208029] COM port not released after quick disconnect/reconnect - * Martin Oberhuber (Wind River) - [206884] Update Terminal Ownership ID to "org.eclipse.tm.terminal.serial" - * Martin Oberhuber (Wind River) - [221184] Redesign Serial Terminal Ownership Handling - * Michael Scharf (Wind River) - [262996] get rid of TerminalState.OPENED - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import gnu.io.CommPortIdentifier; -import gnu.io.NoSuchPortException; -import gnu.io.PortInUseException; -import gnu.io.SerialPort; - -import java.util.Arrays; -import java.util.Enumeration; - -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -public class SerialConnectWorker extends Thread { - private final ITerminalControl fControl; - private final SerialConnector fConn; - - /** - * UNDER CONSTRUCTION - * @param conn TODO - * @param control TODO - */ - public SerialConnectWorker(SerialConnector conn, ITerminalControl control) { - super(); - fControl = control; - fConn = conn; - } - - /** - * Adds the named port to the name of known ports to rxtx - * @param name - */ - void addPort(String name) { - // Rxtx either takes the connection from the properties OR using - // the port scan. - // Unfortunately, setting gnu.io.rxtx.SerialPorts only temporarily does not - // work, because rxtx closes connections that are unknown. - // The only solution I could come up with: add the known connections - // to the gnu.io.rxtx.SerialPorts property.... - final String GNU_IO_RXTX_SERIAL_PORTS = "gnu.io.rxtx.SerialPorts"; //$NON-NLS-1$ - String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$//$NON-NLS-2$ - // get the existing names - String names = System.getProperty(GNU_IO_RXTX_SERIAL_PORTS); - if (names == null) { - StringBuffer buffer=new StringBuffer(); - boolean sepNeeded=false; - // When we add a port to this property, rxtx forgets the - // ports it finds by scanning the system. - - // iterate over the known ports and add them to the property - Enumeration portIdEnum= CommPortIdentifier.getPortIdentifiers(); - while (portIdEnum.hasMoreElements()) { - CommPortIdentifier identifier = (CommPortIdentifier) portIdEnum.nextElement(); - if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL) { - if(sepNeeded) - buffer.append(sep); - else - sepNeeded=true; - buffer.append(identifier.getName()); - } - } - // append our new port - if(sepNeeded) - buffer.append(sep); - buffer.append(name); - - System.setProperty(GNU_IO_RXTX_SERIAL_PORTS,buffer.toString()); - } else if (!Arrays.asList(names.split(sep)).contains(name)) { - // the list does not contain the name, therefore we add it - // since there is at least one name in the list, we append it - System.setProperty(GNU_IO_RXTX_SERIAL_PORTS, names + sep + name); - } else { - // nothing to do -- should never happen... - return; - } - // Reinitialize the ports because we have changed the list of known ports - CommPortIdentifier.getPortIdentifiers(); - } - - /** - * Return the ID that this connector uses for RXTX Comm Ownership Handling. - * - * Note that this was changed in Terminal 2.0 as per - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=206884 - previous versions - * of the serial terminal connector used a different string, - * "org.eclipse.tm.internal.terminal.serial". - * - * @since org.eclipse.tm.terminal.serial 2.0 - * @return ownership ID, "org.eclipse.tm.terminal.serial" - */ - public static final String getOwnershipId() { - return "org.eclipse.tm.terminal.serial"; //$NON-NLS-1$ - } - - public void run() { - String portName=null; - final String strID = getOwnershipId(); - SerialPort serialPort = null; - try { - ISerialSettings s=fConn.getSerialSettings(); - portName=s.getSerialPort(); - try { - fConn.setSerialPortIdentifier(CommPortIdentifier.getPortIdentifier(portName)); - } catch (NoSuchPortException e) { - // let's try - addPort(portName); - fConn.setSerialPortIdentifier(CommPortIdentifier.getPortIdentifier(portName)); - } - fConn.setSerialPortHandler(new SerialPortHandler(fConn,fControl)); - fConn.setSerialPortIdentifier(CommPortIdentifier.getPortIdentifier(portName)); - - //Bug 221184: Warn about serial port already in use - String currentOwner = fConn.getSerialPortIdentifier().getCurrentOwner(); - if (strID.equals(currentOwner)) { - currentOwner = SerialMessages.ANOTHER_TERMINAL; - } - final int[] answer = { SWT.YES }; - final String fPortName = portName; - final String fCurrentOwner = currentOwner; - if (currentOwner != null) { - Display.getDefault().syncExec(new Runnable() { - public void run() { - MessageBox mb = new MessageBox(fControl.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO); - mb.setText(SerialMessages.PROP_TITLE); - mb.setMessage(NLS.bind(SerialMessages.PORT_IN_USE, fPortName, fCurrentOwner)); - answer[0] = mb.open(); - } - }); - } - - if (answer[0] != SWT.YES) { - // don't try to steal the port - fControl.setState(TerminalState.CLOSED); - fConn.setSerialPortHandler(null); - return; - } else { - // Try to steal the port -- may throw PortInUseException - int timeoutInMs = s.getTimeout() * 1000; - serialPort = (SerialPort) fConn.getSerialPortIdentifier().open(strID, timeoutInMs); - serialPort.setSerialPortParams(s.getBaudRate(), s.getDataBits(), s.getStopBits(), s.getParity()); - serialPort.setFlowControlMode(s.getFlowControl()); - serialPort.addEventListener(fConn.getSerialPortHandler()); - serialPort.notifyOnDataAvailable(true); - fConn.getSerialPortIdentifier().addPortOwnershipListener(fConn.getSerialPortHandler()); - fConn.setSerialPort(serialPort); - if (fCurrentOwner != null) { - fControl.displayTextInTerminal(NLS.bind(SerialMessages.PORT_STOLEN, fPortName, fCurrentOwner)); - - } - fControl.setState(TerminalState.CONNECTED); - } - - } catch (PortInUseException portInUseException) { - fControl.setState(TerminalState.CLOSED); - String theOwner = portInUseException.currentOwner; - if (strID.equals(theOwner)) { - theOwner = SerialMessages.ANOTHER_TERMINAL; - } - fControl.displayTextInTerminal(NLS.bind(SerialMessages.PORT_NOT_STOLEN, portName, theOwner)); - } catch (NoSuchPortException e) { - fControl.setState(TerminalState.CLOSED); - String msg=e.getMessage(); - if(msg==null) - msg=portName; - fControl.displayTextInTerminal(NLS.bind(SerialMessages.NO_SUCH_PORT, msg)); - - } catch (Exception exception) { - Logger.logException(exception); - if (serialPort!=null) { - //Event listener is removed as part of close(), - //but exceptions need to be caught to ensure that close() really succeeds - try { - serialPort.removeEventListener(); - Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable - } catch(Exception e) { - Logger.logException(e); - } - serialPort.close(); - fConn.getSerialPortIdentifier().removePortOwnershipListener(fConn.getSerialPortHandler()); - } - fControl.setState(TerminalState.CLOSED); - } finally { - fConn.doneConnect(); - } - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java deleted file mode 100644 index e01a1e079f2..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnector.java +++ /dev/null @@ -1,230 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalControl - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [206892] Don't connect if already connecting - * Martin Oberhuber (Wind River) - [208029] COM port not released after quick disconnect/reconnect - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import gnu.io.CommPortIdentifier; -import gnu.io.SerialPort; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -public class SerialConnector extends TerminalConnectorImpl { - private OutputStream fOutputStream; - private InputStream fInputStream; - private SerialPort fSerialPort; - private CommPortIdentifier fSerialPortIdentifier; - private SerialPortHandler fTerminalSerialPortHandler; - private SerialSettings fSettings; - private SerialConnectWorker fConnectWorker = null; - private volatile boolean fDisconnectGoingOn = false; - - public SerialConnector() { - } - public SerialConnector(SerialSettings settings) { - fSettings=settings; - } - public void initialize() throws Exception { - try { - fSettings=new SerialSettings(); - } catch (NoClassDefFoundError e) { - // tell the user how to install the library - throw new CoreException(new Status(IStatus.WARNING,Activator.PLUGIN_ID,0, SerialMessages.ERROR_LIBRARY_NOT_INSTALLED,e)); - } - } - public void connect(ITerminalControl control) { - super.connect(control); - synchronized(this) { - if (fConnectWorker!=null || fDisconnectGoingOn) { - //avoid multiple background connect/disconnect threads at the same time - return; - } - fConnectWorker = new SerialConnectWorker(this, control); - } - fControl.setState(TerminalState.CONNECTING); - fConnectWorker.start(); - } - /** - * Indicate that the connectWorker is finished. - */ - void doneConnect() { - synchronized(this) { - fConnectWorker = null; - } - } - public void doDisconnect() { - synchronized(this) { - //avoid multiple background connect/disconnect threads at the same time - if (fConnectWorker!=null) { - fConnectWorker.interrupt(); - return; - } else if (fDisconnectGoingOn) { - return; - } - fDisconnectGoingOn = true; - } - - // Fix for SPR 112422. When output is being received from the serial port, the - // below call to removePortOwnershipListener() attempts to lock the serial port - // object, but that object is already locked by another Terminal view thread - // waiting for the SWT display thread to process a syncExec() call. Since this - // method is called on the display thread, the display thread is waiting to - // lock the serial port object and the thread holding the serial port object - // lock is waiting for the display thread to process a syncExec() call, so the - // two threads end up deadlocked, which hangs the Workbench GUI. - // - // The solution is to spawn a short-lived worker thread that calls - // removePortOwnershipListener(), thus preventing the display thread from - // deadlocking with the other Terminal view thread. - - new Thread("Terminal View Serial Port Disconnect Worker") //$NON-NLS-1$ - { - public void run() { - try { - if (getSerialPortIdentifier() != null) { - try { - getSerialPortIdentifier() - .removePortOwnershipListener(getSerialPortHandler()); - } catch(Exception e) { - Logger.logException(e); - } - } - - if (getSerialPort() != null) { - //Event listener is removed as part of close(), - //but exceptions need to be caught to ensure that close() really succeeds - try { - getSerialPort().removeEventListener(); - Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable - } catch(Exception e) { - Logger.logException(e); - } - Logger.log("Calling close() on serial port ..."); //$NON-NLS-1$ - getSerialPort().close(); - } - - if (getInputStream() != null) { - try { - getInputStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - if (getTerminalToRemoteStream() != null) { - try { - getTerminalToRemoteStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - setSerialPortIdentifier(null); - cleanSerialPort(); - setSerialPortHandler(null); - } catch(Exception e) { - Logger.logException(e); - } finally { - fDisconnectGoingOn = false; - } - } - - }.start(); - } - public InputStream getInputStream() { - return fInputStream; - } - public OutputStream getTerminalToRemoteStream() { - return fOutputStream; - } - private void setInputStream(InputStream inputStream) { - fInputStream = inputStream; - } - private void setOutputStream(OutputStream outputStream) { - fOutputStream = outputStream; - } - public void setTerminalSize(int newWidth, int newHeight) { - // TODO - } - protected SerialPort getSerialPort() { - return fSerialPort; - } - - /** - * sets the socket to null - */ - void cleanSerialPort() { - fSerialPort=null; - setInputStream(null); - setOutputStream(null); - } - - protected void setSerialPort(SerialPort serialPort) throws IOException { - cleanSerialPort(); - if(serialPort!=null) { - fSerialPort = serialPort; - setOutputStream(serialPort.getOutputStream()); - setInputStream(serialPort.getInputStream()); - } - } - protected CommPortIdentifier getSerialPortIdentifier() { - return fSerialPortIdentifier; - } - protected void setSerialPortIdentifier(CommPortIdentifier serialPortIdentifier) { - //System.out.println("setSerialPortId: "+Thread.currentThread().getName()+ " - "+serialPortIdentifier + " - "+System.currentTimeMillis()); - fSerialPortIdentifier = serialPortIdentifier; - } - void setSerialPortHandler(SerialPortHandler serialPortHandler) { - fTerminalSerialPortHandler=serialPortHandler; - } - SerialPortHandler getSerialPortHandler() { - return fTerminalSerialPortHandler; - } - /** - * Return the Serial Settings. - * - * @return the settings for a concrete connection. - */ - public ISerialSettings getSerialSettings() { - return fSettings; - } - public ISettingsPage makeSettingsPage() { - return new SerialSettingsPage(fSettings); - } - public String getSettingsSummary() { - return fSettings.getSummary(); - } - public void load(ISettingsStore store) { - fSettings.load(store); - } - public void save(ISettingsStore store) { - fSettings.save(store); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.java deleted file mode 100644 index 876af882e93..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [221184] Redesign Serial Terminal Ownership Handling - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import org.eclipse.osgi.util.NLS; -public class SerialMessages extends NLS { - static { - NLS.initializeMessages(SerialMessages.class.getName(), SerialMessages.class); - } - public static String PROP_TITLE; - public static String PORT; - public static String BAUDRATE; - public static String DATABITS; - public static String STOPBITS; - public static String PARITY; - public static String FLOWCONTROL; - public static String TIMEOUT; - - public static String ERROR_LIBRARY_NOT_INSTALLED; - - public static String PORT_IN_USE; - public static String ANOTHER_TERMINAL; - public static String PORT_STOLEN; - public static String PORT_NOT_STOLEN; - public static String NO_SUCH_PORT; - - public static String OWNERSHIP_GRANTED; - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.properties b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.properties deleted file mode 100644 index a599c1267bf..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialMessages.properties +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -# Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox -# Martin Oberhuber (Wind River) - [221184] Redesign Serial Terminal Ownership Handling -############################################################################### -PROP_TITLE = Terminal -PORT = Port -BAUDRATE = Baud Rate -DATABITS = Data Bits -STOPBITS = Stop Bits -PARITY = Parity -FLOWCONTROL = Flow Control -TIMEOUT = Timeout (sec) -ERROR_LIBRARY_NOT_INSTALLED = The RXTX library has not been installed properly! \n\ -\n\ -Installation:\n\ --------------\n\ -* Either (a) Use Help > Software Updates, Add Site and install from:\n\ -\ \ \ http://rxtx.qbang.org/eclipse/\n\ -* Or (b) Download and install RXTX for Eclipse from:\n\ -\ \ \ http://rxtx.qbang.org/eclipse/downloads/\n\ -\n\ -For other Platforms, more info and help see\n\ -\ \ \ http://www.rxtx.org/\n\ -\ \ \ https://bugs.eclipse.org/bugs/show_bug.cgi?id=175336#c6\n\ -\n\ -This message is also available in your Error Log for Copy & Paste. - -# Port Ownership Handling -PORT_IN_USE = Serial port \''{0}\'' is currently in use by {1}\!\nDo you want to try and steal the port? -ANOTHER_TERMINAL = another Terminal View -PORT_STOLEN = Port \''{0}\'' successfully obtained from {1}\r\n -PORT_NOT_STOLEN = Connection Error!\r\n \''{0}\'' is already in use by {1}.\r\n -NO_SUCH_PORT = No such port: \''{0}\''\r\n - -OWNERSHIP_GRANTED = Connection canceled due to ownership request from {0}.\r\n \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java deleted file mode 100644 index 53a93790e2a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalControl - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox - * Martin Oberhuber (Wind River) - [221184] Redesign Serial Terminal Ownership Handling - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import gnu.io.CommPortOwnershipListener; -import gnu.io.SerialPortEvent; -import gnu.io.SerialPortEventListener; - -import java.io.IOException; - -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Display; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; - -/** - * UNDER CONSTRUCTION - */ -public class SerialPortHandler implements - SerialPortEventListener, CommPortOwnershipListener { - - private final ITerminalControl fControl; - private final SerialConnector fConn; - protected byte[] bytes = new byte[2048]; - - /** - * UNDER CONSTRUCTION - * @param control TODO - */ - public SerialPortHandler(SerialConnector conn,ITerminalControl control) { - super(); - fControl = control; - fConn=conn; - } - - // Message handlers - - /** - * UNDER CONSTRUCTION - */ - public void onSerialDataAvailable(Object data) { - try { - while (fConn.getInputStream() != null && fConn.getInputStream().available() > 0) { - int nBytes = fConn.getInputStream().read(bytes); - fControl.getRemoteToTerminalOutputStream().write(bytes, 0, nBytes); - } - } catch (IOException ex) { - fControl.displayTextInTerminal(ex.getMessage()); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - public void onSerialOwnershipRequested(Object data) { - //Bug 221184: We immediately release the port on any ownership request - try { - throw new Exception(); - } catch (Exception e) { - StackTraceElement[] elems = e.getStackTrace(); - final String requester = elems[elems.length - 4].getClassName(); - Display.getDefault().asyncExec(new Runnable() { - public void run() { - fConn.disconnect(); - String req = requester; - String myPackage = this.getClass().getPackage().getName(); - if (req.startsWith(myPackage)) { - req = SerialMessages.ANOTHER_TERMINAL; - } - fControl.displayTextInTerminal(NLS.bind(SerialMessages.OWNERSHIP_GRANTED, req)); - } - }); - fConn.disconnect(); - } - } - - // SerialPortEventListener interface - public void serialEvent(SerialPortEvent event) { - switch (event.getEventType()) { - case SerialPortEvent.DATA_AVAILABLE: - onSerialDataAvailable(null); - break; - } - } - - // CommPortOwnershipListener interface - - /** - * UNDER CONSTRUCTION - */ - public void ownershipChange(int nType) { - switch (nType) { - case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: - onSerialOwnershipRequested(null); - break; - } - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java deleted file mode 100644 index bbb2fdd64c5..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialProperties.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalProperties - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import gnu.io.CommPortIdentifier; - -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; -import java.util.Vector; - -public class SerialProperties { - protected List fSerialPortTable; - protected List fBaudRateTable; - protected List fDataBitsTable; - protected List fStopBitsTable; - protected List fParityTable; - protected List fFlowControlTable; - protected String fDefaultConnType; - protected String fDefaultSerialPort; - protected String fDefaultBaudRate; - protected String fDefaultDataBits; - protected String fDefaultStopBits; - protected String fDefaultParity; - protected String fDefaultFlowControl; - - public SerialProperties() { - setupProperties(); - } - public List getSerialPortTable() { - return fSerialPortTable; - } - - public List getBaudRateTable() { - return fBaudRateTable; - } - - public List getDataBitsTable() { - return fDataBitsTable; - } - - public List getStopBitsTable() { - return fStopBitsTable; - } - - public List getParityTable() { - return fParityTable; - } - - public List getFlowControlTable() { - return fFlowControlTable; - } - public String getDefaultConnType() { - return fDefaultConnType; - } - - public String getDefaultSerialPort() { - return fDefaultSerialPort; - } - - public String getDefaultBaudRate() { - return fDefaultBaudRate; - } - - public String getDefaultDataBits() { - return fDefaultDataBits; - } - - public String getDefaultStopBits() { - return fDefaultStopBits; - } - - public String getDefaultParity() { - return fDefaultParity; - } - - public String getDefaultFlowControl() { - return fDefaultFlowControl; - } - public String getDefaultTimeout() { - return "5"; //$NON-NLS-1$ - } - protected void setupProperties() { - fSerialPortTable = new Vector(); - fBaudRateTable = new Vector(); - fDataBitsTable = new Vector(); - fStopBitsTable = new Vector(); - fParityTable = new Vector(); - fFlowControlTable = new Vector(); - fDefaultConnType = ""; //$NON-NLS-1$ - fDefaultSerialPort = ""; //$NON-NLS-1$ - fDefaultBaudRate = ""; //$NON-NLS-1$ - fDefaultDataBits = ""; //$NON-NLS-1$ - fDefaultStopBits = ""; //$NON-NLS-1$ - fDefaultParity = ""; //$NON-NLS-1$ - fDefaultFlowControl = ""; //$NON-NLS-1$ - - fBaudRateTable.add("300"); //$NON-NLS-1$ - fBaudRateTable.add("1200"); //$NON-NLS-1$ - fBaudRateTable.add("2400"); //$NON-NLS-1$ - fBaudRateTable.add("4800"); //$NON-NLS-1$ - fBaudRateTable.add("9600"); //$NON-NLS-1$ - fBaudRateTable.add("19200"); //$NON-NLS-1$ - fBaudRateTable.add("38400"); //$NON-NLS-1$ - fBaudRateTable.add("57600"); //$NON-NLS-1$ - fBaudRateTable.add("115200"); //$NON-NLS-1$ - - fDataBitsTable.add("5"); //$NON-NLS-1$ - fDataBitsTable.add("6"); //$NON-NLS-1$ - fDataBitsTable.add("7"); //$NON-NLS-1$ - fDataBitsTable.add("8"); //$NON-NLS-1$ - - fStopBitsTable.add("1"); //$NON-NLS-1$ - fStopBitsTable.add("1_5"); //$NON-NLS-1$ - fStopBitsTable.add("2"); //$NON-NLS-1$ - - fParityTable.add("None"); //$NON-NLS-1$ - fParityTable.add("Even"); //$NON-NLS-1$ - fParityTable.add("Odd"); //$NON-NLS-1$ - fParityTable.add("Mark"); //$NON-NLS-1$ - fParityTable.add("Space"); //$NON-NLS-1$ - - fFlowControlTable.add("None"); //$NON-NLS-1$ - fFlowControlTable.add("RTS/CTS"); //$NON-NLS-1$ - fFlowControlTable.add("Xon/Xoff"); //$NON-NLS-1$ - - fDefaultBaudRate = (String) fBaudRateTable.get(4); - fDefaultDataBits = (String) fDataBitsTable.get(3); - fDefaultStopBits = (String) fStopBitsTable.get(0); - fDefaultParity = (String) fParityTable.get(0); - fDefaultFlowControl = (String) fFlowControlTable.get(0); - - Enumeration portIdEnum= CommPortIdentifier.getPortIdentifiers(); - while (portIdEnum.hasMoreElements()) { - CommPortIdentifier identifier = (CommPortIdentifier) portIdEnum.nextElement(); - String strName = identifier.getName(); - int nPortType = identifier.getPortType(); - - if (nPortType == CommPortIdentifier.PORT_SERIAL) - fSerialPortTable.add(strName); - } - - Collections.sort(fSerialPortTable); - - if (!fSerialPortTable.isEmpty()) { - fDefaultSerialPort = (String) fSerialPortTable.get(0); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java deleted file mode 100644 index be10ad14a80..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettings.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalSettings - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import gnu.io.SerialPort; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public class SerialSettings implements ISerialSettings { - protected String fSerialPort; - protected String fBaudRate; - protected String fDataBits; - protected String fStopBits; - protected String fParity; - protected String fFlowControl; - protected String fTimeout; - final private SerialProperties fProperties=new SerialProperties(); - - public String getSerialPort() { - return fSerialPort; - } - - public void setSerialPort(String strSerialPort) { - fSerialPort = strSerialPort; - } - - public String getBaudRateString() { - return fBaudRate; - } - - public int getBaudRate() { - int nBaudRate; - - try { - nBaudRate = Integer.parseInt(fBaudRate); - } catch (NumberFormatException numberFormatException) { - nBaudRate = 9600; - } - - return nBaudRate; - } - - public void setBaudRate(String strBaudRate) { - fBaudRate = strBaudRate; - } - - public String getDataBitsString() { - return fDataBits; - } - - public int getDataBits() { - if (fDataBits.equals("5")) { //$NON-NLS-1$ - return SerialPort.DATABITS_5; - } else if (fDataBits.equals("6")) { //$NON-NLS-1$ - return SerialPort.DATABITS_6; - } else if (fDataBits.equals("7")) { //$NON-NLS-1$ - return SerialPort.DATABITS_7; - } else { - return SerialPort.DATABITS_8; - } - } - - public void setDataBits(String strDataBits) { - fDataBits = strDataBits; - } - - public String getStopBitsString() { - return fStopBits; - } - - public int getStopBits() { - if (fStopBits.equals("1_5")) { //$NON-NLS-1$ - return SerialPort.STOPBITS_1_5; - } else if (fStopBits.equals("2")) { //$NON-NLS-1$ - return SerialPort.STOPBITS_2; - } else { // 1 - return SerialPort.STOPBITS_1; - } - } - - public void setStopBits(String strStopBits) { - fStopBits = strStopBits; - } - - public String getParityString() { - return fParity; - } - - public int getParity() { - if (fParity.equals("Even")) //$NON-NLS-1$ - { - return SerialPort.PARITY_EVEN; - } else if (fParity.equals("Odd")) //$NON-NLS-1$ - { - return SerialPort.PARITY_ODD; - } else if (fParity.equals("Mark")) //$NON-NLS-1$ - { - return SerialPort.PARITY_MARK; - } else if (fParity.equals("Space")) //$NON-NLS-1$ - { - return SerialPort.PARITY_SPACE; - } else // None - { - return SerialPort.PARITY_NONE; - } - } - - public void setParity(String strParity) { - fParity = strParity; - } - - public String getFlowControlString() { - return fFlowControl; - } - - public int getFlowControl() { - if (fFlowControl.equals("RTS/CTS")) //$NON-NLS-1$ - { - return SerialPort.FLOWCONTROL_RTSCTS_IN; - } else if (fFlowControl.equals("Xon/Xoff")) //$NON-NLS-1$ - { - return SerialPort.FLOWCONTROL_XONXOFF_IN; - } else // None - { - return SerialPort.FLOWCONTROL_NONE; - } - } - - public void setFlowControl(String strFlow) { - fFlowControl = strFlow; - } - - public String getSummary() { - return getSerialPort() + ", " + //$NON-NLS-1$ - getBaudRateString() + ", " + //$NON-NLS-1$ - getDataBitsString() + ", " + //$NON-NLS-1$ - getStopBitsString() + ", " + //$NON-NLS-1$ - getParityString() + ", " + //$NON-NLS-1$ - getFlowControlString(); - } - - public void load(ISettingsStore store) { - fSerialPort = store.get("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$ - fBaudRate = store.get("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$ - fDataBits = store.get("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$ - fStopBits = store.get("StopBits", fProperties.getDefaultStopBits());//$NON-NLS-1$ - fParity = store.get("Parity", fProperties.getDefaultParity());//$NON-NLS-1$ - fFlowControl = store.get("FlowControl", fProperties.getDefaultFlowControl());//$NON-NLS-1$ - fTimeout = store.get("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$ - } - - public void save(ISettingsStore store) { - store.put("SerialPort", fSerialPort); //$NON-NLS-1$ - store.put("BaudRate", fBaudRate); //$NON-NLS-1$ - store.put("DataBits", fDataBits); //$NON-NLS-1$ - store.put("StopBits", fStopBits); //$NON-NLS-1$ - store.put("Parity", fParity); //$NON-NLS-1$ - store.put("FlowControl", fFlowControl); //$NON-NLS-1$ - } - - public SerialProperties getProperties() { - return fProperties; - } - - public int getTimeout() { - try { - return Integer.parseInt(fTimeout); - } catch (NumberFormatException numberFormatException) { - return 10; - } - } - public String getTimeoutString() { - return fTimeout; - } - - public void setTimeout(String timeout) { - fTimeout = timeout; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettingsPage.java deleted file mode 100644 index 5646bbfafe2..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialSettingsPage.java +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalSettingsDlg - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.serial; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage; - -public class SerialSettingsPage extends AbstractSettingsPage { - private Combo fSerialPortCombo; - private Combo fBaudRateCombo; - private Combo fDataBitsCombo; - private Combo fStopBitsCombo; - private Combo fParityCombo; - private Combo fFlowControlCombo; - private Text fTimeout; - private final SerialSettings fTerminalSettings; - - public SerialSettingsPage(SerialSettings settings) { - fTerminalSettings=settings; - } - public void saveSettings() { - fTerminalSettings.setSerialPort(getComboValue(fSerialPortCombo)); - fTerminalSettings.setBaudRate(getComboValue(fBaudRateCombo)); - fTerminalSettings.setDataBits(getComboValue(fDataBitsCombo)); - fTerminalSettings.setStopBits(getComboValue(fStopBitsCombo)); - fTerminalSettings.setParity(getComboValue(fParityCombo)); - fTerminalSettings.setFlowControl(getComboValue(fFlowControlCombo)); - fTerminalSettings.setTimeout(fTimeout.getText()); - } - public void loadSettings() { - // Load controls - SerialProperties properties = fTerminalSettings.getProperties(); - List list; - - list = properties.getSerialPortTable(); - loadCombo(fSerialPortCombo, list); - - list = properties.getBaudRateTable(); - loadCombo(fBaudRateCombo, list); - - list = properties.getDataBitsTable(); - loadCombo(fDataBitsCombo, list); - - list = properties.getStopBitsTable(); - loadCombo(fStopBitsCombo, list); - - list = properties.getParityTable(); - loadCombo(fParityCombo, list); - - list = properties.getFlowControlTable(); - loadCombo(fFlowControlCombo, list); - - setCombo(fSerialPortCombo,fTerminalSettings.getSerialPort()); - setCombo(fBaudRateCombo,fTerminalSettings.getBaudRateString()); - setCombo(fDataBitsCombo,fTerminalSettings.getDataBitsString()); - setCombo(fStopBitsCombo,fTerminalSettings.getStopBitsString()); - setCombo(fParityCombo,fTerminalSettings.getParityString()); - setCombo(fFlowControlCombo,fTerminalSettings.getFlowControlString()); - fTimeout.setText(fTerminalSettings.getTimeoutString()); - } - private void setCombo(Combo combo,String value) { - if(value==null) - return; - int nIndex = combo.indexOf(value); - if (nIndex == -1) { - if((combo.getStyle() & SWT.READ_ONLY)==0) { - combo.add(value); - nIndex = combo.indexOf(value); - } else { - return; - } - } - - combo.select(nIndex); - - } - private String getComboValue(Combo combo) { - int nIndex = combo.getSelectionIndex(); - if (nIndex == -1) { - if((combo.getStyle() & SWT.READ_ONLY)!=0) - return ""; //$NON-NLS-1$ - return combo.getText(); - } - - return combo.getItem(nIndex); - - } - public boolean validateSettings() { - try { - int p = Integer.parseInt(fTimeout.getText().trim()); - if (p < 0) { - return false; - } - } catch (Exception e) { - return false; - } - return true; - } - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(2, false); - - composite.setLayout(gridLayout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fSerialPortCombo=addLabeledCombo(composite, SerialMessages.PORT + ":",false); //$NON-NLS-1$ - fBaudRateCombo=addLabeledCombo(composite, SerialMessages.BAUDRATE + ":"); //$NON-NLS-1$ - fDataBitsCombo=addLabeledCombo(composite, SerialMessages.DATABITS + ":"); //$NON-NLS-1$ - fStopBitsCombo=addLabeledCombo(composite, SerialMessages.STOPBITS + ":"); //$NON-NLS-1$ - fParityCombo=addLabeledCombo(composite, SerialMessages.PARITY + ":"); //$NON-NLS-1$ - fFlowControlCombo=addLabeledCombo(composite, SerialMessages.FLOWCONTROL + ":"); //$NON-NLS-1$ - - new Label(composite, SWT.RIGHT).setText(SerialMessages.TIMEOUT + ":"); //$NON-NLS-1$ - fTimeout = new Text(composite, SWT.BORDER); - fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fTimeout.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - fireListeners(fTimeout); - } - }); - loadSettings(); - } - - private Combo addLabeledCombo(Composite composite, String label) { - return addLabeledCombo(composite, label, true); - } - private Combo addLabeledCombo(Composite composite, String label,boolean readonly) { - new Label(composite, SWT.RIGHT).setText(label); - int flags=SWT.DROP_DOWN; - if(readonly) - flags|=SWT.READ_ONLY; - final Combo combo = new Combo(composite, flags); - combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - if (!readonly) { - combo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - fireListeners(combo); - } - }); - } - combo.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - fireListeners(combo); - } - }); - return combo; - } - - private void loadCombo(Combo ctlCombo, List table) { - for (Iterator iter = table.iterator(); iter.hasNext();) { - String label = (String) iter.next(); - ctlCombo.add(label); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/tm32.png b/terminal/plugins/org.eclipse.tm.terminal.serial/tm32.png deleted file mode 100644 index 3077b1220dd688632a42e347f90c90cb319835f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1q%}g3C{W4d;kClbxA})R9M5U zmtBlqRTam7``mNyow+m9DJ}i5)G6{^3K#>^Vu&CQ#25t%2}(?iH8BDb9!z*JrVsFh z@e3LvhL{Kv6&e(ZZ)if17NZ?PrfJJZm6}reF`b#tow*<9p1t>4%ZGFBbV`tz;J(?} z=bU@*`LFd~|FzcM4#3Q6z#z~l*8!jkB!B_|=m8nf1v2NH=VQkB=5YtO@*N3KF-ROF zR(zp=q-K_upd-L=IU7KIi2->D+y*M8(dwLw{{q61)R6vooD^;e)x0^M!1A=!8p;O?QUo+WFjz`#zY=vf#Y$%xB%% zJ;odRgoJJe&JtltX`T zEF?+dmT&vkw(+f7w|;Hy+O<~zOixcAyzTbe9!Ob?5%rS()xhPzC1$oPbo@~4g~4Dj zB?%`x#%v}SkT^#_;LbU4Wpr_4E~$TC{bk>|?9!oUckFoZhSjTAZ(6FAX0v$)sHGoL zYOU17a^NE897!d?YALOXkP}L@5(h)Ae{Yy6h69Rga3co}&V2XLM_=f!TGf4g-MV#a z@4ox)yS(?^?c2Bi*3?2$yb&#@2YR9F8=>Qgc_4_ADTJWJpol0UhKLn^R72DX15^tm zObbQ;=U~^a*BVbfwRcOq-EITy+`04D?;ksM+MtsHvCQ)vm~Wq27z>%dsya|b(hA*Z z%+L4e<$*kp^m;;`3o#1b3nGfCp(Qw`B^w49uB-;C_02cm{H3c7A3prrFP?bfRWqA2 zvxT(pHPFpwJB`+f=2t7#3VALxNeDsdWuXvS*OT=;Suc?F0(ohGl;Em@s(=-QI%hbH z#5o>(@Ec6e%s1}8|AF77sm)?G2ekSIWI+4OzfON$RU0bGR4dX0M3i1Hl65_;R!+N} z)9vK+a>4sR6eUJQC1M&elf^Lf^>XX2H?U>PCboV1VX|!5*5Tpq4-A`k&~av#KJw#V zhBd3s!?_}^l%>U)VdvDj;x0{7PEF16_PZ@{?=jOC-FJp0^>EHvAQ2qHqOHS~pn zf&6J86s6US8A&*tSE-7SM8!owq*x=EfT|!t`AoN<*9SqwBhe!gPzwwV4KX@8LbX<< zu0ms|!N!dj@Zt*-s3;NzGrb=86`*OK+H|1C;PN_1Bt}7_fEN%UjfGKZ6bMSCUI7cl z*h4~(7;{uSCIuU^1suzqtP8BB4bDHW}f21TQy zLD3kIP^2AEa6V%78jvl5OY9-yiQ)-i1=FWz2|g#ORA{$5?B0E-02k?t)11R5_DvK9 zNE9l|ps~CHk|4p5Xt)TKsH8!mWW{?y>WYdGVy~pXm=|tX#Z5O}&5p-+vVPq#BO`SV z95_aEu8oRfl!Z!_iG34BzrBVKaaBl1D_Art(I6Tc4T%m36)aY8(WnO_srLvW5Pjjf zYGBjG_0;MKKmFP7$$J?GXPc-hq7hRm%X2@y&gNBm-R5x@V?aeoD~_b%u$o~8Dv*eh z27~C(2q6HqoY*ZjAb~AgE+hJ!S6-PQ?`6agFf&91Q$8&PR-*Ff}mVXurq3_k5WrpZpVZb4|R@i6Nk>MPE<>XNxhnb9$cb zS~S3nszjmYd(_+#n0}8h_J3t(EAHE|%NyCd?Ec9~g7?G_5GhjZ9I;UrFsEhzHq30- z)YP7%XG7o^@WC@QJjCeeC}xKD#fGlBdiET2|hKocmGlYQs>;TL}6xnhPg9mFgr_m;vBf5BMuG@@bW)i<}Z~=YAb7~ zT2Wfd_N&<9UH}ZN54x!QSEr_4fB3_yN-=AM5LmNj4Qtn~#mwk*Isgn04bzHk{ylw+ zS6+UN=bm|vOTTwLkfRtPvGf`Y0W;JThZP??D>?_;K1$XpiK~U+IXyj1mSq?ad_YXt zqx(5He}tL#JoQ8KI0xS6{VmRiC@-ikB;0300e$GBJU<%(gBXQov$^Q`d~2R(_P>Cx zti$>NFo+TXhlt=@ike|oHWz1Q=JZzu>}lYksj1hGeq3UwII<8u8^*@iFt&jtar|)S zBOKlJHXCoe27hH0r;hViuI8j3r7<`}({e_J2K{|^-SoG~ci&_0=vP=1jFsVksT6ne96s zxS3BlQZrpR@4Qie^3P3q7gA}LOLR}O4_8I@@@gLG4Gxh^{y7T}5002ovPDHLkV1l5)GaLW_ diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/.classpath b/terminal/plugins/org.eclipse.tm.terminal.ssh/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.ssh/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/.project b/terminal/plugins/org.eclipse.tm.terminal.ssh/.project deleted file mode 100644 index f5d184b60cc..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.tm.terminal.ssh - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94637dfe13b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,61 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 0b831f584d6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Dec 07 03:43:08 CET 2006 -eclipse.preferences.version=1 -internal.default.compliance=user diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF deleted file mode 100644 index 4f15d9c50aa..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true -Bundle-Version: 2.1.400.qualifier -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.tm.terminal;bundle-version="3.3.0", - com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)", - org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)" -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.tm.internal.terminal.ssh;x-internal:=true -Bundle-Activator: org.eclipse.tm.internal.terminal.ssh.Activator -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.html b/terminal/plugins/org.eclipse.tm.terminal.ssh/about.html deleted file mode 100644 index a603d19ab21..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.ini b/terminal/plugins/org.eclipse.tm.terminal.ssh/about.ini deleted file mode 100644 index 3adc27ab587..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=tm32.png - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (not translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.properties b/terminal/plugins/org.eclipse.tm.terminal.ssh/about.properties deleted file mode 100644 index fb375e542d8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber - initial API and implementation -################################################################################ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. -# -# Do not translate any values surrounded by {} - -blurb=Target Management Terminal SSH Connector\n\ -\n\ -Version: {featureVersion}\n\ -\n\ -(c) Copyright Wind River Systems, Inc. and others 2000, 2015. All rights reserved.\n\ -Visit http://www.eclipse.org/tm diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/build.properties b/terminal/plugins/org.eclipse.tm.terminal.ssh/build.properties deleted file mode 100644 index 16dffd1f71c..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Michael Scharf (Wind River) - initial API and implementation -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - about.html,\ - about.ini,\ - about.properties,\ - tm32.png -src.includes = about.html diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.properties deleted file mode 100644 index 26549b67b9b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber (Wind River) - initial API and implementation -############################################################################### -pluginName = Target Management Terminal SSH Connector -providerName = Eclipse TM Project -sshConnection = SSH \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.xml deleted file mode 100644 index f6f2a6f5b79..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/plugin.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml deleted file mode 100644 index a6f6a2a7cf4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal.ssh - 2.1.400.qualifier - eclipse-plugin - diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/Activator.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/Activator.java deleted file mode 100644 index 990e40f674e..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/Activator.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API - * - copied code from org.eclipse.team.cvs.ssh2/CVSSSH2Plugin (Copyright IBM) - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import org.eclipse.core.runtime.Plugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jsch.core.IJSchService; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - public static final String PLUGIN_ID = "org.eclipse.tm.terminal.ssh"; //$NON-NLS-1$ - private static Activator plugin; - - // ServiceTracker for IJschService - private ServiceTracker tracker; - - /** - * The constructor - */ - public Activator() { - super(); - plugin = this; - } - - //--------------------------------------------------------------------------- - // - //--------------------------------------------------------------------------- - - public void start(BundleContext context) throws Exception { - super.start(context); - tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null); - tracker.open(); - } - - public void stop(BundleContext context) throws Exception { - try { - SshConnection.shutdown(); - tracker.close(); - } finally { - plugin = null; - super.stop(context); - } - } - - /** - * Returns an instance of IJSchService from the OSGi Registry. - * @return An instance of IJSchService, or null if no - * IJschService service is available. - */ - public IJSchService getJSchService() { - return (IJSchService)tracker.getService(); - } - - //--------------------------------------------------------------------------- - // - //--------------------------------------------------------------------------- - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path. - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshConstants.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshConstants.java deleted file mode 100644 index 9ceb3314f6b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Martin Oberhuber (Wind River) - extracted from various team.cvs plugins - * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - - -/** - * Defines the constants used by the terminal.ssh Plugin - */ -public interface ISshConstants { - - // These are from cvs.ui.IHelpContextIds - public static final String CVSUIPREFIX = "org.eclipse.team.cvs.ui."; //$NON-NLS-1$ - public static final String HELP_USER_VALIDATION_DIALOG = CVSUIPREFIX + "user_validation_dialog_context"; //$NON-NLS-1$ - public static final String HELP_KEYBOARD_INTERACTIVE_DIALOG = CVSUIPREFIX + "keyboard_interactive_dialog_context"; //$NON-NLS-1$ - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java deleted file mode 100644 index 28284ec2a19..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/ISshSettings.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public interface ISshSettings { - /** - * Get the host name or IP address of remote system to connect. - * @return host name or IP address of the remote system. - */ - String getHost(); - - /** - * Get the login name for connecting to the remote system. - * @return remote login name - */ - String getUser(); - - /** - * Get the password for connecting to the remote system. - * May be empty if connecting via SSH public key authentication - * (with or without passphrase). - * @return password to use - */ - String getPassword(); - - /** - * Get the timeout (in seconds) after which the SSH connection is assumed dead. - * @return timeout (in seconds) for the SSH connection. - */ - int getTimeout(); - - /** - * Get the keepalive interval (in seconds). - * After this time of inactivity, the SSH connector will send a message to the - * remote system in order to avoid timeouts on the remote. A maximum of 6 - * keepalive messages will be sent if enabled. When set to 0, the keepalive - * feature is disabled. - * @return interval (in seconds) for keepalive messages. - */ - int getKeepalive(); - - /** - * Get the TCP/IP port on the remote system to use. - * @return TCP/IP port on the remote system to use. - */ - int getPort(); - - /** - * Return a human-readable String summarizing all relevant connection data. - * This String can be displayed in the Terminal caption, for instance. - * @return a human-readable String summarizing relevant connection data. - */ - String getSummary(); - - /** - * Load connection data from a settings store. - * @param store the settings store to access. - */ - void load(ISettingsStore store); - - /** - * Store connection data into a settings store. - * @param store the settings store to access. - */ - void save(ISettingsStore store); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/KeyboardInteractiveDialog.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/KeyboardInteractiveDialog.java deleted file mode 100644 index 760ef83afc3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/KeyboardInteractiveDialog.java +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation. - * IBM Corporation - ongoing maintenance - * Martin Oberhuber (Wind River) - copied and adapted from team.cvs.ui - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.TrayDialog; -import org.eclipse.jface.window.Window; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; - -/** - * A dialog for keyboad-interactive authentication for the ssh2 connection. - */ -public class KeyboardInteractiveDialog extends TrayDialog { - // widgets - private Text[] texts; - - protected String domain; - protected String destination; - protected String name; - protected String instruction; - protected String lang; - protected String[] prompt; - protected boolean[] echo; - private String message; - private String[] result; - - /** - * Creates a nwe KeyboardInteractiveDialog. - * - * @param parentShell the parent shell - * @param connectionId an id for the connection - * @param destination the location - * @param name the name - * @param instruction the instruction - * @param prompt the titles for textfields - * @param echo '*' should be used or not - */ - public KeyboardInteractiveDialog(Shell parentShell, - String connectionId, - String destination, - String name, - String instruction, - String[] prompt, - boolean[] echo){ - super(parentShell); - this.domain=connectionId; - this.destination=destination; - this.name=name; - this.instruction=instruction; - this.prompt=prompt; - this.echo=echo; - this.message=NLS.bind(SshMessages.KeyboardInteractiveDialog_message, new String[] { destination+(name!=null && name.length()>0 ? ": "+name : "") }); //NON-NLS-1$ //$NON-NLS-1$ //$NON-NLS-2$ - } - /** - * @see Window#configureShell - */ - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(message); - } - /** - * @see Window#create - */ - public void create() { - super.create(); - if(texts.length>0){ - texts[0].setFocus(); - } - } - /** - * @see Dialog#createDialogArea - */ - protected Control createDialogArea(Composite parent) { - Composite main=new Composite(parent, SWT.NONE); - GridLayout layout=new GridLayout(); - layout.numColumns=3; - main.setLayout(layout); - main.setLayoutData(new GridData(GridData.FILL_BOTH)); - - // set F1 help - PlatformUI.getWorkbench().getHelpSystem().setHelp(main, ISshConstants.HELP_KEYBOARD_INTERACTIVE_DIALOG); - - if (message!=null) { - Label messageLabel=new Label(main, SWT.WRAP); - messageLabel.setText(message); - GridData data=new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan=3; - messageLabel.setLayoutData(data); - } - if(domain!=null){ - Label label = new Label(main, SWT.WRAP); - label.setText(NLS.bind(SshMessages.KeyboardInteractiveDialog_labelConnection, new String[] { domain })); - GridData data=new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan=3; - label.setLayoutData(data); - } - if (instruction!=null && instruction.length()>0) { - Label messageLabel=new Label(main, SWT.WRAP); - messageLabel.setText(instruction); - GridData data=new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan=3; - messageLabel.setLayoutData(data); - } - createPasswordFields(main); - return main; - } - /** - * Creates the widgets that represent the entry area. - * - * @param parent the parent of the widgets - */ - protected void createPasswordFields(Composite parent) { - texts=new Text[prompt.length]; - - for(int i=0; i - * The default implementation of this framework method sets - * this dialog's return code to Window.OK - * and closes the dialog. Subclasses may override. - *

- */ - 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. - *

- */ - protected void cancelPressed() { - result=null; - super.cancelPressed(); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java deleted file mode 100644 index 8bf6f2879d7..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java +++ /dev/null @@ -1,367 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API - * - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM) - * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected - * Mikhail Kalugin - [201864] Fix Terminal SSH keyboard interactive authentication - * Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection - * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives - * Martin Oberhuber (Wind River) - [225792] Rename SshConnector.getTelnetSettings() to getSshSettings() - * Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox - * Martin Oberhuber (Wind River) - [205674][ssh] Terminal remains "connecting" when authentication is cancelled - * Michael Scharf (Wind River) - 240420: [terminal][ssh]Channel is not closed when the connection is closed with the close button - * Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting - * Andrei Sobolev (Xored) - [250456] Ssh banner message causes IllegalArgumentException popup - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InterruptedIOException; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.jface.window.Window; -import org.eclipse.jsch.core.IJSchService; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -import com.jcraft.jsch.ChannelShell; -import com.jcraft.jsch.JSchException; -import com.jcraft.jsch.Session; -import com.jcraft.jsch.UIKeyboardInteractive; -import com.jcraft.jsch.UserInfo; - -class SshConnection extends Thread { - private static int fgNo; - private final ITerminalControl fControl; - private final SshConnector fConn; - private Session fSession; - private boolean fDisconnectHasBeenCalled; - protected SshConnection(SshConnector conn,ITerminalControl control) { - super("SshConnection-"+fgNo++); //$NON-NLS-1$ - fControl = control; - fConn = conn; - fControl.setState(TerminalState.CONNECTING); - } - - //---------------------------------------------------------------------- - // - //---------------------------------------------------------------------- - - /** - * Create a Jsch session. - * Subclasses can override in order to replace the UserInfo wrapper - * (for non-interactive usage, for instance), or in order to change - * the Jsch config (for instance, in order to switch off strict - * host key checking or in order to add specific ciphers). - */ - protected Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException { - IJSchService service = Activator.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; - } - - static void shutdown() { - //TODO: Store all Jsch sessions in a pool and disconnect them on shutdown - } - - //---------------------------------------------------------------------- - // - //---------------------------------------------------------------------- - - public void run() { - boolean connectSucceeded = false; - String host = ""; //$NON-NLS-1$ - int port = 22; - try { - int nTimeout = fConn.getSshSettings().getTimeout() * 1000; - int nKeepalive = fConn.getSshSettings().getKeepalive() * 1000; - host = fConn.getSshSettings().getHost(); - String user = fConn.getSshSettings().getUser(); - String password = fConn.getSshSettings().getPassword(); - port = fConn.getSshSettings().getPort(); - - ////Giving a connectionId could be the index into a local - ////Store where passwords are stored - //String connectionId = host; - //if (port!=22) { - // connectionId += ':' + port; - //} - //UserInfo ui=new MyUserInfo(connectionId, user, password); - UserInfo ui=new MyUserInfo(null, user, password); - - Session session = createSession(user, password, host, port, - ui, new NullProgressMonitor()); - synchronized (this) { - fSession = session; - } - - //java.util.Hashtable config=new java.util.Hashtable(); - //config.put("StrictHostKeyChecking", "no"); - //session.setConfig(config); - //ui.aboutToConnect(); - if (nKeepalive > 0) { - session.setServerAliveInterval(nKeepalive); //default is 5 minutes - } - // dont try to connect if disconnect has been requested already - synchronized (this) { - if (fDisconnectHasBeenCalled) - return; - } - - session.connect(nTimeout); // making connection with timeout. - // if we got disconnected, do not continue - if(!isSessionConnected()) - return; - ChannelShell channel=(ChannelShell) session.openChannel("shell"); //$NON-NLS-1$ - channel.setPtyType("xterm"); //$NON-NLS-1$ - // TERM=xterm implies VT100 line wrapping mode - fControl.setVT100LineWrapping(true); - channel.connect(); - - // maybe the terminal was disconnected while we were connecting - if (isSessionConnected() && channel.isConnected()) { - connectSucceeded = true; - fConn.setInputStream(channel.getInputStream()); - fConn.setOutputStream(channel.getOutputStream()); - fConn.setChannel(channel); - fControl.setState(TerminalState.CONNECTED); - try { - // read data until the connection gets terminated - readDataForever(fConn.getInputStream()); - } catch (InterruptedIOException e) { - // we got interrupted: we are done... - } - } - } catch (Exception e) { - Throwable cause = e; - while (cause.getCause() != null) { - cause = cause.getCause(); - } - String origMsg = cause.getMessage(); - String msg = SshMessages.getMessageFor(cause); - if ((cause instanceof JSchException) && origMsg != null && origMsg.startsWith("Auth")) { //$NON-NLS-1$ - if (origMsg.indexOf("cancel") >= 0) { //$NON-NLS-1$ - msg = SshMessages.SSH_AUTH_CANCEL; - } else if (origMsg.indexOf("fail") >= 0) { //$NON-NLS-1$ - msg = SshMessages.SSH_AUTH_FAIL; - } - } - if (!connectSucceeded) { - String hostPort = host; - if (port != 22) { - hostPort = hostPort + ':' + port; - } - msg = NLS.bind(SshMessages.ERROR_CONNECTING, hostPort, msg); - } - connectFailed(msg, msg); - } finally { - // make sure the terminal is disconnected when the thread ends - try { - disconnect(); - } finally { - // when reading is done, we set the state to closed - fControl.setState(TerminalState.CLOSED); - } - } - } - - private synchronized boolean isSessionConnected() { - return !fDisconnectHasBeenCalled && fSession != null && fSession.isConnected(); - } - - /** - * disconnect the ssh session - */ - void disconnect() { - interrupt(); - synchronized (this) { - fDisconnectHasBeenCalled=true; - if(fSession!=null) { - try { - fSession.disconnect(); - } catch (Exception e) { - // Ignore NPE due to bug in JSch if disconnecting - // while not yet authenticated - } - fSession=null; - } - } - } - /** - * Read the data from the ssh connection and display it in the terminal. - * @param in - * @throws IOException - */ - private void readDataForever(InputStream in) throws IOException { - // read the data - byte bytes[]=new byte[32*1024]; - int n; - // read until the thread gets interrupted.... - while( (n=in.read(bytes))!=-1) { - fControl.getRemoteToTerminalOutputStream().write(bytes,0,n); - } - } - - protected static Display getStandardDisplay() { - Display display = Display.getCurrent(); - if( display==null ) { - display = Display.getDefault(); - } - return display; - } - - private class MyUserInfo implements UserInfo, UIKeyboardInteractive { - private final String fConnectionId; - private 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; - } - public String getPassword() { - return fPassword; - } - 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() { - public void run() { - // [168197] Replace JFace MessagDialog by SWT MessageBox - //retval[0] = MessageDialog.openQuestion(null, SshMessages.WARNING, str); - if (isSessionConnected()) { - MessageBox mb = new MessageBox(fControl.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO); - mb.setText(SshMessages.WARNING); - mb.setMessage(str); - retval[0] = (mb.open() == SWT.YES); - } else { - retval[0] = false; - } - } - }); - return retval[0]; - } - private String promptSecret(final String message) { - final String[] retval = new String[1]; - getStandardDisplay().syncExec(new Runnable() { - public void run() { - if (isSessionConnected()) { - UserValidationDialog uvd = new UserValidationDialog(null, fConnectionId, fUser, message); - uvd.setUsernameMutable(false); - if (uvd.open() == Window.OK) { - retval[0] = uvd.getPassword(); - } else { - retval[0] = null; - } - } else { - retval[0] = null; - } - } - }); - return retval[0]; - } - public String getPassphrase() { - return fPassphrase; - } - public boolean promptPassphrase(String message) { - fPassphrase = promptSecret(message); - return (fPassphrase!=null); - } - public boolean promptPassword(final String message) { - String _password = promptSecret(message); - if (_password!=null) { - fPassword=_password; - return true; - } - return false; - } - public void showMessage(final String message) { - Display.getDefault().syncExec(new Runnable() { - public void run() { - // [168197] Replace JFace MessagDialog by SWT MessageBox - // MessageDialog.openInformation(null, SshMessages.INFO, message); - if (isSessionConnected()) { - MessageBox mb = new MessageBox(fControl.getShell(), SWT.ICON_INFORMATION | SWT.OK); - mb.setText(SshMessages.INFO); - mb.setMessage(message); - mb.open(); - } - } - }); - } - 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() { - public void run() { - if (isSessionConnected()) { - KeyboardInteractiveDialog dialog = new KeyboardInteractiveDialog(null, fConnectionId, destination, name, instruction, prompt, echo); - dialog.open(); - finResult[0] = dialog.getResult(); - } else { - finResult[0] = null; // indicate cancel to JSch - } - } - }); - String[] result=finResult[0]; - if (result == null) - return null; // cancelled - if (result.length == 1 && prompt.length == 1 && prompt[0].trim().equalsIgnoreCase("password:")) { //$NON-NLS-1$ - fPassword = result[0]; - } - fAttemptCount++; - return result; - } - catch(OperationCanceledException e){ - return null; - } - } - } - - private void connectFailed(String terminalText, String msg) { - Logger.log(terminalText); - fControl.displayTextInTerminal(terminalText); - // fControl.setMsg(msg); - } - -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java deleted file mode 100644 index eefbba23de5..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnector.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [225792] Rename SshConnector.getTelnetSettings() to getSshSettings() - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -import com.jcraft.jsch.ChannelShell; -import com.jcraft.jsch.JSch; - -public class SshConnector extends TerminalConnectorImpl { - private OutputStream fOutputStream; - private InputStream fInputStream; - private JSch fJsch; - private ChannelShell fChannel; - private SshConnection fConnection; - private final SshSettings fSettings; - private int fWidth; - private int fHeight; - public SshConnector() { - this(new SshSettings()); - } - public SshConnector(SshSettings settings) { - fSettings=settings; - } - public void initialize() throws Exception { - fJsch=new JSch(); - } - public void connect(ITerminalControl control) { - super.connect(control); - fConnection = new SshConnection(this,control); - fConnection.start(); - } - synchronized public void doDisconnect() { - fConnection.disconnect(); - if (getInputStream() != null) { - try { - getInputStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - if (getTerminalToRemoteStream() != null) { - try { - getTerminalToRemoteStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - } - public void setTerminalSize(int newWidth, int newHeight) { - if(fChannel!=null && (newWidth!=fWidth || newHeight!=fHeight)) { - //avoid excessive communications due to change size requests by caching previous size - fChannel.setPtySize(newWidth, newHeight, 8*newWidth, 8*newHeight); - fWidth=newWidth; - fHeight=newHeight; - } - } - public InputStream getInputStream() { - return fInputStream; - } - public OutputStream getTerminalToRemoteStream() { - return fOutputStream; - } - void setInputStream(InputStream inputStream) { - fInputStream = inputStream; - } - void setOutputStream(OutputStream outputStream) { - fOutputStream = outputStream; - } - /** - * Return the SSH Settings. - * - * @return the settings for a concrete connection. - * @since org.eclipse.tm.terminal.ssh 2.0 renamed from getTelnetSettings() - */ - public ISshSettings getSshSettings() { - return fSettings; - } - public ISettingsPage makeSettingsPage() { - return new SshSettingsPage(fSettings); - } - public String getSettingsSummary() { - return fSettings.getSummary(); - } - public void load(ISettingsStore store) { - fSettings.load(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; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.java deleted file mode 100644 index 73a0092dff9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives - * Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting (Adopting code from org.eclipse.team.cvs.core) - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import java.lang.reflect.Field; - -import org.eclipse.osgi.util.NLS; - -public class SshMessages extends NLS { - static { - NLS.initializeMessages(SshMessages.class.getName(), SshMessages.class); - } - public static String USER; - public static String HOST; - public static String PORT; - public static String PASSWORD; - public static String TIMEOUT; - public static String KEEPALIVE; - public static String KEEPALIVE_Tooltip; - public static String WARNING; - public static String INFO; - - //These are from org.eclipse.team.cvs.ui.CVSUIMessages - public static String UserValidationDialog_required; - public static String UserValidationDialog_labelUser; - public static String UserValidationDialog_labelPassword; - public static String UserValidationDialog_password; - public static String UserValidationDialog_user; - public static String UserValidationDialog_5; - public static String UserValidationDialog_6; - public static String UserValidationDialog_7; - - public static String KeyboardInteractiveDialog_message; - public static String KeyboardInteractiveDialog_labelConnection; - - public static String ERROR_CONNECTING; - public static String TerminalCommunicationException_io; - public static String SSH_AUTH_CANCEL; - public static String SSH_AUTH_FAIL; - public static String com_jcraft_jsch_JSchException; - public static String java_io_IOException; - public static String java_io_EOFException; - public static String java_io_InterruptedIOException; - public static String java_net_UnknownHostException; - public static String java_net_ConnectException; - public static String java_net_SocketException; - public static String java_net_NoRouteToHostException; - - // - - public static String getMessageFor(Throwable throwable) { - String message = getMessage(getMessageKey(throwable)); - if (message == null) { - message = NLS.bind(SshMessages.TerminalCommunicationException_io, (new Object[] { throwable.toString() })); - } else { - message = NLS.bind(message, (new Object[] { throwable.getMessage() })); - } - return message; - } - - private static String getMessageKey(Throwable t) { - String name = t.getClass().getName(); - name = name.replace('.', '_'); - return name; - } - - // - // - - public static String getMessage(String key) { - try { - Field f = SshMessages.class.getDeclaredField(key); - Object o = f.get(null); - if (o instanceof String) - return (String) o; - } catch (SecurityException e) { - } catch (NoSuchFieldException e) { - } catch (IllegalArgumentException e) { - } catch (IllegalAccessException e) { - } - return null; - } - - // - - } diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.properties b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.properties deleted file mode 100644 index 6d92e5020e4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshMessages.properties +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Michael Scharf (Wind River) - initial API and implementation -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -# Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives -# Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting (Adopting code from org.eclipse.team.cvs.core) -############################################################################### - -# NLS_MESSAGEFORMAT_VAR - -HOST = Host -USER = User -PORT = Port -PASSWORD = Password -TIMEOUT = Timeout (sec) -KEEPALIVE = KeepAlive (sec) -KEEPALIVE_Tooltip=Interval for sending keepalive messages in case of inactivity. Enter 0 to disable keepalives. -WARNING = Warning -INFO = Info - -#These are from cvs.ui/messages.properties -UserValidationDialog_required=Password Required -UserValidationDialog_labelUser={0} -UserValidationDialog_labelPassword={1} -UserValidationDialog_password=&Password: -UserValidationDialog_user=&User name: -UserValidationDialog_5=Connection: -UserValidationDialog_6=&Save password -UserValidationDialog_7=Saved passwords are stored on your computer in a file that is difficult, but not impossible, for an intruder to read. - -KeyboardInteractiveDialog_message=Keyboard Interactive authentication for {0} -KeyboardInteractiveDialog_labelConnection=Enter values for the following connection: {0} - -# from org.eclipse.team.cvs.core/messages.properties (c) IBM 2000, 2007 -ERROR_CONNECTING=Error connecting {0} : {1} -TerminalCommunicationException_io=Communication error: {0} -SSH_AUTH_CANCEL=SSH Authentication cancelled. -SSH_AUTH_FAIL=SSH Authentication failed. -com_jcraft_jsch_JSchException=SSH client error: {0} -java_io_IOException=I/O exception occurred: {0} -java_io_EOFException=End of file encountered: {0} -java_io_InterruptedIOException=I/O has been interrupted. -java_net_UnknownHostException=Cannot locate host: {0} -java_net_ConnectException=Cannot connect to host: {0} -java_net_SocketException=Socket Exception: {0} -java_net_NoRouteToHostException={0} -# from org.eclipse.team.cvs.core diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java deleted file mode 100644 index 9f7d40fee30..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettings.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Mikhail Kalugin - [201867] Improve Terminal SSH connection summary string - * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives - * Bryan Hunt - [313991] cannot programatically pass password to SshConnector - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -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; - public String getHost() { - return fHost; - } - - public void setHost(String strHost) { - fHost = strHost; - } - - public String getSummary() { - String settings = getUser()+'@'+getHost(); - if(getPort()!=22) { - settings += ':' + getPort(); - } - return settings; - } - - public void load(ISettingsStore store) { - fHost = store.get("Host");//$NON-NLS-1$ - fUser = store.get("User");//$NON-NLS-1$ - // ISettingsStore providers have to make sure that - // the password is not saved in some as plain text - // on disk. [bug 313991] - fPassword = store.get("Password");//$NON-NLS-1$ - fPort = store.get("Port");//$NON-NLS-1$ - fTimeout = store.get("Timeout");//$NON-NLS-1$ - fKeepalive = store.get("Keepalive");//$NON-NLS-1$ - } - - - public void save(ISettingsStore store) { - store.put("Host", fHost);//$NON-NLS-1$ - store.put("User", fUser);//$NON-NLS-1$ - store.put("Port", fPort);//$NON-NLS-1$ - // We do *not* store the password in the settings because - // this can cause the password to be stored as plain text - // in some settings file - store.put("Timeout", fTimeout);//$NON-NLS-1$ - store.put("Keepalive", fKeepalive);//$NON-NLS-1$ - } - - - public int getTimeout() { - try { - return Integer.parseInt(fTimeout); - } catch (NumberFormatException numberFormatException) { - return 10; - } - } - public String getTimeoutString() { - return fTimeout; - } - - public void setTimeout(String timeout) { - fTimeout = timeout; - } - - public int getKeepalive() { - try { - return Integer.parseInt(fKeepalive); - } catch (NumberFormatException numberFormatException) { - return 300; - } - } - public String getKeepaliveString() { - return fKeepalive; - } - - public void setKeepalive(String keepalive) { - fKeepalive = keepalive; - } - - public String getUser() { - return fUser; - } - - public void setUser(String user) { - fUser = user; - } - public int getPort() { - try { - return Integer.parseInt(fPort); - } catch (NumberFormatException numberFormatException) { - return 22; - } - } - - public String getPortString() { - return fPort; - } - - public void setPort(String port) { - fPort = port; - } - - public String getPassword() { - return fPassword; - } - - public void setPassword(String password) { - fPassword = password; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettingsPage.java deleted file mode 100644 index 625e96e271f..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshSettingsPage.java +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Johnson Ma (Wind River) - [218880] Add UI setting for ssh keepalives - * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.fieldassist.FieldDecorationRegistry; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage; - -public class SshSettingsPage extends AbstractSettingsPage { - private Text fHostText; - private Text fUser; - private Text fTimeout; - private Text fKeepalive; - private final SshSettings fTerminalSettings; - private Text fPort; - private Text fPassword; - - public SshSettingsPage(SshSettings settings) { - fTerminalSettings=settings; - } - public void saveSettings() { - fTerminalSettings.setHost(fHostText.getText()); - fTerminalSettings.setUser(fUser.getText()); - fTerminalSettings.setPassword(fPassword.getText()); - fTerminalSettings.setPort(fPort.getText()); - fTerminalSettings.setTimeout(fTimeout.getText()); - fTerminalSettings.setKeepalive(fKeepalive.getText()); - } - - 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(),"22"));//$NON-NLS-1$ - fPassword.setText(get(fTerminalSettings.getPassword(),""));//$NON-NLS-1$ - } - } - String get(String value, String def) { - if(value==null || value.length()==0) - return def; - return value; - } - public boolean validateSettings() { - String message = null; - int messageType = IMessageProvider.NONE; - boolean valid = true; - - if (fHostText.getText().trim().length() == 0) { - String m = "Please enter a host IP or name."; //$NON-NLS-1$ - int mt = IMessageProvider.INFORMATION; - updateControlDecoration(fHostText, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fHostText, null, IMessageProvider.NONE); - } - if (fUser.getText().trim().length() == 0) { - String m = "Please enter a username."; //$NON-NLS-1$ - int mt = IMessageProvider.INFORMATION; - updateControlDecoration(fUser, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fUser, null, IMessageProvider.NONE); - } - try { - int p = Integer.parseInt(fPort.getText().trim()); - if (p <= 0 || p > 65535) { - String m = "Invalid network port. Must be between 0 and 65535."; //$NON-NLS-1$ - int mt = IMessageProvider.ERROR; - updateControlDecoration(fPort, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fPort, null, IMessageProvider.NONE); - } - p = Integer.parseInt(fTimeout.getText().trim()); - if (p < 0) { - String m = "Invalid timeout. Must be greater than 0."; //$NON-NLS-1$ - int mt = IMessageProvider.ERROR; - updateControlDecoration(fTimeout, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fTimeout, null, IMessageProvider.NONE); - } - p = Integer.parseInt(fKeepalive.getText().trim()); - if (p < 0) { - String m = "Invalid keep alive. Must be greater than 0."; //$NON-NLS-1$ - int mt = IMessageProvider.ERROR; - updateControlDecoration(fKeepalive, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fKeepalive, null, IMessageProvider.NONE); - } - } catch (Exception e) { - valid = false; - } - - setMessage(message, messageType); - return valid; - } - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(2, false); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); - - composite.setLayout(gridLayout); - composite.setLayoutData(gridData); - - fHostText = createTextField(composite, SshMessages.HOST); - fUser = createTextField(composite, SshMessages.USER); - fPassword = createTextField(composite, SshMessages.PASSWORD,SWT.PASSWORD); - fTimeout = createTextField(composite, SshMessages.TIMEOUT); - fKeepalive = createTextField(composite, SshMessages.KEEPALIVE); - fKeepalive.setToolTipText(SshMessages.KEEPALIVE_Tooltip); - fPort = createTextField(composite, SshMessages.PORT); - loadSettings(); - } - private Text createTextField(Composite composite, String labelTxt, int textOptions) { - GridData gridData; - // Add label - Label ctlLabel = new Label(composite, SWT.RIGHT); - ctlLabel.setText(labelTxt + ":"); //$NON-NLS-1$ - - // Add control - gridData = new GridData(GridData.FILL_HORIZONTAL); - final Text text= new Text(composite, SWT.BORDER | textOptions); - text.setLayoutData(gridData); - text.addModifyListener(new ModifyListener() { - 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.ssh/src/org/eclipse/tm/internal/terminal/ssh/UserValidationDialog.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/UserValidationDialog.java deleted file mode 100644 index 993e772b550..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/UserValidationDialog.java +++ /dev/null @@ -1,277 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Martin Oberhuber (Wind River) - copied from org.eclipse.team.cvs.ui - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.ssh; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.TrayDialog; -import org.eclipse.jface.window.Window; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; - -/** - * A dialog for prompting for a username and password - */ -public class UserValidationDialog extends TrayDialog { - // widgets - protected Text usernameField; - protected Text passwordField; - protected Button allowCachingButton; - - protected String domain; - protected String defaultUsername; - protected String password = null; - protected boolean allowCaching = false; - protected Image keyLockImage; - - // whether or not the username can be changed - protected boolean isUsernameMutable = true; - protected String username = null; - protected String message = null; - - /** - * Creates a new UserValidationDialog. - * - * @param parentShell the parent shell - * @param location the location - * @param defaultName the default user name - * @param message a mesage to display to the user - */ - public UserValidationDialog(Shell parentShell, String location, String defaultName, String message) { - super(parentShell); - setShellStyle(getShellStyle() | SWT.RESIZE); - this.defaultUsername = defaultName; - this.domain = location; - this.message = message; - } - /** - * @see Window#configureShell - */ - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(SshMessages.UserValidationDialog_required); - // set F1 help - PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, ISshConstants.HELP_USER_VALIDATION_DIALOG); - } - /** - * @see Window#create - */ - public void create() { - super.create(); - // add some default values - usernameField.setText(defaultUsername); - - if (isUsernameMutable) { - // give focus to username field - usernameField.selectAll(); - usernameField.setFocus(); - } else { - usernameField.setEditable(false); - passwordField.setFocus(); - } - } - - /** - * @see Dialog#createDialogArea - */ - protected Control createDialogArea(Composite parent) { - Composite top = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - - top.setLayout(layout); - top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Composite imageComposite = new Composite(top, SWT.NONE); - layout = new GridLayout(); - imageComposite.setLayout(layout); - imageComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - - Composite main = new Composite(top, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 3; - main.setLayout(layout); - main.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label imageLabel = new Label(imageComposite, SWT.NONE); - //keyLockImage = TeamImages.getImageDescriptor(ITeamUIImages.IMG_KEY_LOCK).createImage(); - //imageLabel.setImage(keyLockImage); - GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); - imageLabel.setLayoutData(data); - - if (message != null) { - Label messageLabel = new Label(main, SWT.WRAP); - messageLabel.setText(message); - data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); - data.horizontalSpan = 3; - data.widthHint = 300; - messageLabel.setLayoutData(data); - } - if (domain != null) { - Label d = new Label(main, SWT.WRAP); - d.setText(SshMessages.UserValidationDialog_5); - data = new GridData(); - d.setLayoutData(data); - Label label = new Label(main, SWT.WRAP); - if (isUsernameMutable) { - label.setText(NLS.bind(SshMessages.UserValidationDialog_labelUser, new String[] { domain })); - } else { - label.setText(NLS.bind(SshMessages.UserValidationDialog_labelPassword, (new Object[]{defaultUsername, domain}))); - } - data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); - data.horizontalSpan = 2; - data.widthHint = 300; - label.setLayoutData(data); - } - createUsernameFields(main); - createPasswordFields(main); - - if(domain != null) { - allowCachingButton = new Button(main, SWT.CHECK); - allowCachingButton.setText(SshMessages.UserValidationDialog_6); - data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); - data.horizontalSpan = 3; - allowCachingButton.setLayoutData(data); - allowCachingButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - allowCaching = allowCachingButton.getSelection(); - } - }); - Composite warningComposite = new Composite(main, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginHeight = 0; - warningComposite.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 3; - warningComposite.setLayoutData(data); - Label warningLabel = new Label(warningComposite, SWT.NONE); - warningLabel.setImage(getImage(DLG_IMG_MESSAGE_WARNING)); - warningLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING)); - Label warningText = new Label(warningComposite, SWT.WRAP); - warningText.setText(SshMessages.UserValidationDialog_7); - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = 300; - warningText.setLayoutData(data); - } - - Dialog.applyDialogFont(parent); - - return main; - } - - /** - * Creates the three widgets that represent the password entry area. - * - * @param parent the parent of the widgets - */ - protected void createPasswordFields(Composite parent) { - new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_password); - - passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); - passwordField.setLayoutData(data); - } - /** - * Creates the three widgets that represent the user name entry area. - * - * @param parent the parent of the widgets - */ - protected void createUsernameFields(Composite parent) { - new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_user); - - usernameField = new Text(parent, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); - usernameField.setLayoutData(data); - } - - /** - * Returns the password entered by the user, or null - * if the user cancelled. - * - * @return the entered password - */ - public String getPassword() { - return password; - } - - /** - * Returns the username entered by the user, or null - * if the user cancelled. - * - * @return the entered username - */ - public String getUsername() { - return username; - } - - /** - * Returns true if the save password checkbox was selected. - * @return true if the save password checkbox was selected and false - * otherwise. - */ - public boolean getAllowCaching() { - return allowCaching; - } - - /** - * Notifies that the ok button of this dialog has been pressed. - *

- * The default implementation of this framework method sets - * this dialog's return code to Window.OK - * and closes the dialog. Subclasses may override. - *

- */ - protected void okPressed() { - password = passwordField.getText(); - username = usernameField.getText(); - - super.okPressed(); - } - /** - * Sets whether or not the username field should be mutable. - * This method must be called before create(), otherwise it - * will be ignored. - * - * @param value whether the username is mutable - */ - public void setUsernameMutable(boolean value) { - isUsernameMutable = value; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#close() - */ - public boolean close() { - if(keyLockImage != null) { - keyLockImage.dispose(); - } - return super.close(); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/tm32.png b/terminal/plugins/org.eclipse.tm.terminal.ssh/tm32.png deleted file mode 100644 index 3077b1220dd688632a42e347f90c90cb319835f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1q%}g3C{W4d;kClbxA})R9M5U zmtBlqRTam7``mNyow+m9DJ}i5)G6{^3K#>^Vu&CQ#25t%2}(?iH8BDb9!z*JrVsFh z@e3LvhL{Kv6&e(ZZ)if17NZ?PrfJJZm6}reF`b#tow*<9p1t>4%ZGFBbV`tz;J(?} z=bU@*`LFd~|FzcM4#3Q6z#z~l*8!jkB!B_|=m8nf1v2NH=VQkB=5YtO@*N3KF-ROF zR(zp=q-K_upd-L=IU7KIi2->D+y*M8(dwLw{{q61)R6vooD^;e)x0^M!1A=!8p;O?QUo+WFjz`#zY=vf#Y$%xB%% zJ;odRgoJJe&JtltX`T zEF?+dmT&vkw(+f7w|;Hy+O<~zOixcAyzTbe9!Ob?5%rS()xhPzC1$oPbo@~4g~4Dj zB?%`x#%v}SkT^#_;LbU4Wpr_4E~$TC{bk>|?9!oUckFoZhSjTAZ(6FAX0v$)sHGoL zYOU17a^NE897!d?YALOXkP}L@5(h)Ae{Yy6h69Rga3co}&V2XLM_=f!TGf4g-MV#a z@4ox)yS(?^?c2Bi*3?2$yb&#@2YR9F8=>Qgc_4_ADTJWJpol0UhKLn^R72DX15^tm zObbQ;=U~^a*BVbfwRcOq-EITy+`04D?;ksM+MtsHvCQ)vm~Wq27z>%dsya|b(hA*Z z%+L4e<$*kp^m;;`3o#1b3nGfCp(Qw`B^w49uB-;C_02cm{H3c7A3prrFP?bfRWqA2 zvxT(pHPFpwJB`+f=2t7#3VALxNeDsdWuXvS*OT=;Suc?F0(ohGl;Em@s(=-QI%hbH z#5o>(@Ec6e%s1}8|AF77sm)?G2ekSIWI+4OzfON$RU0bGR4dX0M3i1Hl65_;R!+N} z)9vK+a>4sR6eUJQC1M&elf^Lf^>XX2H?U>PCboV1VX|!5*5Tpq4-A`k&~av#KJw#V zhBd3s!?_}^l%>U)VdvDj;x0{7PEF16_PZ@{?=jOC-FJp0^>EHvAQ2qHqOHS~pn zf&6J86s6US8A&*tSE-7SM8!owq*x=EfT|!t`AoN<*9SqwBhe!gPzwwV4KX@8LbX<< zu0ms|!N!dj@Zt*-s3;NzGrb=86`*OK+H|1C;PN_1Bt}7_fEN%UjfGKZ6bMSCUI7cl z*h4~(7;{uSCIuU^1suzqtP8BB4bDHW}f21TQy zLD3kIP^2AEa6V%78jvl5OY9-yiQ)-i1=FWz2|g#ORA{$5?B0E-02k?t)11R5_DvK9 zNE9l|ps~CHk|4p5Xt)TKsH8!mWW{?y>WYdGVy~pXm=|tX#Z5O}&5p-+vVPq#BO`SV z95_aEu8oRfl!Z!_iG34BzrBVKaaBl1D_Art(I6Tc4T%m36)aY8(WnO_srLvW5Pjjf zYGBjG_0;MKKmFP7$$J?GXPc-hq7hRm%X2@y&gNBm-R5x@V?aeoD~_b%u$o~8Dv*eh z27~C(2q6HqoY*ZjAb~AgE+hJ!S6-PQ?`6agFf&91Q$8&PR-*Ff}mVXurq3_k5WrpZpVZb4|R@i6Nk>MPE<>XNxhnb9$cb zS~S3nszjmYd(_+#n0}8h_J3t(EAHE|%NyCd?Ec9~g7?G_5GhjZ9I;UrFsEhzHq30- z)YP7%XG7o^@WC@QJjCeeC}xKD#fGlBdiET2|hKocmGlYQs>;TL}6xnhPg9mFgr_m;vBf5BMuG@@bW)i<}Z~=YAb7~ zT2Wfd_N&<9UH}ZN54x!QSEr_4fB3_yN-=AM5LmNj4Qtn~#mwk*Isgn04bzHk{ylw+ zS6+UN=bm|vOTTwLkfRtPvGf`Y0W;JThZP??D>?_;K1$XpiK~U+IXyj1mSq?ad_YXt zqx(5He}tL#JoQ8KI0xS6{VmRiC@-ikB;0300e$GBJU<%(gBXQov$^Q`d~2R(_P>Cx zti$>NFo+TXhlt=@ike|oHWz1Q=JZzu>}lYksj1hGeq3UwII<8u8^*@iFt&jtar|)S zBOKlJHXCoe27hH0r;hViuI8j3r7<`}({e_J2K{|^-SoG~ci&_0=vP=1jFsVksT6ne96s zxS3BlQZrpR@4Qie^3P3q7gA}LOLR}O4_8I@@@gLG4Gxh^{y7T}5002ovPDHLkV1l5)GaLW_ diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/.classpath b/terminal/plugins/org.eclipse.tm.terminal.telnet/.classpath deleted file mode 100644 index 25d360efcad..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.telnet/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/.project b/terminal/plugins/org.eclipse.tm.terminal.telnet/.project deleted file mode 100644 index 15718654262..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.tm.terminal.telnet - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94637dfe13b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,61 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.ui.prefs b/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 9a20fca52a4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Mon Jul 31 14:55:17 CEST 2006 -eclipse.preferences.version=1 -internal.default.compliance=user diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF deleted file mode 100644 index ea631367c33..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal.telnet;singleton:=true -Bundle-Version: 2.1.400.qualifier -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.tm.terminal;bundle-version="3.3.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.html b/terminal/plugins/org.eclipse.tm.terminal.telnet/about.html deleted file mode 100644 index a603d19ab21..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.ini b/terminal/plugins/org.eclipse.tm.terminal.telnet/about.ini deleted file mode 100644 index 3adc27ab587..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=tm32.png - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (not translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.properties b/terminal/plugins/org.eclipse.tm.terminal.telnet/about.properties deleted file mode 100644 index 952c0f4b010..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber - initial API and implementation -################################################################################ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. -# -# Do not translate any values surrounded by {} - -blurb=Target Management Terminal Telnet Connector\n\ -\n\ -Version: {featureVersion}\n\ -\n\ -(c) Copyright Wind River Systems, Inc. and others 2003, 2015. All rights reserved.\n\ -Visit http://www.eclipse.org/tm diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/build.properties b/terminal/plugins/org.eclipse.tm.terminal.telnet/build.properties deleted file mode 100644 index 894a288c13b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/build.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -bin.includes = .,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html,\ - about.ini,\ - about.properties,\ - tm32.png - -source.. = src/ -output.. = bin/ -src.includes = about.html - diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.properties deleted file mode 100644 index 1bd314f533d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -pluginName = Target Management Terminal Telnet Connector -providerName = Eclipse TM Project -telnetConnection = Telnet diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.xml deleted file mode 100644 index 342c1f22727..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/plugin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml deleted file mode 100644 index 0b31fe029ac..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal.telnet - 2.1.400.qualifier - eclipse-plugin - diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java deleted file mode 100644 index 89c8e4aec55..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/ITelnetSettings.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public interface ITelnetSettings { - String getHost(); - int getNetworkPort(); - int getTimeout(); - String getSummary(); - void load(ISettingsStore store); - void save(ISettingsStore store); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/NetworkPortMap.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/NetworkPortMap.java deleted file mode 100644 index 367aabc7b95..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/NetworkPortMap.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalNetworkPortMap - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.util.ArrayList; -import java.util.List; - -public class NetworkPortMap { - public static final String PROP_NAMETGTCONS = "tgtcons"; //$NON-NLS-1$ - public static final String PROP_NAMETELNET = "telnet"; //$NON-NLS-1$ - public static final String PROP_VALUENET = "1233"; //$NON-NLS-1$ - public static final String PROP_VALUETGTCONS = "1232"; //$NON-NLS-1$ - public static final String PROP_VALUETELNET = "23"; //$NON-NLS-1$ - - String[][] fPortMap=new String[][] { - // portName, port - {PROP_NAMETGTCONS, PROP_VALUETGTCONS}, - {PROP_NAMETELNET, PROP_VALUETELNET} - }; - - public String getDefaultNetworkPort() { - return PROP_VALUETELNET; - } - - public String findPortName(String strPort) { - for (int i = 0; i < fPortMap.length; i++) { - if(fPortMap[i][1].equals(strPort)) - return fPortMap[i][0]; - } - return null; - } - - public String findPort(String strPortName) { - for (int i = 0; i < fPortMap.length; i++) { - if(fPortMap[i][0].equals(strPortName)) - return fPortMap[i][1]; - } - return null; - } - - public List getNameTable() { - List names=new ArrayList(); - for (int i = 0; i < fPortMap.length; i++) { - names.add(fPortMap[i][0]); - } - return names; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetCodes.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetCodes.java deleted file mode 100644 index b40d3dfefb7..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetCodes.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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.internal.terminal.telnet; - -/** - * This interface defines symbolic constants for numeric TELNET protocol command and - * option codes. Any class that needs to use these constants must implement this - * interface. The meanings of these constants are defined in the various TELNET RFCs - * (RFC 854 to RFC 861, and others). - */ -interface TelnetCodes -{ - /** Command code: Subnegotiation End. */ - static final byte TELNET_SE = (byte)240; - - /** Command code: No-op. */ - static final byte TELNET_NOP = (byte)241; - - /** Command code: Data Mark. */ - static final byte TELNET_DM = (byte)242; - - /** Command code: Break. */ - static final byte TELNET_BREAK = (byte)243; - - /** Command code: Interrupt Process. */ - static final byte TELNET_IP = (byte)244; - - /** Command code: Abort Output. */ - static final byte TELNET_AO = (byte)245; - - /** Command code: Are You There. */ - static final byte TELNET_AYT = (byte)246; - - /** Command code: Erase Character. */ - static final byte TELNET_EC = (byte)247; - - /** Command code: Erase Line. */ - static final byte TELNET_EL = (byte)248; - - /** Command code: Go Ahead. */ - static final byte TELNET_GA = (byte)249; - - /** Command code: Subnegotiation Begin. */ - static final byte TELNET_SB = (byte)250; - - /** Command code: Will. */ - static final byte TELNET_WILL = (byte)251; - - /** Command code: Won't. */ - static final byte TELNET_WONT = (byte)252; - - /** Command code: Do. */ - static final byte TELNET_DO = (byte)253; - - /** Command code: Don't. */ - static final byte TELNET_DONT = (byte)254; - - /** Command code: Interpret As Command. */ - static final byte TELNET_IAC = (byte)255; - - /** Command code: IS. */ - static final byte TELNET_IS = 0; - - /** Command code: SEND. */ - static final byte TELNET_SEND = 1; - - - /** Option code: Transmit Binary option. */ - static final byte TELNET_OPTION_TRANSMIT_BINARY = 0; - - /** Option code: Echo option. */ - static final byte TELNET_OPTION_ECHO = 1; - - /** Option code: Suppress Go Ahead option. */ - static final byte TELNET_OPTION_SUPPRESS_GA = 3; - - /** Option code: Terminal Type */ - static final byte TELNET_OPTION_TERMINAL_TYPE = 24; - - /** Option code: Negotitate About Window Size (NAWS) */ - static final byte TELNET_OPTION_NAWS = 31; -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnectWorker.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnectWorker.java deleted file mode 100644 index b92865e2a06..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnectWorker.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalControl - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Uwe Stieber (Wind River) - [287158][terminal][telnet] Connect worker is giving up to early - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.net.ConnectException; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketTimeoutException; -import java.net.UnknownHostException; - -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -class TelnetConnectWorker extends Thread { - private final ITerminalControl fControl; - private final TelnetConnector fConn; - protected TelnetConnectWorker(TelnetConnector conn,ITerminalControl control) { - fControl = control; - fConn = conn; - fControl.setState(TerminalState.CONNECTING); - } - public void run() { - // Retry the connect with after a little pause in case the - // remote telnet server isn't ready. ConnectExceptions might - // happen if the telnet server process did not initialized itself. - // This is seen especially if the telnet server is a process - // providing it's input and output via a built in telnet server. - int remaining = 10; - - while (remaining >= 0) { - // Pause before we re-try if the remaining tries are less than the initial value - if (remaining < 10) try { Thread.sleep(500); } catch (InterruptedException e) { /* ignored on purpose */ } - - try { - int nTimeout = fConn.getTelnetSettings().getTimeout() * 1000; - String strHost = fConn.getTelnetSettings().getHost(); - int nPort = fConn.getTelnetSettings().getNetworkPort(); - InetSocketAddress address = new InetSocketAddress(strHost, nPort); - Socket socket=new Socket(); - - socket.connect(address, nTimeout); - - // If we get to this point, the connect succeeded and we will - // force the remaining counter to be 0. - remaining = 0; - - // This next call causes reads on the socket to see TCP urgent data - // inline with the rest of the non-urgent data. Without this call, TCP - // urgent data is silently dropped by Java. This is required for - // TELNET support, because when the TELNET server sends "IAC DM", the - // IAC byte is TCP urgent data. If urgent data is silently dropped, we - // only see the DM, which looks like an ISO Latin-1 '�' character. - - socket.setOOBInline(true); - - fConn.setSocket(socket); - - TelnetConnection connection=new TelnetConnection(fConn, socket); - socket.setKeepAlive(true); - fConn.setTelnetConnection(connection); - connection.start(); - fControl.setState(TerminalState.CONNECTED); - - } catch (UnknownHostException ex) { - // No re-try in case of UnknownHostException, there is no indication that - // the DNS will fix itself - remaining = 0; - //Construct error message and signal failed - String txt="Unknown host: " + ex.getMessage(); //$NON-NLS-1$ - connectFailed(txt,"Unknown host: " + ex.getMessage() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (SocketTimeoutException socketTimeoutException) { - // Time out occurred. No re-try in this case either. Time out can - // be increased by the user. Multiplying the timeout with the remaining - // counter is not desired. - remaining = 0; - // Construct error message and signal failed - connectFailed(socketTimeoutException.getMessage(), "Connection Error!\n" + socketTimeoutException.getMessage()); //$NON-NLS-1$ - } catch (ConnectException connectException) { - // In case of a ConnectException, do a re-try. The server could have been - // simply not ready yet and the worker would give up to early. If the terminal - // control is already closed (disconnected), don't print "Connection refused" errors - if (remaining == 0 && TerminalState.CLOSED != fControl.getState()) { - connectFailed(connectException.getMessage(),"Connection refused!"); //$NON-NLS-1$ - } - } catch (Exception exception) { - // Any other exception on connect. No re-try in this case either - remaining = 0; - // Log the exception - Logger.logException(exception); - // And signal failed - connectFailed(exception.getMessage(),""); //$NON-NLS-1$ - } finally { - remaining--; - } - } - } - - private void connectFailed(String terminalText, String msg) { - Logger.log(terminalText); - fControl.displayTextInTerminal(terminalText); - fConn.cleanSocket(); - fControl.setState(TerminalState.CLOSED); - fControl.setMsg(msg); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java deleted file mode 100644 index e3c2b87fe8d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java +++ /dev/null @@ -1,693 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Fran Litterio (Wind River) - initial API and implementation - * Helmut Haigermoser (Wind River) - repackaged - * Ted Williams (Wind River) - repackaged into org.eclipse namespace - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal - * Alex Panchenko (Xored) - [277061] TelnetConnection.isConnected() should check if socket was not closed - * Uwe Stieber (Wind River) - [281329] Telnet connection not handling "SocketException: Connection reset" correct - * Nils Hagge (Siemens AG) - [276023] close socket streams after connection is disconnected - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; -import java.net.SocketException; - -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -/** - * This class encapsulates a TELNET connection to a remote server. It processes - * incoming TELNET protocol data and generates outbound TELNET protocol data. It - * also manages two sets of TelnetOption objects: one for the local endpoint and - * one for the remote endpoint. - *

- * - * IMPORTANT: Understanding this code requires understanding the TELNET protocol - * and TELNET option processing, as defined in the RFCs listed below. - *

- * - * @author Fran Litterio (francis.litterio@windriver.com) - * - * @see RFC 854 - * @see RFC 855 - * @see RFC 856 - * @see RFC 857 - * @see RFC 858 - * @see RFC 859 - * @see RFC 860 - * @see RFC 861 - * @see RFC 1091 - * @see RFC 1096 - * @see RFC 1073 - * @see RFC 1079 - * @see RFC 1143 - * @see RFC 1572 - */ -public class TelnetConnection extends Thread implements TelnetCodes { - /** - * TELNET connection state: Initial state. - */ - protected static final int STATE_INITIAL = 0; - - /** - * TELNET connection state: Last byte processed was IAC code. code. - */ - protected static final int STATE_IAC_RECEIVED = 1; - - /** - * TELNET connection state: Last byte processed was WILL code. code. - */ - protected static final int STATE_WILL_RECEIVED = 2; - - /** - * TELNET connection state: Last byte processed was WONT code. - */ - protected static final int STATE_WONT_RECEIVED = 3; - - /** - * TELNET connection state: Last byte processed was DO code. - */ - protected static final int STATE_DO_RECEIVED = 4; - - /** - * TELNET connection state: Last byte processed was DONT code. - */ - protected static final int STATE_DONT_RECEIVED = 5; - - /** - * TELNET connection state: Last byte processed was SB. - */ - protected static final int STATE_SUBNEGOTIATION_STARTED = 6; - - /** - * TELNET connection state: Currently receiving sub-negotiation data. - */ - protected static final int STATE_RECEIVING_SUBNEGOTIATION = 7; - - /** - * Size of buffer for processing data received from remote endpoint. - */ - protected static final int BUFFER_SIZE = 2048; - - /** - * Holds raw bytes received from the remote endpoint, prior to any TELNET - * protocol processing. - */ - protected byte[] rawBytes = new byte[BUFFER_SIZE]; - - /** - * Holds incoming network data after the TELNET protocol bytes have been - * processed and removed. - */ - protected byte[] processedBytes = new byte[BUFFER_SIZE]; - - /** - * This field holds a StringBuffer containing text recently received from - * the remote endpoint (after all TELNET protocol bytes have been processed - * and removed). - */ - protected StringBuffer processedStringBuffer = new StringBuffer(BUFFER_SIZE); - - /** - * Holds the current state of the TELNET protocol processor. - */ - protected int telnetState = STATE_INITIAL; - - /** - * This field is true if the remote endpoint is a TELNET server, false if - * not. We set this to true if and only if the remote endpoint sends - * recognizable TELNET protocol data. We do not assume that the remote - * endpoint is a TELNET server just because it is listening on port 23. This - * allows us to successfully connect to a TELNET server listening on a port - * other than 23. - *

- * - * When this field first changes from false to true, we send all WILL or DO - * commands to the remote endpoint. - *

- * - * @see #telnetServerDetected() - */ - protected boolean remoteIsTelnetServer = false; - - /** - * An array of TelnetOption objects representing the local endpoint's TELNET - * options. The array is indexed by the numeric TELNET option code. - */ - protected TelnetOption[] localOptions = new TelnetOption[256]; - - /** - * An array of TelnetOption objects representing the remote endpoint's - * TELNET options. The array is indexed by the numeric TELNET option code. - */ - protected TelnetOption[] remoteOptions = new TelnetOption[256]; - - /** - * An array of bytes that holds the TELNET subnegotiation command most - * recently received from the remote endpoint. This array does _not_ include - * the leading IAC SB bytes, nor does it include the trailing IAC SE bytes. - * The first byte of this array is always a TELNET option code. - */ - protected byte[] receivedSubnegotiation = new byte[128]; - - /** - * This field holds the index into array {@link #receivedSubnegotiation} of - * the next unused byte. This is used by method - * {@link #processTelnetProtocol(int)} when the state machine is in states - * {@link #STATE_SUBNEGOTIATION_STARTED} and {@link - * #STATE_RECEIVING_SUBNEGOTIATION}. - */ - protected int nextSubnegotiationByteIndex = 0; - - /** - * This field is true if an error occurs while processing a subnegotiation - * command. - * - * @see #processTelnetProtocol(int) - */ - protected boolean ignoreSubnegotiation = false; - - /** - * This field holds the width of the Terminal screen in columns. - */ - protected int width = 0; - - /** - * This field holds the height of the Terminal screen in rows. - */ - protected int height = 0; - - /** - * This field holds a reference to the {@link ITerminalControl} singleton. - */ - protected TelnetConnector terminalControl; - - /** - * This method holds the Socket object for the TELNET connection. - */ - protected Socket socket; - - /** - * This field holds a reference to an {@link InputStream} object used to - * receive data from the remote endpoint. - */ - protected InputStream inputStream; - - /** - * This field holds a reference to an {@link OutputStream} object used to - * send data to the remote endpoint. - */ - protected OutputStream outputStream; - - /** - * UNDER CONSTRUCTION - */ - protected boolean localEcho = true; - - /** - * This constructor just initializes some internal object state from its - * arguments. - */ - public TelnetConnection(TelnetConnector terminalControl, Socket socket) throws IOException { - super(); - - Logger.log("entered"); //$NON-NLS-1$ - - this.terminalControl = terminalControl; - this.socket = socket; - - inputStream = socket.getInputStream(); - outputStream = socket.getOutputStream(); - - initializeOptions(); - } - - /** - * Returns true if the TCP connection represented by this object is - * connected, false otherwise. - */ - public boolean isConnected() { - return socket != null && socket.isConnected() && !socket.isClosed(); - } - - /** - * Returns true if the TCP connection represented by this object is - * connected and the remote endpoint is a TELNET server, false otherwise. - */ - public boolean isRemoteTelnetServer() { - return remoteIsTelnetServer; - } - - /** - * This method sets the terminal width and height to the supplied values. If - * either new value differs from the corresponding old value, we initiate a - * NAWS subnegotiation to inform the remote endpoint of the new terminal - * size. - */ - public void setTerminalSize(int newWidth, int newHeight) { - Logger.log("Setting new size: width = " + newWidth + ", height = " + newHeight); //$NON-NLS-1$ //$NON-NLS-2$ - if (!isConnected() || !isRemoteTelnetServer()) - return; - boolean sizeChanged = false; - - if (newWidth != width || newHeight != height) - sizeChanged = true; - - width = newWidth; - height = newHeight; - - if (sizeChanged && remoteIsTelnetServer && localOptions[TELNET_OPTION_NAWS].isEnabled()) { - Integer[] sizeData = { new Integer(width), new Integer(height) }; - - localOptions[TELNET_OPTION_NAWS].sendSubnegotiation(sizeData); - } - } - - /** - * Returns true if local echoing is enabled for this TCP connection, false - * otherwise. - */ - public boolean localEcho() { - return localEcho; - } - - private void displayTextInTerminal(String string) { - terminalControl.displayTextInTerminal(string); - } - - /** - * This method runs in its own thread. It reads raw bytes from the TELNET - * connection socket, processes any TELNET protocol bytes (and removes - * them), and passes the remaining bytes to a TerminalDisplay object for - * display. - */ - public void run() { - Logger.log("Entered"); //$NON-NLS-1$ - - try { - while (socket.isConnected()) { - int nRawBytes = inputStream.read(rawBytes); - - if (nRawBytes == -1) { - // End of input on inputStream. - Logger.log("End of input reading from socket!"); //$NON-NLS-1$ - - // Announce to the user that the remote endpoint has closed the - // connection. - - displayTextInTerminal(TelnetMessages.CONNECTION_CLOSED_BY_FOREIGN_HOST); - - // Tell the ITerminalControl object that the connection is - // closed. - terminalControl.setState(TerminalState.CLOSED); - break; - } else { - // Process any TELNET protocol data that we receive. Don't - // send any TELNET protocol data until we are sure the remote - // endpoint is a TELNET server. - - int nProcessedBytes = processTelnetProtocol(nRawBytes); - - if (nProcessedBytes > 0) { - terminalControl.getRemoteToTerminalOutputStream().write(processedBytes, 0, nProcessedBytes); - } - } - } - } catch (SocketException ex) { - String message = ex.getMessage(); - - // A "socket closed" exception is normal here. It's caused by the - // user clicking the disconnect button on the Terminal view toolbar. - - if (message != null && !message.equalsIgnoreCase("Socket closed") && !message.equalsIgnoreCase("Connection reset")) //$NON-NLS-1$ //$NON-NLS-2$ - { - Logger.logException(ex); - } - - } catch (Exception ex) { - Logger.logException(ex); - } finally { - // Tell the ITerminalControl object that the connection is closed. - terminalControl.setState(TerminalState.CLOSED); - try { inputStream.close(); } catch(IOException ioe) { /*ignore*/ } - try { outputStream.close(); } catch(IOException ioe) { /*ignore*/ } - } - } - - /** - * This method initializes the localOptions[] and remoteOptions[] arrays so - * that they contain references to TelnetOption objects representing our - * desired state for each option. The goal is to achieve server-side - * echoing, suppression of Go Aheads, and to send the local terminal type - * and size to the remote endpoint. - */ - protected void initializeOptions() { - // First, create all the TelnetOption objects in the "undesired" state. - - for (int i = 0; i < localOptions.length; ++i) { - localOptions[i] = new TelnetOption((byte) i, false, true, outputStream); - } - - for (int i = 0; i < localOptions.length; ++i) { - remoteOptions[i] = new TelnetOption((byte) i, false, false, outputStream); - } - - // Next, set some of the options to the "desired" state. The options we - // desire to be enabled are as follows: - // - // TELNET Option Desired for Desired for - // Name and Code Local Endpoint Remote Endpoint - // --------------------- -------------- --------------- - // Echo (1) No Yes - // Suppress Go Ahead (3) Yes Yes - // Terminal Type (24) Yes Yes - // NAWS (31) Yes Yes - // - // All other options remain in the "undesired" state, and thus will be - // disabled (since either endpoint can force any option to be disabled by simply - // answering WILL with DONT and DO with WONT). - - localOptions[TELNET_OPTION_ECHO].setDesired(false); - remoteOptions[TELNET_OPTION_ECHO].setDesired(true); - - localOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true); - remoteOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true); - - localOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true); - remoteOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true); - - localOptions[TELNET_OPTION_NAWS].setDesired(true); - remoteOptions[TELNET_OPTION_NAWS].setDesired(true); - } - - /** - * Process TELNET protocol data contained in the first count bytes - * of rawBytes. This function preserves its state between calls, - * because a multi-byte TELNET command might be split between two (or more) - * calls to this function. The state is preserved in field telnetState. - * This function implements an FSA that recognizes TELNET option codes. - * TELNET option sub-negotiation is delegated to instances of TelnetOption. - * - * @return The number of bytes remaining in the buffer after removing all - * TELNET protocol bytes. - */ - //TELNET option state is stored in instances of TelnetOption. - protected int processTelnetProtocol(int count) { - // This is too noisy to leave on all the time. - // Logger.log("Processing " + count + " bytes of data."); - - int nextProcessedByte = 0; - - for (int byteIndex = 0; byteIndex < count; ++byteIndex) { - // It is possible for control to flow through the below code such - // that nothing happens. This happens when array rawBytes[] contains no - // TELNET protocol data. - - byte inputByte = rawBytes[byteIndex]; - - switch (telnetState) { - case STATE_INITIAL: - if (inputByte == TELNET_IAC) { - telnetState = STATE_IAC_RECEIVED; - } else { - // It's not an IAC code, so just append it to - // processedBytes. - - processedBytes[nextProcessedByte++] = rawBytes[byteIndex]; - } - break; - - case STATE_IAC_RECEIVED: - switch (inputByte) { - case TELNET_IAC: - // Two IAC bytes in a row are translated into one byte with - // the - // value 0xff. - - processedBytes[nextProcessedByte++] = (byte) 0xff; - telnetState = STATE_INITIAL; - break; - - case TELNET_WILL: - telnetState = STATE_WILL_RECEIVED; - break; - - case TELNET_WONT: - telnetState = STATE_WONT_RECEIVED; - break; - - case TELNET_DO: - telnetState = STATE_DO_RECEIVED; - break; - - case TELNET_DONT: - telnetState = STATE_DONT_RECEIVED; - break; - - case TELNET_SB: - telnetState = STATE_SUBNEGOTIATION_STARTED; - break; - - // Commands to consume and ignore. - - // Data Mark (DM). This is sent by a TELNET server following an - // IAC sent as TCP urgent data. It should cause the client to - // skip all not yet processed non-TELNET-protocol data preceding the - // DM byte. However, Java 1.4.x has no way to inform clients of - // class Socket that urgent data is available, so we simply ignore the - // "IAC DM" command. Since the IAC is sent as TCP urgent data, - // the Socket must be put into OOB-inline mode via a call to - // setOOBInline(true), otherwise the IAC is silently dropped by - // Java and only the DM arrives (leaving the user to see a - // spurious ISO Latin-1 character). - case TELNET_DM: - - case TELNET_NOP: // No-op. - case TELNET_GA: // Go Ahead command. Meaningless on a full-duplex link. - case TELNET_IP: // Interupt Process command. Server should never send this. - case TELNET_AO: // Abort Output command. Server should never send this. - case TELNET_AYT: // Are You There command. Server should never send this. - case TELNET_EC: // Erase Character command. Server should never send this. - case TELNET_EL: // Erase Line command. Server should never send this. - telnetState = STATE_INITIAL; - break; - - default: - // Unrecognized command! This should never happen. - Logger.log("processTelnetProtocol: UNRECOGNIZED TELNET PROTOCOL COMMAND: " + //$NON-NLS-1$ - inputByte); - telnetState = STATE_INITIAL; - break; - } - break; - - // For the next four cases, WILL and WONT commands affect the state - // of remote options, and DO and DONT commands affect the state of - // local options. - - case STATE_WILL_RECEIVED: - Logger.log("Received WILL " + localOptions[inputByte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - remoteOptions[inputByte].handleWill(); - telnetState = STATE_INITIAL; - telnetServerDetected(); - break; - - case STATE_WONT_RECEIVED: - Logger.log("Received WONT " + localOptions[inputByte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - remoteOptions[inputByte].handleWont(); - telnetState = STATE_INITIAL; - telnetServerDetected(); - break; - - case STATE_DO_RECEIVED: - Logger.log("Received DO " + localOptions[inputByte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - localOptions[inputByte].handleDo(); - telnetState = STATE_INITIAL; - telnetServerDetected(); - break; - - case STATE_DONT_RECEIVED: - Logger.log("Received DONT " + localOptions[inputByte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - localOptions[inputByte].handleDont(); - telnetState = STATE_INITIAL; - telnetServerDetected(); - break; - - case STATE_SUBNEGOTIATION_STARTED: - Logger.log("Starting subnegotiation for option " + //$NON-NLS-1$ - localOptions[inputByte].optionName() + "."); //$NON-NLS-1$ - - // First, zero out the array of received subnegotiation butes. - - for (int i = 0; i < receivedSubnegotiation.length; ++i) - receivedSubnegotiation[i] = 0; - - // Forget about any previous subnegotiation errors. - - ignoreSubnegotiation = false; - - // Then insert this input byte into the array and enter state - // STATE_RECEIVING_SUBNEGOTIATION, where we will gather the - // remaining subnegotiation bytes. - - nextSubnegotiationByteIndex = 0; - receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; - telnetState = STATE_RECEIVING_SUBNEGOTIATION; - break; - - case STATE_RECEIVING_SUBNEGOTIATION: - if (inputByte == TELNET_IAC) { - // Handle double IAC bytes. From RFC 855: "if parameters - // in an option 'subnegotiation' include a byte with a value - // of 255, it is necessary to double this byte in accordance - // the general TELNET rules." - - if (nextSubnegotiationByteIndex > 0 - && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) { - // The last input byte we received in this - // subnegotiation was IAC, so this is a double IAC. Leave the previous IAC - // in the receivedSubnegotiation[] array and drop the current - // one (thus translating a double IAC into a single IAC). - - Logger.log("Double IAC in subnegotiation translated into single IAC."); //$NON-NLS-1$ - break; - } - - // Append the IAC byte to receivedSubnegotiation[]. If there - // is no room for the IAC byte, it overwrites the last byte, - // because we need to know when the subnegotiation ends, and that is - // marked by an "IAC SE" command. - - if (nextSubnegotiationByteIndex < receivedSubnegotiation.length) { - receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; - } else { - receivedSubnegotiation[receivedSubnegotiation.length - 1] = inputByte; - } - break; - } - - // Handle an "IAC SE" command, which marks the end of the - // subnegotiation. An SE byte by itself might be a legitimate - // part of the subnegotiation data, so don't do anything unless the SE - // is immediately preceded by an IAC. - - if (inputByte == TELNET_SE && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) { - Logger.log("Found SE code marking end of subnegotiation."); //$NON-NLS-1$ - - // We are done receiving the subnegotiation command. Now - // process it. We always use the option object stored in array - // localOptions[] to process the received subnegotiation. - // This is an arbitrary decision, but it is sufficient for handling - // options TERMINAL-TYPE and NAWS, which are the only options that - // we subnegotiate (presently). If, in the future,subnegotiations - // need to be handled by option objects stored in both - // localOptions[] and remoteOptions[], then some mechanism - // to choose the correct option object must be implemented. - // - // Also, if ignoreSubnegotiation is true, there was an error - // while receiving the subnegotiation, so we must not process the - // command, and instead just return to the initial state. - - if (!ignoreSubnegotiation) { - // Remove the trailing IAC byte from - // receivedSubnegotiation[]. - - receivedSubnegotiation[nextSubnegotiationByteIndex - 1] = 0; - - int subnegotiatedOption = receivedSubnegotiation[0]; - - localOptions[subnegotiatedOption].handleSubnegotiation(receivedSubnegotiation, - nextSubnegotiationByteIndex); - } else { - Logger.log("NOT CALLING handleSubnegotiation() BECAUSE OF ERRORS!"); //$NON-NLS-1$ - } - - // Return to the initial state. - - telnetState = STATE_INITIAL; - } - - // Check whether the receivedSubnegotiation[] array is full. - - if (nextSubnegotiationByteIndex >= receivedSubnegotiation.length) { - // This should not happen. Array receivedSubnegotiation can - // hold 128 bytes, and no TELNET option that we perform - // subnegotiation for requires that many bytes in a subnegotiation command. - // In the interest of robustness, we handle this case by ignoring all - // remaining subnegotiation bytes until we receive the IAC SE - // command that ends the subnegotiation. Also, we set - // ignoreSubnegotiation to true to prevent a call to - // handleSubnegotiation() when the IAC SE command arrives. - - Logger.log("SUBNEGOTIATION BUFFER FULL!"); //$NON-NLS-1$ - ignoreSubnegotiation = true; - } else { - Logger.log("Recording subnegotiation byte " + (inputByte & 0xff)); //$NON-NLS-1$ - - receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; - } - break; - - default: - // This should _never_ happen! If it does, it means there is a - // bug in this FSA. For robustness, we return to the initial state. - - Logger.log("INVALID TELNET STATE: " + telnetState); //$NON-NLS-1$ - telnetState = STATE_INITIAL; - break; - } - } - - // Return the number of bytes of processed data (i.e., number of bytes - // of raw data minus TELNET control bytes). This value can be zero. - - return nextProcessedByte; - } - - /** - * This method is called whenever we receive a valid TELNET protocol command - * from the remote endpoint. When it is called for the first time for this - * connection, we negotiate all options that we desire to be enabled. - *

- * - * This method does not negotiate options that we do not desire to be - * enabled, because all options are initially disabled. - *

- */ - protected void telnetServerDetected() { - if (!remoteIsTelnetServer) { - // This block only executes once per TelnetConnection instance. - - localEcho = false; - - Logger.log("Detected TELNET server."); //$NON-NLS-1$ - - remoteIsTelnetServer = true; - - for (int i = 0; i < localOptions.length; ++i) { - if (localOptions[i].isDesired()) { - localOptions[i].negotiate(); - } - } - - for (int i = 0; i < remoteOptions.length; ++i) { - if (remoteOptions[i].isDesired()) { - remoteOptions[i].negotiate(); - } - } - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java deleted file mode 100644 index 83e31d08951..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalControl - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - * Sean Adams (Cisco) - [231959][terminal][telnet] NPE in TelnetConnector.java - * David Sciamma (Anyware-Tech) - [288254][telnet] local echo is always disabled - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -public class TelnetConnector extends TerminalConnectorImpl { - private OutputStream fOutputStream; - private InputStream fInputStream; - private Socket fSocket; - private TelnetConnection fTelnetConnection; - private final TelnetSettings fSettings; - private int fWidth = -1; - private int fHeight = -1; - - public TelnetConnector() { - this(new TelnetSettings()); - } - public TelnetConnector(TelnetSettings settings) { - fSettings=settings; - } - public void connect(ITerminalControl control) { - super.connect(control); - fWidth=-1; - fHeight=-1; - // TERM=xterm implies VT100 line wrapping mode - control.setVT100LineWrapping(true); - TelnetConnectWorker worker = new TelnetConnectWorker(this,control); - worker.start(); - } - public void doDisconnect() { - if (getSocket() != null) { - try { - getSocket().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - if (getInputStream() != null) { - try { - getInputStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - - if (getTerminalToRemoteStream() != null) { - try { - getTerminalToRemoteStream().close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - cleanSocket(); - } - public boolean isLocalEcho() { - if(fTelnetConnection==null) - return false; - return fTelnetConnection.localEcho(); - } - public void setTerminalSize(int newWidth, int newHeight) { - if(fTelnetConnection!=null && (newWidth!=fWidth || newHeight!=fHeight)) { - //avoid excessive communications due to change size requests by caching previous size - fTelnetConnection.setTerminalSize(newWidth, newHeight); - fWidth=newWidth; - fHeight=newHeight; - } - } - public InputStream getInputStream() { - return fInputStream; - } - public OutputStream getTerminalToRemoteStream() { - return fOutputStream; - } - private void setInputStream(InputStream inputStream) { - fInputStream = inputStream; - } - private void setOutputStream(OutputStream outputStream) { - fOutputStream = outputStream; - } - Socket getSocket() { - return fSocket; - } - - /** - * sets the socket to null - */ - void cleanSocket() { - fSocket=null; - setInputStream(null); - setOutputStream(null); - } - - void setSocket(Socket socket) throws IOException { - if(socket==null) { - cleanSocket(); - } else { - fSocket = socket; - setInputStream(socket.getInputStream()); - setOutputStream(socket.getOutputStream()); - } - - } - public void setTelnetConnection(TelnetConnection connection) { - fTelnetConnection=connection; - } - public void displayTextInTerminal(String text) { - fControl.displayTextInTerminal(text); - } - public OutputStream getRemoteToTerminalOutputStream () { - return fControl.getRemoteToTerminalOutputStream(); - } - public void setState(TerminalState state) { - fControl.setState(state); - } - public ITelnetSettings getTelnetSettings() { - return fSettings; - } - public ISettingsPage makeSettingsPage() { - return new TelnetSettingsPage(fSettings); - } - public String getSettingsSummary() { - return fSettings.getSummary(); - } - public void load(ISettingsStore store) { - fSettings.load(store); - } - public void save(ISettingsStore store) { - fSettings.save(store); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.java deleted file mode 100644 index 5e0d9a64fad..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import org.eclipse.osgi.util.NLS; - -public class TelnetMessages extends NLS { - static { - NLS.initializeMessages(TelnetMessages.class.getName(), TelnetMessages.class); - } - public static String PORT; - public static String HOST; - public static String CONNECTION_CLOSED_BY_FOREIGN_HOST; - public static String TIMEOUT; - - } diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.properties b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.properties deleted file mode 100644 index 2edd356b3ed..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetMessages.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# Copyright (c) 2005, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -############################################################################### -PORT = Port -HOST = Host -CONNECTION_CLOSED_BY_FOREIGN_HOST= Connection closed by foreign host. -TIMEOUT = Timeout (sec) diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java deleted file mode 100644 index 835e2e1da87..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java +++ /dev/null @@ -1,704 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [267181] Fix telnet option negotiation loop - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Date; - -import org.eclipse.tm.internal.terminal.provisional.api.Logger; - -/** - * This class represents a single TELNET protocol option at one endpoint of a TELNET - * connection. This class encapsulates the endpoint associated with the option (local - * or remote), the current state of the option (enabled or disabled), the desired state - * of the option, the current state of the negotiation, an OutputStream that allows - * communication with the remote endpoint, and the number of negotiations that have - * started within this connection.

- * - * In addition to encapsulating the above state, this class performs option negotiation - * to attempt to achieve the desired option state. For some options, this class also - * performs option sub-negotiation.

- * - * IMPORTANT: Understanding this code requires understanding the TELNET protocol and - * TELNET option processing.

- * - * @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$ - }; - - /** - * 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):

- * - *

-     *     NEGOTIATION_NOT_STARTED -----> {@link #NEGOTIATION_IN_PROGRESS}
-     *                         |    (A)      |        ^
-     *                      (C)|          (B)|        |(D)
-     *                         |             V        |
-     *                         +--------> {@link #NEGOTIATION_DONE}
-     * 

- * - * Once the FSA leaves state NEGOTIATION_NOT_STARTED, it never returns to that - * state. Transition A happens when the local endpoint sends an option command - * before receiving a command for the same option from the remote endpoint.

- * - * Transition B happens when the local endpoint receives a reply to an option - * command sent earlier by the local endpoint. Receipt of that reply terminates - * the negotiation.

- * - * Transition D happens after negotiation is done and "something changes" (see the - * RFCs for the definition of "something changes"). Either endpoint can - * re-negotiate an option after a previous negotiation, but only if some external - * influence (such as the user or the OS) causes it to do so. Re-negotiation must - * start more than {@link #NEGOTIATION_IGNORE_DURATION} milliseconds after the FSA - * enters state NEGOTIATION_DONE or it will be ignored. This is how this client - * prevents negotiation loops.

- * - * Transition C happens when the local endpoint receives an option command from the - * remote endpoint before sending a command for the same option. In that case, the - * local endpoint replies immediately with an option command and the negotiation - * terminates.

- * - * Some TELNET servers (e.g., the Solaris server), after sending WILL and receiving - * DONT, will reply with a superfluous WONT. Any such superfluous option command - * received from the remote endpoint while the option's FSA is in state - * {@link #NEGOTIATION_DONE} will be ignored by the local endpoint. - */ - protected static final int NEGOTIATION_NOT_STARTED = 0; - - /** Negotiation state: Negotiation is in progress for this option. */ - protected static final int NEGOTIATION_IN_PROGRESS = 1; - - /** Negotiation state: Negotiation has terminated for this option. */ - protected static final int NEGOTIATION_DONE = 2; - - /** - * The number of milliseconds following the end of negotiation of this option - * before which the remote endpoint can re-negotiate the option. Any option - * command received from the remote endpoint before this time passes is ignored. - * This is used to prevent option negotiation loops. - * - * @see #ignoreNegotiation() - * @see #negotiationCompletionTime - */ - protected static final int NEGOTIATION_IGNORE_DURATION = 30000; - - /** - * This field holds the current negotiation state for this option. - */ - protected int negotiationState = NEGOTIATION_NOT_STARTED; - - /** - * This field holds the time when negotiation of this option most recently - * terminated (i.e., entered state {@link #NEGOTIATION_DONE}). This is used to - * determine whether an option command received from the remote endpoint after - * negotiation has terminated for this option is to be ignored or interpreted as - * the start of a new negotiation. - * - * @see #NEGOTIATION_IGNORE_DURATION - */ - protected Date negotiationCompletionTime = new Date(0); - - /** - * Holds the total number of negotiations that have completed for this option. - */ - protected int negotiationCount = 0; - - /** - * Holds the integer code representing the option. - */ - protected byte option = 0; - - /** - * Holds the OutputStream object that allows data to be sent to the remote endpoint - * of the TELNET connection. - */ - protected OutputStream outputStream; - - /** - * True if this option is for the local endpoint, false for the remote endpoint. - */ - protected boolean local = true; - - /** - * This field is true if the option is enabled, false if it is disabled. All - * options are initially disabled until they are negotiated to be enabled.

- */ - protected boolean enabled = false; - - /** - * This field is true if the client desires the option to be enabled, false if the - * client desires the option to be disabled. This field does not represent the - * remote's endpoints desire (as expressed via WILL and WONT commands) -- it - * represnet the local endpoint's desire.

- * - * @see #setDesired(boolean) - */ - protected boolean desired = false; - - /** - * Constructor.

- * - * @param option The integer code of this option. - * @param desired Whether we desire this option to be enabled. - * @param local Whether this option is for the local or remote endpoint. - * @param outputStream A stream used to negotiate with the remote endpoint. - */ - TelnetOption(byte option, boolean desired, boolean local, - OutputStream outputStream) { - this.option = option; - this.desired = desired; - this.local = local; - this.outputStream = outputStream; - } - - /** - * @return Returns a String containing the name of the TELNET option specified in - * parameter option. - */ - public String optionName() { - return optionNames[option]; - } - - /** - * Returns true if this option is enabled, false if it is disabled.

- * - * @return Returns true if this option is enabled, false if it is disabled. - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Enables this option if newValue is true, otherwise disables this - * option.

- * - * @param newValue True if this option is to be enabled, false otherwise. - */ - public void setEnabled(boolean newValue) { - Logger.log("Enabling " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - optionName()); - enabled = newValue; - } - - /** - * Returns true if the local endpoint desires this option to be enabled, false if - * not. It is not an error for the value returned by this method to differ from - * the value returned by isEnabled(). The value returned by this method can change - * over time, reflecting the local endpoint's changing desire regarding the - * option.

- * - * NOTE: Even if this option represents a remote endpoint option, the return value - * of this method represents the local endpint's desire regarding the remote - * option.

- * - * @return Returns true if the local endpoint desires this option to be enabled, - * false if not. - */ - public boolean isDesired() { - return desired; - } - - /** - * Sets our desired value for this option. Note that the option can be desired - * when enabled is false, and the option can be undesired when - * enabled is true, though the latter state should not persist, since either - * endpoint can disable any option at any time.

- * - * @param newValue True if we desire this option to be enabled, false if - * we desire this option to be disabled. - */ - public void setDesired(boolean newValue) { - if (newValue) - Logger.log("Setting " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - optionName() + " as desired."); //$NON-NLS-1$ - - desired = newValue; - } - - /** - * Call this method to request that negotiation begin for this option. This method - * does nothing if negotiation for this option has already started or is already - * complete. If negotiation has not yet started for this option and the local - * endpoint desires this option to be enabled, then we send a WILL or DO command to - * the remote endpoint. - */ - public void negotiate() { - if (negotiationState == NEGOTIATION_NOT_STARTED && desired) { - if (local) { - Logger - .log("Starting negotiation for local option " + optionName()); //$NON-NLS-1$ - sendWill(); - } else { - Logger - .log("Starting negotiation for remote option " + optionName()); //$NON-NLS-1$ - sendDo(); - } - - negotiationState = NEGOTIATION_IN_PROGRESS; - } - } - - /** - * This method is called whenever we receive a WILL command from the remote - * endpoint. - */ - public void handleWill() { - if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { - Logger - .log("Ignoring superfluous WILL command from remote endpoint."); //$NON-NLS-1$ - return; - } - - if (negotiationState == NEGOTIATION_IN_PROGRESS) { - if (desired) { - // We sent DO and server replied with WILL. Enable the option, and end - // this negotiation. - - enabled = true; - Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // This should never happen! We sent DONT and the server replied with - // WILL. Bad server. No soup for you. Disable the option, and end - // this negotiation. - - Logger.log("Server answered DONT with WILL!"); //$NON-NLS-1$ - enabled = false; - Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } else { - if (desired) { - // Server sent WILL, so we reply with DO. Enable the option, and end - // this negotiation. - - sendDo(); - enabled = true; - Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // Server sent WILL, so we reply with DONT. Disable the option, and - // end this negotiation. - - sendDont(); - enabled = false; - Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } - } - - /** - * Handles a WONT command sent by the remote endpoint for this option. The value - * of desired doesn't matter in this method, because the remote endpoint is - * forcing the option to be disabled. - */ - public void handleWont() { - if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { - Logger - .log("Ignoring superfluous WONT command from remote endpoint."); //$NON-NLS-1$ - return; - } - - if (negotiationState == NEGOTIATION_IN_PROGRESS) { - // We sent DO or DONT and server replied with WONT. Disable the - // option, and end this negotiation. - - enabled = false; - Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // Server sent WONT, so we reply with DONT. Disable the option, and - // end this negotiation. - - sendDont(); - enabled = false; - Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } - - /** - * Handles a DO command sent by the remote endpoint for this option. - */ - public void handleDo() { - if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { - Logger.log("Ignoring superfluous DO command from remote endpoint."); //$NON-NLS-1$ - return; - } - - if (negotiationState == NEGOTIATION_IN_PROGRESS) { - if (desired) { - // We sent WILL and server replied with DO. Enable the option, and end - // this negotiation. - - enabled = true; - Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // We sent WONT and server replied with DO. This should never happen! - // Bad server. No soup for you. Disable the option, and end this - // negotiation. - - Logger.log("Server answered WONT with DO!"); //$NON-NLS-1$ - enabled = false; - Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } else { - if (desired) { - // Server sent DO, so we reply with WILL. Enable the option, and end - // this negotiation. - - sendWill(); - enabled = true; - Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // Server sent DO, so we reply with WONT. Disable the option, and end - // this negotiation. - - sendWont(); - enabled = false; - Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } - } - - /** - * Handles a DONT command sent by the remote endpoint for this option. The value - * of desired doesn't matter in this method, because the remote endpoint is - * forcing the option to be disabled. - */ - public void handleDont() { - if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { - Logger - .log("Ignoring superfluous DONT command from remote endpoint."); //$NON-NLS-1$ - return; - } - - if (negotiationState == NEGOTIATION_IN_PROGRESS) { - // We sent WILL or WONT and server replied with DONT. Disable the - // option, and end this negotiation. - - enabled = false; - Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } else { - // Server sent DONT, so we reply with WONT. Disable the option, and end - // this negotiation. - - sendWont(); - enabled = false; - Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ - endNegotiation(); - } - } - - /** - * This method handles a subnegotiation command received from the remote endpoint. - * Currently, the only subnegotiation we handle is when the remote endpoint - * commands us to send our terminal type (which is "xterm"). - * - * @param subnegotiationData An array of bytes containing a TELNET - * subnegotiation command received from the - * remote endpoint. - * @param count The number of bytes in array - * subnegotiationData to examine. - */ - public void handleSubnegotiation(byte[] subnegotiationData, int count) { - switch (option) { - case TELNET_OPTION_TERMINAL_TYPE: - if (subnegotiationData[1] != TELNET_SEND) { - // This should never happen! - Logger - .log("Invalid TERMINAL-TYPE subnegotiation command from remote endpoint: " + //$NON-NLS-1$ - (subnegotiationData[1] & 0xff)); - break; - } - - // Tell the remote endpoint our terminal type is "ansi" using this sequence - // of TELNET protocol bytes: - // - // IAC SB TERMINAL-TYPE IS x t e r m IAC SE - - byte[] terminalTypeData = { TELNET_IAC, TELNET_SB, - TELNET_OPTION_TERMINAL_TYPE, TELNET_IS, (byte) 'x', - (byte) 't', (byte) 'e', (byte) 'r', (byte) 'm', TELNET_IAC, TELNET_SE }; - - try { - outputStream.write(terminalTypeData); - } catch (IOException ex) { - Logger.log("IOException sending TERMINAL-TYPE subnegotiation!"); //$NON-NLS-1$ - Logger.logException(ex); - } - break; - - default: - // This should never happen! - Logger - .log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$ - break; - } - } - - /** - * This method sends a subnegotiation command to the remote endpoint. - * - * @param subnegotiationData An array of Objects holding data to be used - * when generating the outbound subnegotiation - * command. - */ - public void sendSubnegotiation(Object[] subnegotiationData) { - switch (option) { - case TELNET_OPTION_NAWS: - // Get the width and height of the view and send it to the remote - // endpoint using this sequence of TELNET protocol bytes: - // - // IAC SB NAWS - // IAC SE - - byte[] NAWSData = { TELNET_IAC, TELNET_SB, TELNET_OPTION_NAWS, 0, - 0, 0, 0, TELNET_IAC, TELNET_SE }; - int width = ((Integer) subnegotiationData[0]).intValue(); - int height = ((Integer) subnegotiationData[1]).intValue(); - - NAWSData[3] = (byte) ((width >>> 8) & 0xff); // High order byte of width. - NAWSData[4] = (byte) (width & 0xff); // Low order byte of width. - NAWSData[5] = (byte) ((height >>> 8) & 0xff); // High order byte of height. - NAWSData[6] = (byte) (height & 0xff); // Low order byte of height. - - Logger - .log("sending terminal size to remote endpoint: width = " + width + //$NON-NLS-1$ - ", height = " + height + "."); //$NON-NLS-1$ //$NON-NLS-2$ - - // This final local variable is a hack to get around the fact that inner - // classes cannot reference a non-final local variable in a lexically - // enclosing scope. - - final byte[] NAWSDataFinal = NAWSData; - - // Send the NAWS data in a new thread. The current thread is the display - // thread, and calls to write() can block, but blocking the display thread - // is _bad_ (it hangs the GUI). - - Thread t=new Thread() { - public void run() { - try { - outputStream.write(NAWSDataFinal); - } catch (IOException ex) { - Logger.log("IOException sending NAWS subnegotiation!"); //$NON-NLS-1$ - Logger.logException(ex); - } - } - }; - t.setDaemon(true); - t.start(); - break; - - default: - // This should never happen! - Logger - .log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$ - break; - } - } - - /** - * This method returns true if there has not yet been any negotiation of this - * option. - * - * @return Returns true if there has not yet been any negotiation of this option. - */ - protected boolean notYetNegotiated() { - return negotiationState == NEGOTIATION_NOT_STARTED; - } - - /** - * This method terminates the current negotiation and records the time at which the - * negotiation terminated. - */ - protected void endNegotiation() { - Logger.log("Ending negotiation #" + negotiationCount + " for " + //$NON-NLS-1$ //$NON-NLS-2$ - (local ? "local" : "remote") + " option " + optionName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - negotiationState = NEGOTIATION_DONE; - negotiationCompletionTime.setTime(System.currentTimeMillis()); - ++negotiationCount; - } - - /** - * This method determines whether or not to ignore what appears to be a new - * negotiation initiated by the remote endpoint. This is needed because some - * TELNET servers send superfluous option commands that a naive client might - * interpret as the start of a new negotiation. If the superfluous command is not - * ignored, an option negotiation loop can result (which is bad). For details - * about the superfluous commands sent by some servers, see the documentation for - * {@link #NEGOTIATION_NOT_STARTED}.

- * - * The current implementation of this method returns true if the new negotiation - * starts within NEGOTIATION_IGNORE_DURATION seconds of the end of the previous - * negotiation of this option.

- * - * @return Returns true if the new negotiation should be ignored, false if not. - */ - protected boolean ignoreNegotiation() { - return (System.currentTimeMillis() - negotiationCompletionTime.getTime()) < NEGOTIATION_IGNORE_DURATION; - } - - /** - * Sends a DO command to the remote endpoint for this option. - */ - protected void sendDo() { - Logger.log("Sending DO " + optionName()); //$NON-NLS-1$ - sendCommand(TELNET_DO); - } - - /** - * Sends a DONT command to the remote endpoint for this option. - */ - protected void sendDont() { - Logger.log("Sending DONT " + optionName()); //$NON-NLS-1$ - sendCommand(TELNET_DONT); - } - - /** - * Sends a WILL command to the remote endpoint for this option. - */ - protected void sendWill() { - Logger.log("Sending WILL " + optionName()); //$NON-NLS-1$ - sendCommand(TELNET_WILL); - } - - /** - * Sends a WONT command to the remote endpoint for this option. - */ - protected void sendWont() { - Logger.log("Sending WONT " + optionName()); //$NON-NLS-1$ - sendCommand(TELNET_WONT); - } - - /** - * This method sends a WILL/WONT/DO/DONT command to the remote endpoint for this - * option. - */ - protected void sendCommand(byte command) { - byte[] data = { TELNET_IAC, 0, 0 }; - - data[1] = command; - data[2] = option; - - try { - outputStream.write(data); - } catch (IOException ex) { - Logger.log("IOException sending command " + command); //$NON-NLS-1$ - Logger.logException(ex); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetProperties.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetProperties.java deleted file mode 100644 index eafe5b37ffe..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalProperties - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -public class TelnetProperties { - private final NetworkPortMap fNetworkPortMap; - private final String fDefaultHost; - private final String fDefaultNetworkPort; - - public TelnetProperties() { - fNetworkPortMap = new NetworkPortMap(); - fDefaultNetworkPort = fNetworkPortMap.getDefaultNetworkPort(); - fDefaultHost = ""; //$NON-NLS-1$ - } - - public String getDefaultHost() { - return fDefaultHost; - } - - public String getDefaultNetworkPort() { - return fDefaultNetworkPort; - } - - public NetworkPortMap getNetworkPortMap() { - // TODO Auto-generated method stub - return fNetworkPortMap; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java deleted file mode 100644 index a104e093f47..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettings.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalSettings - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public class TelnetSettings implements ITelnetSettings { - protected String fHost; - protected String fNetworkPort; - protected String fTimeout; - private final TelnetProperties fProperties=new TelnetProperties(); - public String getHost() { - return fHost; - } - - public void setHost(String strHost) { - fHost = strHost; - } - - public String getNetworkPortString() { - return fNetworkPort; - } - - public int getNetworkPort() { - try { - return Integer.parseInt(fNetworkPort); - } catch (NumberFormatException numberFormatException) { - return 1313; - } - } - - public void setNetworkPort(String strNetworkPort) { - fNetworkPort = strNetworkPort; - } - - public String getSummary() { - return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$ - } - - public void load(ISettingsStore store) { - fHost = store.get("Host", fProperties.getDefaultHost());//$NON-NLS-1$ - fNetworkPort = store.get("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$ - fTimeout = store.get("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$ - } - - public void save(ISettingsStore store) { - store.put("Host", fHost);//$NON-NLS-1$ - store.put("NetworkPort", fNetworkPort);//$NON-NLS-1$ - store.put("Timeout", fTimeout);//$NON-NLS-1$ - } - - public TelnetProperties getProperties() { - return fProperties; - } - public int getTimeout() { - try { - return Integer.parseInt(fTimeout); - } catch (NumberFormatException numberFormatException) { - return 10; - } - } - public String getTimeoutString() { - return fTimeout; - } - - public void setTimeout(String timeout) { - fTimeout = timeout; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettingsPage.java deleted file mode 100644 index ac286b08fa4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetSettingsPage.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalSettingsDlg - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings - * Martin Oberhuber (Wind River) - [401476] Strip whitespace around Telnet Port - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.telnet; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.fieldassist.FieldDecorationRegistry; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage; - -public class TelnetSettingsPage extends AbstractSettingsPage { - private Text fHostText; - private Combo fNetworkPortCombo; - private Text fTimeout; - private final TelnetSettings fTerminalSettings; - - public TelnetSettingsPage(TelnetSettings settings) { - fTerminalSettings=settings; - } - public void saveSettings() { - fTerminalSettings.setHost(fHostText.getText()); - fTerminalSettings.setTimeout(fTimeout.getText()); - fTerminalSettings.setNetworkPort(getNetworkPort()); - } - - public void loadSettings() { - if(fTerminalSettings!=null) { - setHost(fTerminalSettings.getHost()); - setTimeout(fTerminalSettings.getTimeoutString()); - setNetworkPort(fTerminalSettings.getNetworkPortString()); - } - } - private void setHost(String strHost) { - if(strHost==null) - strHost=""; //$NON-NLS-1$ - fHostText.setText(strHost); - - } - private void setTimeout(String timeout) { - if(timeout==null || timeout.length()==0) - timeout="5"; //$NON-NLS-1$ - fTimeout.setText(timeout); - - } - private void setNetworkPort(String strNetworkPort) { - if (strNetworkPort!=null) { - String strPortName = getNetworkPortMap().findPortName(strNetworkPort); - if(strPortName==null) { - strPortName=strNetworkPort; //fallback to verbatim port if not found - } - int nIndex = fNetworkPortCombo.indexOf(strPortName); - - if (nIndex == -1) { - fNetworkPortCombo.setText(strNetworkPort); - } else { - fNetworkPortCombo.select(nIndex); - } - } - } - private String getNetworkPort() { - String portText = fNetworkPortCombo.getText().trim(); - String mappedPort = getNetworkPortMap().findPort(portText); - return mappedPort!=null ? mappedPort : portText; - } - private NetworkPortMap getNetworkPortMap() { - return fTerminalSettings.getProperties().getNetworkPortMap(); - } - - public boolean validateSettings() { - String message = null; - int messageType = IMessageProvider.NONE; - boolean valid = true; - - if (fHostText.getText().trim().length() == 0) { - String m = "Please enter a host IP or name."; //$NON-NLS-1$ - int mt = IMessageProvider.INFORMATION; - updateControlDecoration(fHostText, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fHostText, null, IMessageProvider.NONE); - } - - try { - int p = Integer.parseInt(getNetworkPort()); - if (p <= 0 || p > 65535) { - String m = "Invalid network port. Must be between 0 and 65535."; //$NON-NLS-1$ - int mt = IMessageProvider.ERROR; - updateControlDecoration(fNetworkPortCombo, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fNetworkPortCombo, null, IMessageProvider.NONE); - } - - p = Integer.parseInt(fTimeout.getText().trim()); - if (p < 0) { - String m = "Invalid timeout. Must be greater than 0."; //$NON-NLS-1$ - int mt = IMessageProvider.ERROR; - updateControlDecoration(fTimeout, m, mt); - if (mt > messageType) { message = m; messageType = mt; } - - valid = false; - } else { - updateControlDecoration(fTimeout, null, IMessageProvider.NONE); - } - - } catch (Exception e) { - valid = false; - } - - setMessage(message, messageType); - return valid; - } - - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(2, false); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); - - composite.setLayout(gridLayout); - composite.setLayoutData(gridData); - - // Add label - Label ctlLabel = new Label(composite, SWT.RIGHT); - ctlLabel.setText(TelnetMessages.HOST + ":"); //$NON-NLS-1$ - - // Add control - gridData = new GridData(GridData.FILL_HORIZONTAL); - fHostText = new Text(composite, SWT.BORDER); - fHostText.setLayoutData(gridData); - fHostText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - fireListeners(fHostText); - } - }); - createControlDecoration(fHostText); - - // Add label - ctlLabel = new Label(composite, SWT.RIGHT); - ctlLabel.setText(TelnetMessages.PORT + ":"); //$NON-NLS-1$ - - // Add control - gridData = new GridData(GridData.FILL_HORIZONTAL); - fNetworkPortCombo = new Combo(composite, SWT.DROP_DOWN); - fNetworkPortCombo.setLayoutData(gridData); - fNetworkPortCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - fireListeners(fNetworkPortCombo); - } - }); - fNetworkPortCombo.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - fireListeners(fNetworkPortCombo); - } - }); - createControlDecoration(fNetworkPortCombo); - - List table = getNetworkPortMap().getNameTable(); - Collections.sort(table); - loadCombo(fNetworkPortCombo, table); - - new Label(composite, SWT.RIGHT).setText(TelnetMessages.TIMEOUT + ":"); //$NON-NLS-1$ - fTimeout = new Text(composite, SWT.BORDER); - fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fTimeout.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - fireListeners(fTimeout); - } - }); - createControlDecoration(fTimeout); - - loadSettings(); - } - private void loadCombo(Combo ctlCombo, List table) { - for (Iterator iter = table.iterator(); iter.hasNext();) { - String label = (String) iter.next(); - ctlCombo.add(label); - } - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/tm32.png b/terminal/plugins/org.eclipse.tm.terminal.telnet/tm32.png deleted file mode 100644 index 3077b1220dd688632a42e347f90c90cb319835f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1q%}g3C{W4d;kClbxA})R9M5U zmtBlqRTam7``mNyow+m9DJ}i5)G6{^3K#>^Vu&CQ#25t%2}(?iH8BDb9!z*JrVsFh z@e3LvhL{Kv6&e(ZZ)if17NZ?PrfJJZm6}reF`b#tow*<9p1t>4%ZGFBbV`tz;J(?} z=bU@*`LFd~|FzcM4#3Q6z#z~l*8!jkB!B_|=m8nf1v2NH=VQkB=5YtO@*N3KF-ROF zR(zp=q-K_upd-L=IU7KIi2->D+y*M8(dwLw{{q61)R6vooD^;e)x0^M!1A=!8p;O?QUo+WFjz`#zY=vf#Y$%xB%% zJ;odRgoJJe&JtltX`T zEF?+dmT&vkw(+f7w|;Hy+O<~zOixcAyzTbe9!Ob?5%rS()xhPzC1$oPbo@~4g~4Dj zB?%`x#%v}SkT^#_;LbU4Wpr_4E~$TC{bk>|?9!oUckFoZhSjTAZ(6FAX0v$)sHGoL zYOU17a^NE897!d?YALOXkP}L@5(h)Ae{Yy6h69Rga3co}&V2XLM_=f!TGf4g-MV#a z@4ox)yS(?^?c2Bi*3?2$yb&#@2YR9F8=>Qgc_4_ADTJWJpol0UhKLn^R72DX15^tm zObbQ;=U~^a*BVbfwRcOq-EITy+`04D?;ksM+MtsHvCQ)vm~Wq27z>%dsya|b(hA*Z z%+L4e<$*kp^m;;`3o#1b3nGfCp(Qw`B^w49uB-;C_02cm{H3c7A3prrFP?bfRWqA2 zvxT(pHPFpwJB`+f=2t7#3VALxNeDsdWuXvS*OT=;Suc?F0(ohGl;Em@s(=-QI%hbH z#5o>(@Ec6e%s1}8|AF77sm)?G2ekSIWI+4OzfON$RU0bGR4dX0M3i1Hl65_;R!+N} z)9vK+a>4sR6eUJQC1M&elf^Lf^>XX2H?U>PCboV1VX|!5*5Tpq4-A`k&~av#KJw#V zhBd3s!?_}^l%>U)VdvDj;x0{7PEF16_PZ@{?=jOC-FJp0^>EHvAQ2qHqOHS~pn zf&6J86s6US8A&*tSE-7SM8!owq*x=EfT|!t`AoN<*9SqwBhe!gPzwwV4KX@8LbX<< zu0ms|!N!dj@Zt*-s3;NzGrb=86`*OK+H|1C;PN_1Bt}7_fEN%UjfGKZ6bMSCUI7cl z*h4~(7;{uSCIuU^1suzqtP8BB4bDHW}f21TQy zLD3kIP^2AEa6V%78jvl5OY9-yiQ)-i1=FWz2|g#ORA{$5?B0E-02k?t)11R5_DvK9 zNE9l|ps~CHk|4p5Xt)TKsH8!mWW{?y>WYdGVy~pXm=|tX#Z5O}&5p-+vVPq#BO`SV z95_aEu8oRfl!Z!_iG34BzrBVKaaBl1D_Art(I6Tc4T%m36)aY8(WnO_srLvW5Pjjf zYGBjG_0;MKKmFP7$$J?GXPc-hq7hRm%X2@y&gNBm-R5x@V?aeoD~_b%u$o~8Dv*eh z27~C(2q6HqoY*ZjAb~AgE+hJ!S6-PQ?`6agFf&91Q$8&PR-*Ff}mVXurq3_k5WrpZpVZb4|R@i6Nk>MPE<>XNxhnb9$cb zS~S3nszjmYd(_+#n0}8h_J3t(EAHE|%NyCd?Ec9~g7?G_5GhjZ9I;UrFsEhzHq30- z)YP7%XG7o^@WC@QJjCeeC}xKD#fGlBdiET2|hKocmGlYQs>;TL}6xnhPg9mFgr_m;vBf5BMuG@@bW)i<}Z~=YAb7~ zT2Wfd_N&<9UH}ZN54x!QSEr_4fB3_yN-=AM5LmNj4Qtn~#mwk*Isgn04bzHk{ylw+ zS6+UN=bm|vOTTwLkfRtPvGf`Y0W;JThZP??D>?_;K1$XpiK~U+IXyj1mSq?ad_YXt zqx(5He}tL#JoQ8KI0xS6{VmRiC@-ikB;0300e$GBJU<%(gBXQov$^Q`d~2R(_P>Cx zti$>NFo+TXhlt=@ike|oHWz1Q=JZzu>}lYksj1hGeq3UwII<8u8^*@iFt&jtar|)S zBOKlJHXCoe27hH0r;hViuI8j3r7<`}({e_J2K{|^-SoG~ci&_0=vP=1jFsVksT6ne96s zxS3BlQZrpR@4Qie^3P3q7gA}LOLR}O4_8I@@@gLG4Gxh^{y7T}5002ovPDHLkV1l5)GaLW_ diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/.classpath b/terminal/plugins/org.eclipse.tm.terminal.test/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal.test/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/.project b/terminal/plugins/org.eclipse.tm.terminal.test/.project deleted file mode 100644 index 492f603b4c0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.tm.terminal.test - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index ac97a9dfa02..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,69 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF deleted file mode 100644 index eabe482ba35..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal.test;singleton:=true -Bundle-Version: 2.3.0.qualifier -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Require-Bundle: org.junit, - org.eclipse.tm.terminal;bundle-version="3.3.0", - org.eclipse.core.runtime, - org.eclipse.ui -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true, - org.eclipse.tm.internal.terminal.emulator;x-internal:=true, - org.eclipse.tm.internal.terminal.model;x-internal:=true, - org.eclipse.tm.internal.terminal.speedtest;x-internal:=true, - org.eclipse.tm.internal.terminal.test.terminalcanvas;x-internal:=true, - org.eclipse.tm.internal.terminal.test.ui;x-internal:=true, - org.eclipse.tm.internal.terminal.textcanvas;x-internal:=true, - org.eclipse.tm.terminal.model, - org.eclipse.tm.terminal.test diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/about.html b/terminal/plugins/org.eclipse.tm.terminal.test/about.html deleted file mode 100644 index a603d19ab21..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/about.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/about.ini b/terminal/plugins/org.eclipse.tm.terminal.test/about.ini deleted file mode 100644 index 3adc27ab587..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=tm32.png - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (not translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/about.properties b/terminal/plugins/org.eclipse.tm.terminal.test/about.properties deleted file mode 100644 index 48839583e07..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. -# -# Do not translate any values surrounded by {} - -blurb=TM Terminal Unit Tests\n\ -\n\ -Version: {featureVersion}\n\ -\n\ -(c) Copyright Wind River Systems, Inc. and others 2007, 2015. All rights reserved.\n\ -Visit http://www.eclipse.org/tm diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/build.properties b/terminal/plugins/org.eclipse.tm.terminal.test/build.properties deleted file mode 100644 index c59c495c94a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Michael Scharf (Wind River) - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - plugin.xml,\ - about.properties,\ - about.ini,\ - tm32.png,\ - test.xml,\ - about.html -src.includes = teamConfig/,\ - about.html diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/plugin.properties b/terminal/plugins/org.eclipse.tm.terminal.test/plugin.properties deleted file mode 100644 index 11477f4a23d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - initial API and implementation -############################################################################### -pluginName = Target Management Terminal Tests -providerName = Eclipse TM Project diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/plugin.xml b/terminal/plugins/org.eclipse.tm.terminal.test/plugin.xml deleted file mode 100644 index 827cde57f29..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/plugin.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml deleted file mode 100644 index f4ab2492681..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal.test - 2.3.0.qualifier - eclipse-test-plugin - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.tm.terminal.test - org.eclipse.tm.terminal.test.AutomatedPluginTests - false - false - true - org.eclipse.sdk.ide - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java deleted file mode 100644 index ae3d55872c6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorFactoryTest.java +++ /dev/null @@ -1,291 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.connector; - -import java.io.OutputStream; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -public class TerminalConnectorFactoryTest extends TestCase { - public class SettingsMock implements ISettingsStore { - - public String get(String key) { - return null; - } - - public String get(String key, String defaultValue) { - return null; - } - - public void put(String key, String value) { - } - - } - public static class TerminalControlMock implements ITerminalControl { - - public void setEncoding(String encoding) { - } - - public String getEncoding() { - return "ISO-8859-1"; //$NON-NLS-1$ - } - - public void displayTextInTerminal(String text) { - } - - public OutputStream getRemoteToTerminalOutputStream() { - return null; - } - - public Shell getShell() { - return null; - } - - public TerminalState getState() { - return null; - } - - public void setMsg(String msg) { - } - - public void setState(TerminalState state) { - } - - public void setTerminalTitle(String title) { - } - - public void setupTerminal(Composite parent) { - } - - public boolean isConnectOnEnterIfClosed() { - return false; - } - - public void setConnectOnEnterIfClosed(boolean on) { - } - - public void setVT100LineWrapping(boolean enable) { - } - - public boolean isVT100LineWrapping() { - return false; - } - } - static class ConnectorMock extends TerminalConnectorImpl { - - public boolean fEcho; - public int fWidth; - public int fHeight; - public ITerminalControl fTerminalControl; - public ISettingsStore fSaveStore; - public ISettingsStore fLoadStore; - public boolean fDisconnect; - - public boolean isLocalEcho() { - return fEcho; - } - public void setTerminalSize(int newWidth, int newHeight) { - fWidth=newWidth; - fHeight=newHeight; - } - public void connect(ITerminalControl control) { - super.connect(control); - fTerminalControl = control; - } - public void doDisconnect() { - fDisconnect=true; - } - - public OutputStream getTerminalToRemoteStream() { - return null; - } - - public String getSettingsSummary() { - return "Summary"; - } - - public void load(ISettingsStore store) { - fLoadStore=store; - } - - public ISettingsPage makeSettingsPage() { - return new ISettingsPage(){ - public void createControl(Composite parent) { - } - public void loadSettings() { - } - public void saveSettings() { - } - public boolean validateSettings() { - return false; - } - public void addListener(Listener listener) { - } - public void removeListener(Listener listener) { - }}; - } - - public void save(ISettingsStore store) { - fSaveStore=store; - } - } - protected TerminalConnector makeTerminalConnector() { - return makeTerminalConnector(new ConnectorMock()); - } - - protected TerminalConnector makeTerminalConnector(final TerminalConnectorImpl mock) { - TerminalConnector c=new TerminalConnector(new TerminalConnector.Factory(){ - public TerminalConnectorImpl makeConnector() throws Exception { - return mock; - } - },"xID","xName", false); - return c; - } - - public void testGetInitializationErrorMessage() { - TerminalConnector c=makeTerminalConnector(); - c.connect(new TerminalControlMock()); - assertNull(c.getInitializationErrorMessage()); - - c=makeTerminalConnector(new ConnectorMock(){ - public void initialize() throws Exception { - throw new Exception("FAILED"); - }}); - c.connect(new TerminalControlMock()); - assertEquals("FAILED",c.getInitializationErrorMessage()); - - } - - public void testGetIdAndName() { - TerminalConnector c=makeTerminalConnector(); - assertEquals("xID", c.getId()); - assertEquals("xName", c.getName()); - } - - public void testIsInitialized() { - TerminalConnector c=makeTerminalConnector(); - assertFalse(c.isInitialized()); - c.getId(); - assertFalse(c.isInitialized()); - c.getName(); - assertFalse(c.isInitialized()); - c.getSettingsSummary(); - assertFalse(c.isInitialized()); - c.setTerminalSize(10,10); - assertFalse(c.isInitialized()); - c.load(null); - assertFalse(c.isInitialized()); - c.save(null); - assertFalse(c.isInitialized()); - if (!Platform.isRunning()) return; - c.getAdapter(ConnectorMock.class); - assertFalse(c.isInitialized()); - } - - public void testConnect() { - TerminalConnector c=makeTerminalConnector(); - assertFalse(c.isInitialized()); - c.connect(new TerminalControlMock()); - assertTrue(c.isInitialized()); - - } - - public void testDisconnect() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - TerminalControlMock control=new TerminalControlMock(); - c.connect(control); - c.disconnect(); - assertTrue(mock.fDisconnect); - } - - public void testGetTerminalToRemoteStream() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - TerminalControlMock control=new TerminalControlMock(); - c.connect(control); - assertSame(mock.fTerminalControl,control); - } - public void testGetSettingsSummary() { - TerminalConnector c=makeTerminalConnector(); - assertEquals("Not Initialized", c.getSettingsSummary()); - c.connect(new TerminalControlMock()); - assertEquals("Summary", c.getSettingsSummary()); - } - - public void testIsLocalEcho() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - assertFalse(c.isLocalEcho()); - mock.fEcho=true; - assertTrue(c.isLocalEcho()); - } - - public void testLoad() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - ISettingsStore s=new SettingsMock(); - c.load(s); - // the load is called after the connect... - assertNull(mock.fLoadStore); - c.connect(new TerminalControlMock()); - assertSame(s,mock.fLoadStore); - } - - public void testSave() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - ISettingsStore s=new SettingsMock(); - c.save(s); - assertNull(mock.fSaveStore); - c.connect(new TerminalControlMock()); - c.save(s); - assertSame(s,mock.fSaveStore); - } - - public void testMakeSettingsPage() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - assertNotNull(c.makeSettingsPage()); - } - - public void testSetTerminalSize() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - c.setTerminalSize(100, 200); - - } - - public void testGetAdapter() { - if (!Platform.isRunning()) return; - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c = makeTerminalConnector(mock); - assertNull(c.getAdapter(ConnectorMock.class)); - // the load is called after the connect... - c.connect(new TerminalControlMock()); - - assertSame(mock, c.getAdapter(ConnectorMock.class)); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorPluginTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorPluginTest.java deleted file mode 100644 index f6abd23cb84..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorPluginTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - *******************************************************************************/ - -package org.eclipse.tm.internal.terminal.connector; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.ConnectorMock; -import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.SimpleFactory; -import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.TerminalControlMock; - -/** - * Testcase for TerminalConnector that must run as a JUnit plug-in test. - */ -public class TerminalConnectorPluginTest extends TestCase { - - public void testIsInitialized() { - if (!Platform.isRunning()) - return; - TerminalConnector c = new TerminalConnector(new SimpleFactory(new ConnectorMock()), "xID", "xName", false); - assertFalse(c.isInitialized()); - c.getId(); - assertFalse(c.isInitialized()); - c.getName(); - assertFalse(c.isInitialized()); - c.isHidden(); - assertFalse(c.isInitialized()); - c.getSettingsSummary(); - assertFalse(c.isInitialized()); - c.setTerminalSize(10, 10); - assertFalse(c.isInitialized()); - c.load(null); - assertFalse(c.isInitialized()); - c.save(null); - assertFalse(c.isInitialized()); - c.getAdapter(ConnectorMock.class); - assertFalse(c.isInitialized()); - } - - public void testGetAdapter() { - if (!Platform.isRunning()) - return; - ConnectorMock mock = new ConnectorMock(); - TerminalConnector c = new TerminalConnector(new SimpleFactory(mock), "xID", "xName", false); - assertNull(c.getAdapter(ConnectorMock.class)); - // the load is called after the connect... - c.connect(new TerminalControlMock()); - - assertSame(mock, c.getAdapter(ConnectorMock.class)); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java deleted file mode 100644 index 23b649c2aa9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalConnectorTest.java +++ /dev/null @@ -1,259 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.connector; - -import java.io.OutputStream; - -import junit.framework.TestCase; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.tm.internal.terminal.connector.TerminalConnector.Factory; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -public class TerminalConnectorTest extends TestCase { - public class SettingsMock implements ISettingsStore { - - public String get(String key) { - return null; - } - - public String get(String key, String defaultValue) { - return null; - } - - public void put(String key, String value) { - } - - } - public static class TerminalControlMock implements ITerminalControl { - - public void setEncoding(String encoding) { - } - - public String getEncoding() { - return "ISO-8859-1"; //$NON-NLS-1$ - } - - public void displayTextInTerminal(String text) { - } - - public OutputStream getRemoteToTerminalOutputStream() { - return null; - } - - public Shell getShell() { - return null; - } - - public TerminalState getState() { - return null; - } - - public void setMsg(String msg) { - } - - public void setState(TerminalState state) { - } - - public void setTerminalTitle(String title) { - } - - public void setupTerminal(Composite parent) { - } - - public boolean isConnectOnEnterIfClosed() { - return false; - } - - public void setConnectOnEnterIfClosed(boolean on) { - } - - public void setVT100LineWrapping(boolean enable) { - } - - public boolean isVT100LineWrapping() { - return false; - } - } - static class ConnectorMock extends TerminalConnectorImpl { - - public boolean fEcho; - public int fWidth; - public int fHeight; - public ITerminalControl fTerminalControl; - public ISettingsStore fSaveStore; - public ISettingsStore fLoadStore; - public boolean fDisconnect; - - public boolean isLocalEcho() { - return fEcho; - } - public void setTerminalSize(int newWidth, int newHeight) { - fWidth=newWidth; - fHeight=newHeight; - } - public void connect(ITerminalControl control) { - super.connect(control); - fTerminalControl = control; - } - public void doDisconnect() { - fDisconnect=true; - } - - public OutputStream getTerminalToRemoteStream() { - return null; - } - - public String getSettingsSummary() { - return "Summary"; - } - - public void load(ISettingsStore store) { - fLoadStore=store; - } - - public ISettingsPage makeSettingsPage() { - return new ISettingsPage(){ - public void createControl(Composite parent) { - } - public void loadSettings() { - } - public void saveSettings() { - } - public boolean validateSettings() { - return false; - } - public void addListener(Listener listener) { - } - public void removeListener(Listener listener) { - }}; - - } - - public void save(ISettingsStore store) { - fSaveStore=store; - } - } - static class SimpleFactory implements Factory { - final TerminalConnectorImpl fConnector; - public SimpleFactory(TerminalConnectorImpl connector) { - fConnector = connector; - } - public TerminalConnectorImpl makeConnector() throws Exception { - // TODO Auto-generated method stub - return fConnector; - } - } - public void testGetInitializationErrorMessage() { - TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false); - c.connect(new TerminalControlMock()); - assertNull(c.getInitializationErrorMessage()); - - c=new TerminalConnector(new SimpleFactory(new ConnectorMock(){ - public void initialize() throws Exception { - throw new Exception("FAILED"); - }}),"xID","xName", false); - c.connect(new TerminalControlMock()); - assertEquals("FAILED",c.getInitializationErrorMessage()); - - } - - public void testGetIdAndName() { - TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false); - assertEquals("xID", c.getId()); - assertEquals("xName", c.getName()); - } - - public void testConnect() { - TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false); - assertFalse(c.isInitialized()); - c.connect(new TerminalControlMock()); - assertTrue(c.isInitialized()); - - } - - public void testDisconnect() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - TerminalControlMock control=new TerminalControlMock(); - c.connect(control); - c.disconnect(); - assertTrue(mock.fDisconnect); - } - - public void testGetTerminalToRemoteStream() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - TerminalControlMock control=new TerminalControlMock(); - c.connect(control); - assertSame(mock.fTerminalControl,control); - } - - public void testGetSettingsSummary() { - TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false); - assertEquals("Not Initialized", c.getSettingsSummary()); - c.connect(new TerminalControlMock()); - assertEquals("Summary", c.getSettingsSummary()); - } - - public void testIsLocalEcho() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - assertFalse(c.isLocalEcho()); - mock.fEcho=true; - assertTrue(c.isLocalEcho()); - } - - public void testLoad() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - ISettingsStore s=new SettingsMock(); - c.load(s); - // the load is called after the connect... - assertNull(mock.fLoadStore); - c.connect(new TerminalControlMock()); - assertSame(s,mock.fLoadStore); - } - - public void testSave() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - ISettingsStore s=new SettingsMock(); - c.save(s); - assertNull(mock.fSaveStore); - c.connect(new TerminalControlMock()); - c.save(s); - assertSame(s,mock.fSaveStore); - } - - public void testMakeSettingsPage() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - assertNotNull(c.makeSettingsPage()); - } - - public void testSetTerminalSize() { - ConnectorMock mock=new ConnectorMock(); - TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false); - c.setTerminalSize(100, 200); - - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStreamTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStreamTest.java deleted file mode 100644 index f6d1a078af3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStreamTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.connector; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; - -import junit.framework.TestCase; - -public class TerminalToRemoteInjectionOutputStreamTest extends TestCase { - final static String ENCODING="UTF-8"; - /** - * This class escapes strings coming on the original - * terminal.. - * - */ - class CleverInterceptor extends TerminalToRemoteInjectionOutputStream.Interceptor { - - public void close() throws IOException { - } - public void write(int b) throws IOException { - fOriginal.write('['); - fOriginal.write(b); - fOriginal.write(']'); - } - public void write(byte[] b, int off, int len) throws IOException { - fOriginal.write('['); - fOriginal.write(b,off,len); - fOriginal.write(']'); - } - - } - class NullInterceptor extends TerminalToRemoteInjectionOutputStream.Interceptor { - } - public void testClose() throws UnsupportedEncodingException, IOException { - ByteArrayOutputStream bs=new ByteArrayOutputStream(); - TerminalToRemoteInjectionOutputStream s= new TerminalToRemoteInjectionOutputStream(bs); - s.write("begin:".getBytes(ENCODING)); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - OutputStream os1=s.grabOutput(); - os1.write('x'); - s.write('A'); - os1.write('y'); - s.write('B'); - os1.close(); - - s.write('-'); - OutputStream os=s.grabOutput(); - // make sure the closed output does not inject anything - try { - os1.write('k'); - fail("..."); - } catch (Exception e) { - } - os.write('X'); - s.write('a'); - os.write('Y'); - // make sure the closed output does not inject anything - try { - os1.write('l'); - fail("..."); - } catch (Exception e) { - } - s.write('b'); - os.close(); - assertEquals("begin:xyAB-XYab", new String(bs.toByteArray(),ENCODING)); - } - - public void testFlush() { - } - - public void testWriteInt() throws UnsupportedEncodingException, IOException { - ByteArrayOutputStream bs=new ByteArrayOutputStream(); - TerminalToRemoteInjectionOutputStream s= new TerminalToRemoteInjectionOutputStream(bs); - s.write("begin:".getBytes(ENCODING)); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - OutputStream os=s.grabOutput(); - os.write('x'); - s.write('A'); - os.write('y'); - s.write('B'); - s.close(); - assertEquals("begin:xyAB", new String(bs.toByteArray(),ENCODING)); - - } - - public void testWriteByteArray() { - } - - public void testWriteByteArrayIntInt() { - } - public void testGrabOutput() throws UnsupportedEncodingException, IOException { - ByteArrayOutputStream bs=new ByteArrayOutputStream(); - TerminalToRemoteInjectionOutputStream s= new TerminalToRemoteInjectionOutputStream(bs); - s.write("begin:".getBytes(ENCODING)); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - OutputStream os1=s.grabOutput(); - OutputStream os2; - try { - os2=s.grabOutput(); - fail("should fail until the foirst output is closed"); - } catch (IOException e) { - } - os1.close(); - os2=s.grabOutput(); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - os2.write("Test".getBytes(ENCODING)); - assertEquals("begin:Test", new String(bs.toByteArray(),ENCODING)); - s.write(" west".getBytes(ENCODING)); - assertEquals("begin:Test", new String(bs.toByteArray(),ENCODING)); - os2.write(" the".getBytes(ENCODING)); - assertEquals("begin:Test the", new String(bs.toByteArray(),ENCODING)); - os2.close(); - assertEquals("begin:Test the west", new String(bs.toByteArray(),ENCODING)); - s.write('!'); - assertEquals("begin:Test the west!", new String(bs.toByteArray(),ENCODING)); - - } - public void testGrabOutputWithCleverInterceptor() throws UnsupportedEncodingException, IOException { - ByteArrayOutputStream bs=new ByteArrayOutputStream(); - TerminalToRemoteInjectionOutputStream s= new TerminalToRemoteInjectionOutputStream(bs); - s.write("begin:".getBytes(ENCODING)); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - // the injector escapes the output coming from the main stream - OutputStream os=s.grabOutput(new CleverInterceptor()); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - os.write("Test".getBytes(ENCODING)); - assertEquals("begin:Test", new String(bs.toByteArray(),ENCODING)); - s.write(" west".getBytes(ENCODING)); - assertEquals("begin:Test[ west]", new String(bs.toByteArray(),ENCODING)); - os.write(" the".getBytes(ENCODING)); - assertEquals("begin:Test[ west] the", new String(bs.toByteArray(),ENCODING)); - s.write('x'); - assertEquals("begin:Test[ west] the[x]", new String(bs.toByteArray(),ENCODING)); - os.close(); - assertEquals("begin:Test[ west] the[x]", new String(bs.toByteArray(),ENCODING)); - s.write('!'); - assertEquals("begin:Test[ west] the[x]!", new String(bs.toByteArray(),ENCODING)); - - } - public void testGrabOutputWithNullInterceptor() throws UnsupportedEncodingException, IOException { - ByteArrayOutputStream bs=new ByteArrayOutputStream(); - TerminalToRemoteInjectionOutputStream s= new TerminalToRemoteInjectionOutputStream(bs); - s.write("begin:".getBytes(ENCODING)); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - // bytes written to the main stream are ignored while the injector - // is active - OutputStream os=s.grabOutput(new NullInterceptor()); - assertEquals("begin:", new String(bs.toByteArray(),ENCODING)); - os.write("Test".getBytes(ENCODING)); - assertEquals("begin:Test", new String(bs.toByteArray(),ENCODING)); - s.write(" west".getBytes(ENCODING)); - assertEquals("begin:Test", new String(bs.toByteArray(),ENCODING)); - os.write(" the".getBytes(ENCODING)); - assertEquals("begin:Test the", new String(bs.toByteArray(),ENCODING)); - s.write('x'); - assertEquals("begin:Test the", new String(bs.toByteArray(),ENCODING)); - os.close(); - assertEquals("begin:Test the", new String(bs.toByteArray(),ENCODING)); - s.write('!'); - assertEquals("begin:Test the!", new String(bs.toByteArray(),ENCODING)); - - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/AllTests.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/AllTests.java deleted file mode 100644 index fd5087d7005..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/AllTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Terminal emulator test cases. - * Runs in emulator package to allow access to default visible items. - */ -public class AllTests extends TestCase { - public AllTests() { - super(null); - } - - public AllTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(AllTests.class.getName()); - suite.addTestSuite(VT100EmulatorBackendTest.class); - return suite; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java deleted file mode 100644 index 0a65fd7ba2a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java +++ /dev/null @@ -1,1381 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1 - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - * Anton Leherbauer (Wind River) - [458218] Add support for ANSI insert mode - * Anton Leherbauer (Wind River) - [458402] Add support for scroll up/down and scroll region - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import junit.framework.TestCase; - -import org.eclipse.tm.internal.terminal.model.TerminalTextDataStore; -import org.eclipse.tm.internal.terminal.model.TerminalTextTestHelper; -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; -import org.eclipse.tm.terminal.model.Style; - -public class VT100EmulatorBackendTest extends TestCase { - - protected IVT100EmulatorBackend makeBakend(ITerminalTextData term) { - return new VT100EmulatorBackend(term); - } - - protected ITerminalTextData makeITerminalTextData() { - return new TerminalTextDataStore(); - } - - protected String toSimple(ITerminalTextData term) { - return TerminalTextTestHelper.toSimple(term); - } - protected String toMultiLineText(ITerminalTextDataReadOnly term) { - return TerminalTextTestHelper.toMultiLineText(term); - } - - protected void fill(ITerminalTextData term, String s) { - TerminalTextTestHelper.fill(term,s); - } - - protected void fillSimple(ITerminalTextData term, String s) { - TerminalTextTestHelper.fillSimple(term, s); - } - - - /** - * Used for multi line text - * @param expected - * @param actual - */ - protected void assertEqualsTerm(String expected,String actual) { - assertEquals(expected.replace(' ', '.'), actual.replace('\000', '.')); - } - /** - * Used for simple text - * @param expected - * @param actual - */ - protected void assertEqualsSimple(String expected,String actual) { - assertEquals(-1,actual.indexOf('\n')); - assertEquals(expected, actual); - } - public void testClearAll() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - fill(term, "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"); - vt100.clearAll(); - assertEqualsTerm( - " \n" + - " \n" + - " ",toMultiLineText(term)); - } - public void testSetDimensions() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - String s = "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"; - fill(term, s); - vt100.setDimensions(3, 4); - assertEquals(3,vt100.getLines()); - assertEquals(4,vt100.getColumns()); - assertEqualsTerm(s,toMultiLineText(term)); - - vt100.setCursor(0, 2); - vt100.setDimensions(2, 4); - assertEquals(0, vt100.getCursorLine()); - assertEquals(2, vt100.getCursorColumn()); - - vt100.setCursor(0, 2); - vt100.setDimensions(5, 4); - assertEquals(3, vt100.getCursorLine()); - assertEquals(2, vt100.getCursorColumn()); - - assertEqualsTerm(s,toMultiLineText(term)); - - vt100.setCursor(0, 3); - vt100.setDimensions(5, 2); - assertEquals(0, vt100.getCursorLine()); - assertEquals(1, vt100.getCursorColumn()); - } - - public void testToAbsoluteLine() { - ITerminalTextData term=makeITerminalTextData(); - VT100EmulatorBackend vt100=new VT100EmulatorBackend(term); - vt100.setDimensions(2, 3); - assertEquals(vt100.toAbsoluteLine(0),0); - // TODO - term=makeITerminalTextData(); - vt100=new VT100EmulatorBackend(term); - vt100.setDimensions(1, 10); - assertEquals(vt100.toAbsoluteLine(0),0); - } - - public void testInsertCharacters() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - String s = - "aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "4567\n" + - "9012"; - fill(term, s); - vt100.setCursor(0, 0); - vt100.insertCharacters(1); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " 123\n" + - "4567\n" + - "9012",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.insertCharacters(1); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "4 56\n" + - "9012",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.insertCharacters(2); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "4 5\n" + - "9012",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 0); - vt100.insertCharacters(10); - assertEqualsTerm(" ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 0); - vt100.insertCharacters(14); - assertEqualsTerm(" ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.insertCharacters(14); - assertEqualsTerm("012 ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.insertCharacters(0); - assertEqualsTerm("0123456789",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.insertCharacters(2); - assertEqualsTerm("012 34567",toMultiLineText(term)); - } - - public void testEraseToEndOfScreen() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - String s = - "aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "4567\n" + - "8901"; - fill(term, s); - vt100.setCursor(0, 0); - vt100.eraseToEndOfScreen(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " \n" + - " ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.eraseToEndOfScreen(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - " \n" + - " ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.eraseToEndOfScreen(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(1,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "4 \n" + - " ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 4); - assertEquals(1,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - vt100.eraseToEndOfScreen(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "456.\n" + - " ",toMultiLineText(term)); - - - fill(term, s); - vt100.setCursor(1, 5); - vt100.eraseToEndOfScreen(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "456.\n" + - " ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(2, 3); - vt100.eraseToEndOfScreen(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "4567\n" + - "890 ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(2, 5); - vt100.eraseToEndOfScreen(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "4567\n" + - "890.",toMultiLineText(term)); - } - - public void testEraseToCursor() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - String s = - "aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "0123\n" + - "4567\n" + - "8901"; - fill(term, s); - vt100.setCursor(0, 0); - vt100.eraseToCursor(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " 123\n" + - "4567\n" + - "8901",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.eraseToCursor(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " 567\n" + - "8901",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.eraseToCursor(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(1,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " 67\n" + - "8901",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 4); - vt100.eraseToCursor(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " \n" + - "8901",toMultiLineText(term)); - - - fill(term, s); - vt100.setCursor(1, 5); - vt100.eraseToCursor(); - assertEquals(1,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " \n" + - "8901",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(2, 3); - vt100.eraseToCursor(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " \n" + - " ",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(2, 5); - vt100.eraseToCursor(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - " \n" + - " \n" + - " ",toMultiLineText(term)); - } - - public void testEraseAll() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - fill(term, "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"); - vt100.eraseAll(); - assertEqualsTerm("0000\n" + - "1111\n" + - "2222\n" + - " \n" + - " \n" + - " ",toMultiLineText(term)); - } - - public void testEraseLine() { - String s = - "abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFGHI"; - - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(0, 3); - vt100.eraseLine(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - " \n" + - "zABCD\n" + - "EFGHI", toMultiLineText(term)); - - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(2, 3); - vt100.eraseLine(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - " ", toMultiLineText(term)); - } - - public void testEraseLineToEnd() { - String s = - "abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFGHI"; - - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(0, 3); - vt100.eraseLineToEnd(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvw \n" + - "zABCD\n" + - "EFGHI", toMultiLineText(term)); - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(0, 0); - vt100.eraseLineToEnd(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - " \n" + - "zABCD\n" + - "EFGHI", toMultiLineText(term)); - - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(2, 3); - vt100.eraseLineToEnd(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFG ", toMultiLineText(term)); - vt100.setDimensions(3, 5); - fill(term, s); - - vt100.setCursor(2, 4); - vt100.eraseLineToEnd(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(4,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFGH ", toMultiLineText(term)); - - vt100.setCursor(2, 5); - vt100.eraseLineToEnd(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(4,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFGH ", toMultiLineText(term)); - - } - - public void testEraseLineToCursor() { - String s = - "abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - "EFGHI"; - - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(0, 3); - vt100.eraseLineToCursor(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - " y\n" + - "zABCD\n" + - "EFGHI", toMultiLineText(term)); - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(0, 0); - vt100.eraseLineToCursor(); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - " vwxy\n" + - "zABCD\n" + - "EFGHI", toMultiLineText(term)); - - - vt100.setDimensions(3, 5); - fill(term, s); - vt100.setCursor(2, 3); - vt100.eraseLineToCursor(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - " I", toMultiLineText(term)); - vt100.setDimensions(3, 5); - fill(term, s); - - vt100.setCursor(2, 4); - vt100.eraseLineToCursor(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(4,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - " ", toMultiLineText(term)); - - vt100.setCursor(2, 5); - vt100.eraseLineToCursor(); - assertEquals(2,vt100.getCursorLine()); - assertEquals(4,vt100.getCursorColumn()); - assertEqualsTerm("abcde\n" + - "fghij\n" + - "klmno\n" + - "pqrst\n" + - "uvwxy\n" + - "zABCD\n" + - " ", toMultiLineText(term)); - - } - - public void testInsertLines() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - String s = "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"; - vt100.setDimensions(3, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.insertLines(1); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - " \n" + - "3333\n" + - "4444", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.insertLines(1); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - " \n" + - "4444", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.insertLines(2); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - " \n" + - " ", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 3); - vt100.insertLines(2); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - " \n" + - " ", toMultiLineText(term)); - - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(1, 3); - vt100.insertLines(2); - assertEqualsTerm( - "0000\n" + - " \n" + - " \n" + - "1111\n" + - "2222\n" + - "3333", toMultiLineText(term)); - - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(1, 3); - vt100.insertLines(7); - assertEqualsTerm( - "0000\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ", toMultiLineText(term)); - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.insertLines(7); - assertEqualsTerm( - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ", toMultiLineText(term)); - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.insertLines(5); - assertEqualsTerm( - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "0000", toMultiLineText(term)); - } - - public void testDeleteCharacters() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - vt100.setDimensions(3, 4); - String s = - "aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "4567\n" + - "9012"; - fill(term, s); - vt100.setCursor(0, 0); - vt100.deleteCharacters(1); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "234 \n" + - "4567\n" + - "9012",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.deleteCharacters(1); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "467 \n" + - "9012",toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 1); - vt100.deleteCharacters(2); - assertEqualsTerm("aaaa\n" + - "bbbb\n" + - "cccc\n" + - "dddd\n" + - "eeee\n" + - "ffff\n" + - "1234\n" + - "47 \n" + - "9012",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 0); - vt100.deleteCharacters(10); - assertEqualsTerm(" ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 0); - vt100.deleteCharacters(14); - assertEqualsTerm(" ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.deleteCharacters(0); - assertEqualsTerm("0123456789",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.deleteCharacters(2); - assertEqualsTerm("01256789 ",toMultiLineText(term)); - - vt100.setDimensions(1, 10); - fill(term, "0123456789"); - vt100.setCursor(0, 3); - vt100.deleteCharacters(14); - assertEqualsTerm("012 ",toMultiLineText(term)); - - } - - public void testDeleteLines() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - String s = "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"; - vt100.setDimensions(3, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.deleteLines(1); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "4444\n" + - "5555\n" + - " ", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.deleteLines(1); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "5555\n" + - " ", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 0); - vt100.deleteLines(2); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - " \n" + - " ", toMultiLineText(term)); - - fill(term, s); - vt100.setCursor(1, 3); - vt100.deleteLines(2); - assertEqualsTerm( - "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - " \n" + - " ", toMultiLineText(term)); - - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(1, 3); - vt100.deleteLines(2); - assertEqualsTerm( - "0000\n" + - "3333\n" + - "4444\n" + - "5555\n" + - " \n" + - " ", toMultiLineText(term)); - - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(1, 3); - vt100.deleteLines(7); - assertEqualsTerm( - "0000\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ", toMultiLineText(term)); - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.deleteLines(7); - assertEqualsTerm( - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ", toMultiLineText(term)); - - vt100.setDimensions(6, 4); - fill(term, s); - vt100.setCursor(0, 0); - vt100.deleteLines(5); - assertEqualsTerm( - "5555\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ", toMultiLineText(term)); - } - - public void testGetDefaultStyle() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - Style style=Style.getStyle("white", "black"); - vt100.setDefaultStyle(style); - assertSame(style, vt100.getDefaultStyle()); - Style style2=style.setBold(true); - vt100.setDefaultStyle(style2); - assertSame(style2, vt100.getDefaultStyle()); - } - - public void testGetStyle() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - Style style=Style.getStyle("white", "black"); - vt100.setStyle(style); - assertSame(style, vt100.getStyle()); - Style style2=style.setBold(true); - vt100.setStyle(style2); - assertSame(style2, vt100.getStyle()); - } - - public void testAppendString() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(6); - vt100.setDimensions(3, 4); - vt100.setCursor(0, 0); - assertEqualsTerm( - " \n" + - " \n" + - " ", toMultiLineText(term)); - vt100.appendString("012"); - assertEqualsTerm( - "012 \n" + - " \n" + - " ", toMultiLineText(term)); - assertEquals(0,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - vt100.appendString("3"); - assertEqualsTerm( - "0123\n" + - " \n" + - " ", toMultiLineText(term)); - assertEquals(1,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - - vt100.appendString("567890"); - assertEqualsTerm( - "0123\n" + - "5678\n" + - "90 ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - - - vt100.appendString("a"); - assertEqualsTerm( - "0123\n" + - "5678\n" + - "90a ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - - vt100.appendString("b"); - assertEqualsTerm( - "0123\n" + - "5678\n" + - "90ab\n" + - " ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - - vt100.appendString("cd"); - assertEqualsTerm( - "0123\n" + - "5678\n" + - "90ab\n" + - "cd ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - - vt100.appendString("efgh"); - assertEqualsTerm( - "0123\n" + - "5678\n" + - "90ab\n" + - "cdef\n" + - "gh ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - - vt100.appendString("ijklmnopqrstuvwx"); - assertEqualsTerm( - "cdef\n" + - "ghij\n" + - "klmn\n" + - "opqr\n" + - "stuv\n" + - "wx ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - - vt100.setCursor(1, 1); - vt100.appendString("123"); - assertEqualsTerm( - "cdef\n" + - "ghij\n" + - "klmn\n" + - "opqr\n" + - "s123\n" + - "wx ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - - vt100.setCursor(1, 1); - vt100.appendString("ABCDEFGHIJKL"); - assertEqualsTerm( - "klmn\n" + - "opqr\n" + - "sABC\n" + - "DEFG\n" + - "HIJK\n" + - "L ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(1,vt100.getCursorColumn()); - - } - - public void testProcessNewline() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - String s = "0000\n" + - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555"; - term.setMaxHeight(6); - vt100.setDimensions(3, 4); - vt100.setCursor(0, 0); - fill(term,s); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.processNewline(); - assertEqualsTerm(s, toMultiLineText(term)); - assertEquals(1,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursorColumn(3); - vt100.processNewline(); - assertEqualsTerm(s, toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - - vt100.processNewline(); - assertEqualsTerm( - "1111\n" + - "2222\n" + - "3333\n" + - "4444\n" + - "5555\n" + - " ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - - - vt100.processNewline(); - assertEqualsTerm( - "2222\n" + - "3333\n" + - "4444\n" + - "5555\n" + - " \n" + - " ", toMultiLineText(term)); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - } - - public void testSetCursorLine() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(6); - vt100.setDimensions(3, 4); - // the cursor still at the beginning.... - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(0, 2); - vt100.setCursorLine(1); - assertEquals(1,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - vt100.setCursor(0, -2); - vt100.setCursorLine(-1); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(0, 10); - vt100.setCursorLine(10); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - } - public void testSetCursorAndSetDimensions() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(3, 4); - // the cursor still at the beginning.... - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setDimensions(6, 4); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(2, 3); - vt100.setDimensions(8, 4); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - } - - public void testSetCursorColumn() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(6); - vt100.setDimensions(3, 4); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(1, 0); - vt100.setCursorColumn(2); - assertEquals(1,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - vt100.setCursor(-1, -2); - vt100.setCursorColumn(-2); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(10, 0); - vt100.setCursorColumn(10); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - } - - public void testSetCursor() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(6); - vt100.setDimensions(3, 4); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(0, 0); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(1, 2); - assertEquals(1,vt100.getCursorLine()); - assertEquals(2,vt100.getCursorColumn()); - vt100.setCursor(-1, -2); - assertEquals(0,vt100.getCursorLine()); - assertEquals(0,vt100.getCursorColumn()); - vt100.setCursor(10, 10); - assertEquals(2,vt100.getCursorLine()); - assertEquals(3,vt100.getCursorColumn()); - } - - public void testVT100LineWrappingOn() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(6, 4); - vt100.setVT100LineWrapping(true); - vt100.appendString("abcd"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("1234"); - vt100.setCursorColumn(0); - vt100.processNewline(); - assertEquals(2, vt100.getCursorLine()); - } - - public void testVT100LineWrappingOff() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(6, 4); - vt100.setVT100LineWrapping(false); - vt100.appendString("abcd"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("1234"); - vt100.setCursorColumn(0); - vt100.processNewline(); - assertEquals(4, vt100.getCursorLine()); - } - - public void testWrappedLines() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(6, 4); - vt100.setVT100LineWrapping(true); - vt100.appendString("abcd123"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("abc"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("1234abcd"); - assertEquals(4, vt100.getCursorLine()); - assertTrue(term.isWrappedLine(0)); - assertFalse(term.isWrappedLine(1)); - assertFalse(term.isWrappedLine(2)); - assertTrue(term.isWrappedLine(3)); - } - - public void testInsertMode() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(4, 6); - // replace mode - vt100.appendString("123"); - vt100.setCursorColumn(0); - vt100.appendString("abc"); - assertEquals("abc", new String(term.getChars(0))); - vt100.clearAll(); - // insert mode - vt100.setCursorColumn(0); - vt100.appendString("123"); - vt100.setCursorColumn(0); - vt100.setInsertMode(true); - vt100.appendString("abc"); - vt100.setInsertMode(false); - assertEquals("abc123", new String(term.getChars(0))); - } - - public void testScrollRegion() { - ITerminalTextData term=makeITerminalTextData(); - IVT100EmulatorBackend vt100=makeBakend(term); - term.setMaxHeight(10); - vt100.setDimensions(8, 6); - vt100.appendString("123"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("456"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("789"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("abc"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("def"); - vt100.setCursorColumn(0); - vt100.processNewline(); - vt100.appendString("ghi"); - - // test scroll within region - vt100.setCursorLine(1); - vt100.setScrollRegion(1, 4); - vt100.scrollUp(1); - assertEquals("123", new String(term.getChars(0))); - assertEquals("789", new String(term.getChars(1))); - assertEquals("abc", new String(term.getChars(2))); - assertEquals("def", new String(term.getChars(3))); - assertNull(term.getChars(4)); - assertEquals("ghi", new String(term.getChars(5))); - vt100.scrollDown(1); - assertEquals("123", new String(term.getChars(0))); - assertNull(term.getChars(1)); - assertEquals("789", new String(term.getChars(2))); - assertEquals("abc", new String(term.getChars(3))); - assertEquals("def", new String(term.getChars(4))); - assertEquals("ghi", new String(term.getChars(5))); - - // test scroll without region - vt100.setScrollRegion(-1, -1); - vt100.scrollDown(1); - assertNull(term.getChars(0)); - assertEquals("123", new String(term.getChars(1))); - assertNull(term.getChars(2)); - assertEquals("789", new String(term.getChars(3))); - assertEquals("abc", new String(term.getChars(4))); - assertEquals("def", new String(term.getChars(5))); - assertEquals("ghi", new String(term.getChars(6))); - vt100.scrollUp(1); - assertEquals("123", new String(term.getChars(0))); - assertNull(term.getChars(1)); - assertEquals("789", new String(term.getChars(2))); - assertEquals("abc", new String(term.getChars(3))); - assertEquals("def", new String(term.getChars(4))); - assertEquals("ghi", new String(term.getChars(5))); - - // test scroll by newline - vt100.setScrollRegion(1, 4); - vt100.setCursorLine(4); - vt100.processNewline(); - assertEquals("123", new String(term.getChars(0))); - assertEquals("789", new String(term.getChars(1))); - assertEquals("abc", new String(term.getChars(2))); - assertEquals("def", new String(term.getChars(3))); - assertNull(term.getChars(4)); - assertEquals("ghi", new String(term.getChars(5))); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java deleted file mode 100644 index 9eff106efbe..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java +++ /dev/null @@ -1,832 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007-2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; -import junit.framework.TestCase; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; -import org.eclipse.tm.terminal.model.LineSegment; -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -abstract public class AbstractITerminalTextDataTest extends TestCase { - abstract protected ITerminalTextData makeITerminalTextData(); - - protected void setUp() throws Exception { - try { - assert false; - throw new Error("No Assertions! Run this code with assertions enabled! (vmargs: -ea)"); - } catch(AssertionError e) { - // OK, assertions are enabled! - } - super.setUp(); - } - protected String toSimple(ITerminalTextData term) { - return TerminalTextTestHelper.toSimple(term); - } - protected String toMultiLineText(ITerminalTextDataReadOnly term) { - return TerminalTextTestHelper.toMultiLineText(term); - } - - protected void fill(ITerminalTextData term, String s) { - TerminalTextTestHelper.fill(term,s); - } - - protected void fill(ITerminalTextData term, int i, int j, String s) { - TerminalTextTestHelper.fill(term,i,j,s); - } - - protected void fillSimple(ITerminalTextData term, String s) { - TerminalTextTestHelper.fillSimple(term, s); - } - - - /** - * Used for multi line text - * @param expected - * @param actual - */ - protected void assertEqualsTerm(String expected,String actual) { - assertEquals(expected, actual); - } - /** - * Used for simple text - * @param expected - * @param actual - */ - protected void assertEqualsSimple(String expected,String actual) { - assertEquals(-1,actual.indexOf('\n')); - assertEquals(expected, actual); - } - public void testGetWidth() { - ITerminalTextData term=makeITerminalTextData(); - assertEquals(0, term.getWidth()); - term.setDimensions(term.getHeight(), 10); - assertEquals(10, term.getWidth()); - term.setDimensions(term.getHeight(), 0); - assertEquals(0, term.getWidth()); - } - - public void testAddLine() { - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - ITerminalTextData term=makeITerminalTextData(); - fill(term, s); - term.setMaxHeight(5); - term.addLine(); - assertEqualsTerm( - "222\n" + - "333\n" + - "444\n" + - "555\n" + - "\000\000\000", toMultiLineText(term)); - } - public void testCleanLine() { - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - ITerminalTextData term=makeITerminalTextData(); - fill(term, s); - term.cleanLine(0); - assertEqualsTerm( - "\000\000\000\n" + - "222\n" + - "333\n" + - "444\n" + - "555", toMultiLineText(term)); - - fill(term, s); - term.cleanLine(4); - assertEqualsTerm( - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "\000\000\000", toMultiLineText(term)); - } - - public void testMaxSize() { - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - ITerminalTextData term=makeITerminalTextData(); - term.setMaxHeight(8); - fill(term, s); - assertEquals(5, term.getHeight()); - assertEquals(8, term.getMaxHeight()); - term.addLine(); - assertEquals(6, term.getHeight()); - assertEqualsTerm( - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555\n" + - "\000\000\000", toMultiLineText(term)); - term.addLine(); - assertEquals(7, term.getHeight()); - assertEqualsTerm( - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555\n" + - "\000\000\000\n" + - "\000\000\000", toMultiLineText(term)); - term.addLine(); - assertEquals(8, term.getHeight()); - assertEqualsTerm( - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000", toMultiLineText(term)); - term.addLine(); - assertEquals(8, term.getHeight()); - assertEqualsTerm( - "222\n" + - "333\n" + - "444\n" + - "555\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000", toMultiLineText(term)); - term.addLine(); - assertEquals(8, term.getHeight()); - assertEqualsTerm( - "333\n" + - "444\n" + - "555\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000\n" + - "\000\000\000", toMultiLineText(term)); - } - public void testGetHeight() { - ITerminalTextData term=makeITerminalTextData(); - assertEquals(0, term.getHeight()); - term.setDimensions(10, term.getWidth()); - assertEquals(10, term.getHeight()); - term.setDimensions(0, term.getWidth()); - assertEquals(0, term.getHeight()); - } - - public void testSetDimensions() { - ITerminalTextData term=makeITerminalTextData(); - assertEquals(0, term.getHeight()); - term.setDimensions(10, 5); - assertEquals(5, term.getWidth()); - assertEquals(10, term.getHeight()); - term.setDimensions(5, 10); - assertEquals(10, term.getWidth()); - assertEquals(5, term.getHeight()); - term.setDimensions(15, 0); - assertEquals(0, term.getWidth()); - assertEquals(15, term.getHeight()); - term.setDimensions(0, 12); - assertEquals(12, term.getWidth()); - assertEquals(0, term.getHeight()); - term.setDimensions(0, 0); - assertEquals(0, term.getWidth()); - assertEquals(0, term.getHeight()); - } - public void testResize() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(3, 5); - String s="12345\n" + - "abcde\n" + - "ABCDE"; - fill(term,0,0,s); - assertEqualsTerm(s, toMultiLineText(term)); - term.setDimensions(3, 4); - assertEqualsTerm( - "1234\n" + - "abcd\n" + - "ABCD", toMultiLineText(term)); - // the columns should be restored - term.setDimensions(3, 5); - assertEqualsTerm( - "12345\n" + - "abcde\n" + - "ABCDE", toMultiLineText(term)); - term.setDimensions(3, 6); - assertEqualsTerm( - "12345\000\n" + - "abcde\000\n" + - "ABCDE\000", toMultiLineText(term)); - term.setChar(0, 5, 'x', null); - term.setChar(1, 5, 'y', null); - term.setChar(2, 5, 'z', null); - assertEqualsTerm( - "12345x\n" + - "abcdey\n" + - "ABCDEz", toMultiLineText(term)); - term.setDimensions(2, 4); - assertEqualsTerm( - "1234\n" + - "abcd", toMultiLineText(term)); - } - - public void testResizeFailure() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(3, 5); - String s="12345\n" + - "abcde\n" + - "ABCDE"; - fill(term,0,0,s); - assertEqualsTerm(s, toMultiLineText(term)); - try { - term.setDimensions(-3, 4); - fail(); - } catch (RuntimeException e) { - // OK - } -// assertEquals(5, term.getWidth()); -// assertEquals(3, term.getHeight()); -// assertEquals(s, toSimpleText(term)); - } - - public void testGetLineSegments() { - Style s1=getDefaultStyle(); - Style s2=s1.setBold(true); - Style s3=s1.setUnderline(true); - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(8, 8); - LineSegment[] segments; - - term.setChars(0, 0,"0123".toCharArray(), s1); - term.setChars(0, 4,"abcd".toCharArray(), null); - segments=term.getLineSegments(0, 0, term.getWidth()); - assertEquals(2, segments.length); - assertSegment(0, "0123", s1, segments[0]); - assertSegment(4, "abcd", null, segments[1]); - - - segments=term.getLineSegments(0, 4, term.getWidth()-4); - assertEquals(1, segments.length); - assertSegment(4, "abcd", null, segments[0]); - - segments=term.getLineSegments(0, 3, 2); - assertEquals(2, segments.length); - assertSegment(3, "3", s1, segments[0]); - assertSegment(4, "a", null, segments[1]); - - segments=term.getLineSegments(0, 7, 1); - assertEquals(1, segments.length); - assertSegment(7, "d", null, segments[0]); - - segments=term.getLineSegments(0, 0, 1); - assertEquals(1, segments.length); - assertSegment(0, "0", s1, segments[0]); - - // line 1 - term.setChars(1, 0,"x".toCharArray(), s1); - term.setChars(1, 1,"y".toCharArray(), s2); - term.setChars(1, 2,"z".toCharArray(), s3); - - segments=term.getLineSegments(1, 0, term.getWidth()); - assertEquals(4, segments.length); - assertSegment(0, "x", s1, segments[0]); - assertSegment(1, "y", s2, segments[1]); - assertSegment(2, "z", s3, segments[2]); - assertSegment(3, "\000\000\000\000\000", null, segments[3]); - - // line 2 - term.setChars(2, 4,"klm".toCharArray(), s1); - segments=term.getLineSegments(2, 0, term.getWidth()); - assertEquals(3, segments.length); - assertSegment(0, "\000\000\000\000", null, segments[0]); - assertSegment(4, "klm", s1, segments[1]); - assertSegment(7, "\000", null, segments[2]); - - // line 3 - segments=term.getLineSegments(3, 0, term.getWidth()); - assertEquals(1, segments.length); - assertSegment(0, "\000\000\000\000\000\000\000\000", null, segments[0]); - - } - public void testGetLineSegmentsNull() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(8, 8); - LineSegment[] segments=term.getLineSegments(0, 0, term.getWidth()); - assertEquals(1, segments.length); - } - public void testGetLineSegmentsOutOfBounds() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(1, 8); - term.setChars(0,0,"xx".toCharArray(),null); - LineSegment[] segments=term.getLineSegments(0, 5, 2); - assertEquals(1, segments.length); - - - } - void assertSegment(int col,String text, Style style,LineSegment segment) { - assertEquals(col, segment.getColumn()); - assertEqualsTerm(text, segment.getText()); - assertEquals(style, segment.getStyle()); - - } - public void testGetChar() { - String s="12345\n" + - "abcde\n" + - "ABCDE"; - ITerminalTextData term=makeITerminalTextData(); - fill(term, s); - assertEquals('1', term.getChar(0,0)); - assertEquals('2', term.getChar(0,1)); - assertEquals('3', term.getChar(0,2)); - assertEquals('4', term.getChar(0,3)); - assertEquals('5', term.getChar(0,4)); - assertEquals('a', term.getChar(1,0)); - assertEquals('b', term.getChar(1,1)); - assertEquals('c', term.getChar(1,2)); - assertEquals('d', term.getChar(1,3)); - assertEquals('e', term.getChar(1,4)); - assertEquals('A', term.getChar(2,0)); - assertEquals('B', term.getChar(2,1)); - assertEquals('C', term.getChar(2,2)); - assertEquals('D', term.getChar(2,3)); - assertEquals('E', term.getChar(2,4)); - try { - term.getChar(0,-1); - fail(); - } catch (RuntimeException e) { - } - try { - term.getChar(-1,-1); - fail(); - } catch (RuntimeException e) { - } - try { - term.getChar(-1,0); - fail(); - } catch (RuntimeException e) { - } - try { - term.getChar(0,5); - fail(); - } catch (RuntimeException e) { - } - try { - term.getChar(3,5); - fail(); - } catch (RuntimeException e) { - } - try { - term.getChar(3,0); - fail(); - } catch (RuntimeException e) { - } - } - - public void testGetStyle() { - ITerminalTextData term=makeITerminalTextData(); - Style style=getDefaultStyle(); - term.setDimensions(6, 3); - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - term.setChar(line, column, c, style.setForground(StyleColor.getStyleColor(""+c))); - } - } - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - assertSame(style.setForground(StyleColor.getStyleColor(""+c)), term.getStyle(line, column)); - } - } - - } - - protected Style getDefaultStyle() { - return Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - } - - public void testSetChar() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(6, 3); - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - term.setChar(line, column, (char)('a'+column+line), null); - } - } - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - assertEquals(c, term.getChar(line,column)); - } - } - assertEqualsTerm( - "abc\n" - + "bcd\n" - + "cde\n" - + "def\n" - + "efg\n" - + "fgh", toMultiLineText(term)); - } - public void testSetChars() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(6, 3); - for (int line = 0; line < term.getHeight(); line++) { - char[] chars=new char[term.getWidth()]; - for (int column = 0; column < term.getWidth(); column++) { - chars[column]=(char)('a'+column+line); - } - term.setChars(line, 0, chars, null); - } - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - assertEquals(c, term.getChar(line,column)); - } - } - assertEqualsTerm( - "abc\n" - + "bcd\n" - + "cde\n" - + "def\n" - + "efg\n" - + "fgh", toMultiLineText(term)); - - term.setChars(3, 1, new char[]{'1','2'}, null); - assertEqualsTerm( - "abc\n" - + "bcd\n" - + "cde\n" - + "d12\n" - + "efg\n" - + "fgh", toMultiLineText(term)); - try { - // check if we cannot exceed the range - term.setChars(4, 1, new char[]{'1','2','3','4','5'}, null); - fail(); - } catch (RuntimeException e) {} - - } - public void testSetCharsLen() { - ITerminalTextData term=makeITerminalTextData(); - String s= "ZYXWVU\n" - + "abcdef\n" - + "ABCDEF"; - fill(term, s); - char[] chars=new char[]{'1','2','3','4','5','6','7','8'}; - term.setChars(1, 0, chars, 0, 6,null); - assertEqualsTerm( - "ZYXWVU\n" - + "123456\n" - + "ABCDEF", toMultiLineText(term)); - - fill(term, s); - term.setChars(1, 0, chars, 0, 5, null); - assertEqualsTerm("ZYXWVU\n" - + "12345f\n" - + "ABCDEF", toMultiLineText(term)); - - fill(term, s); - term.setChars(1, 0, chars, 1, 5, null); - assertEqualsTerm("ZYXWVU\n" - + "23456f\n" - + "ABCDEF", toMultiLineText(term)); - - fill(term, s); - term.setChars(1, 1, chars, 1, 4, null); - assertEqualsTerm("ZYXWVU\n" - + "a2345f\n" - + "ABCDEF", toMultiLineText(term)); - - - - fill(term, s); - term.setChars(1, 2, chars, 3, 4, null); - assertEqualsTerm("ZYXWVU\n" - + "ab4567\n" - + "ABCDEF", toMultiLineText(term)); - - fill(term, s); - try { - term.setChars(1, 0, chars, 7, 10, null); - fail(); - } catch (RuntimeException e) {} - fill(term, s); - try { - term.setChars(1, -1, chars, 0, 2, null); - fail(); - } catch (RuntimeException e) {} - try { - term.setChars(-1, 1, chars, 0, 2, null); - fail(); - } catch (RuntimeException e) {} - try { - term.setChars(1, 10, chars, 0, 2, null); - fail(); - } catch (RuntimeException e) {} - try { - term.setChars(10, 1, chars, 0, 2, null); - fail(); - } catch (RuntimeException e) {} -// assertEquals(s, toSimpleText(term)); - } - public void testSetCopyInto() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(3, 5); - String s="12345\n" + - "abcde\n" + - "ABCDE"; - fill(term,0,0,s); - ITerminalTextData termCopy=makeITerminalTextData(); - termCopy.copy(term); - assertEqualsTerm(s, toMultiLineText(termCopy)); - assertEqualsTerm(s, toMultiLineText(term)); - - termCopy.setChar(1, 1, 'X', null); - assertEqualsTerm(s, toMultiLineText(term)); - term.setDimensions(2, 4); - assertEquals(5, termCopy.getWidth()); - assertEquals(3, termCopy.getHeight()); - - assertEqualsTerm("12345\n" + - "aXcde\n" + - "ABCDE", toMultiLineText(termCopy)); - - assertEquals(4, term.getWidth()); - assertEquals(2, term.getHeight()); - } - public void testSetCopyLines() { - ITerminalTextData term=makeITerminalTextData(); - String s="012345"; - fillSimple(term, s); - ITerminalTextData termCopy=makeITerminalTextData(); - String sCopy="abcde"; - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,0,0); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple(sCopy, toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,0,5); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("01234", toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,0,2); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("01cde", toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,1,2); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("a01de", toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,1,1,2); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("a12de", toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,1,1,4); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("a1234", toSimple(termCopy)); - - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,2,1,4); - assertEqualsSimple(s, toSimple(term)); - assertEqualsSimple("a2345", toSimple(termCopy)); - - try { - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,1,1,5); - fail(); - } catch (RuntimeException e) {} - try { - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,0,6); - fail(); - } catch (RuntimeException e) {} - try { - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,7,0,1); - fail(); - } catch (RuntimeException e) {} - try { - fillSimple(termCopy, sCopy); - termCopy.copyRange(term,0,7,1); - fail(); - } catch (RuntimeException e) {} - } - public void testCopyLine() { - ITerminalTextData term=makeITerminalTextData(); - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - fill(term, s); - ITerminalTextData dest=makeITerminalTextData(); - String sCopy= - "aaa\n" + - "bbb\n" + - "ccc\n" + - "ddd\n" + - "eee"; - fill(dest, sCopy); - copySelective(dest,term,0,0,new boolean []{true,true,false,false,true}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm( - "111\n" + - "222\n" + - "ccc\n" + - "ddd\n" + - "555", toMultiLineText(dest)); - - fill(dest, sCopy); - copySelective(dest,term,0,0,new boolean []{true,true,true,true,true}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm(s, toMultiLineText(dest)); - - fill(dest, sCopy); - copySelective(dest,term,0,0,new boolean []{false,false,false,false,false}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm(sCopy, toMultiLineText(dest)); - } - protected void copySelective(ITerminalTextData dest, ITerminalTextData source, int sourceStartLine, int destStartLine, boolean[] linesToCopy) { - for (int i = 0; i < linesToCopy.length; i++) { - if(linesToCopy[i]) { - dest.copyLine(source, i+sourceStartLine, i+destStartLine); - } - } - } - - public void testCopyLineWithOffset() { - ITerminalTextData term=makeITerminalTextData(); - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - fill(term, s); - ITerminalTextData dest=makeITerminalTextData(); - String sCopy= - "aaa\n" + - "bbb\n" + - "ccc\n" + - "ddd\n" + - "eee"; - fill(dest, sCopy); - copySelective(dest,term,1,0,new boolean []{true,false,false,true}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm( - "222\n" + - "bbb\n" + - "ccc\n" + - "555\n" + - "eee", toMultiLineText(dest)); - - fill(dest, sCopy); - copySelective(dest,term,2,0,new boolean []{true,true}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm( - "333\n" + - "444\n" + - "ccc\n" + - "ddd\n" + - "eee", toMultiLineText(dest)); - - fill(dest, sCopy); - copySelective(dest,term,0,0,new boolean []{true,true,true,true,true}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm(s, toMultiLineText(dest)); - - fill(dest, sCopy); - copySelective(dest,term,0,0,new boolean []{false,false,false,false,false}); - assertEqualsTerm(s, toMultiLineText(term)); - assertEqualsTerm(sCopy, toMultiLineText(dest)); - } - public void testScrollNoop() { - scrollTest(0,0,0, "012345","012345"); - scrollTest(0,1,0, "012345","012345"); - scrollTest(0,6,0, "012345","012345"); - } - public void testScrollAll() { - scrollTest(0,6,1, "012345"," 01234"); - scrollTest(0,6,-1, "012345","12345 "); - scrollTest(0,6,2, "012345"," 0123"); - scrollTest(0,6,-2, "012345","2345 "); - } - public void testScrollNegative() { - scrollTest(0,2,-1,"012345","1 2345"); - scrollTest(0,1,-1,"012345"," 12345"); - scrollTest(0,6,-1,"012345","12345 "); - scrollTest(0,6,-6,"012345"," "); - scrollTest(0,6,-7,"012345"," "); - scrollTest(0,6,-8,"012345"," "); - scrollTest(0,6,-2,"012345","2345 "); - scrollTest(1,1,-1,"012345","0 2345"); - scrollTest(1,1,-1,"012345","0 2345"); - scrollTest(1,2,-1,"012345","02 345"); - scrollTest(5,1,-1,"012345","01234 "); - scrollTest(5,1,-1,"012345","01234 "); - } - public void testScrollNegative2() { - scrollTest(0,2,-1," 23 "," 23 "); - scrollTest(0,1,-1," 23 "," 23 "); - scrollTest(0,6,-1," 23 "," 23 "); - scrollTest(0,6,-6," 23 "," "); - scrollTest(0,6,-7," 23 "," "); - scrollTest(0,6,-8," 23 "," "); - scrollTest(0,6,-2," 23 ","23 "); - scrollTest(1,1,-1," 23 "," 23 "); - scrollTest(1,2,-1," 23 "," 2 3 "); - scrollTest(5,1,-1," 23 "," 23 "); - scrollTest(5,1,-1," 23 "," 23 "); - } - public void testScrollNegative3() { - scrollTest(1,5,-7,"012345","0 "); - } - public void testScrollPositive2() { - scrollTest(2,8,20, "0123456789", "01 "); - } - public void testScrollPositive() { - scrollTest(0,2,1, "012345", " 02345"); - scrollTest(0,2,2, "012345", " 2345"); - scrollTest(2,4,2, "012345", "01 23"); - scrollTest(2,4,2, "0123456", "01 236"); - scrollTest(0,7,6, "0123456", " 0"); - scrollTest(0,7,8, "0123456", " "); - scrollTest(0,7,9, "0123456", " "); - scrollTest(2,4,2, "0123456", "01 236"); - scrollTest(2,5,3, "0123456789", "01 23789"); - scrollTest(2,7,3, "0123456789", "01 23459"); - scrollTest(2,8,3, "0123456789", "01 23456"); - scrollTest(2,8,5, "0123456789", "01 234"); - scrollTest(2,8,9, "0123456789", "01 "); - scrollTest(0,10,9,"0123456789", " 0"); - scrollTest(0,6,6, "012345", " "); - } - public void testScrollFail() { - try { - scrollTest(5,2,-1,"012345","012345"); - fail(); - } catch (RuntimeException e) { - } - try { - scrollTest(0,7,1,"012345"," "); - fail(); - } catch (RuntimeException e) { - } - } - /** - * Makes a simple shift test - * @param line scroll start - * @param n number of lines to be scrolled - * @param shift amount of lines to be shifted - * @param start the original data - * @param result the expected result - */ - void scrollTest(int line,int n, int shift, String start,String result) { - ITerminalTextData term=makeITerminalTextData(); - fillSimple(term,start); - term.scroll(line, n, shift); - assertEqualsSimple(result, toSimple(term)); - } - - public void testWrappedLines() { - ITerminalTextData term=makeITerminalTextData(); - term.setDimensions(4, 4); - for (int i=0; i=windowStart && iTIME) { - System.out.println(label+" "+(n*1000)/(System.currentTimeMillis()-t0)+" setChar()/sec "+ N); - break; - } - } - } - public void testPerformance1() { - ITerminalTextData term=new TerminalTextData(); - method1(term, "1 "); - } - public void testPerformance1a() { - ITerminalTextData term=new TerminalTextData(); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - method1(term, "1a"); - snapshot.updateSnapshot(true); - } - public void testPerformance1b() { - ITerminalTextData term=new TerminalTextData(); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - N=0; - snapshot.addListener(new ITerminalTextDataSnapshot.SnapshotOutOfDateListener(){ - public void snapshotOutOfDate(ITerminalTextDataSnapshot snapshot) { - N++; - }}); - method1(term, "1b"); - snapshot.updateSnapshot(true); - } - private void method1(ITerminalTextData term, String label) { - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - initPerformance(term); - String s="This is a test string"; - long n=0; - long t0=System.currentTimeMillis(); - char[] chars=new char[term.getWidth()]; - for (int i = 0; i < 10000000; i++) { - for (int j = 0; j < chars.length; j++) { - chars[j]=s.charAt((i+j)%s.length()); - } - for (int line = 0; line < term.getHeight(); line++) { - term.setChars(line, 0, chars, style); - n+=chars.length; - } - if(System.currentTimeMillis()-t0>TIME) { - System.out.println(label+" "+(n*1000)/(System.currentTimeMillis()-t0)+" setChars()/sec "+ N); - break; - } - } - } - public void testPerformance2() { - TerminalTextData term=new TerminalTextData(); - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - initPerformance(term); - TerminalTextData copy=new TerminalTextData(); - copy.copy(term); - - String s="This is a test string"; - long n=0; - long t0=System.currentTimeMillis(); - char[] chars=new char[term.getWidth()]; - for (int i = 0; i < 10000000; i++) { - for (int j = 0; j < chars.length; j++) { - chars[j]=s.charAt((i+j)%s.length()); - } - for (int line = 0; line < term.getHeight(); line++) { - term.setChars(line, 0, chars, 0,1,style); - copy.copy(term); - n+=1; - if(System.currentTimeMillis()-t0>TIME) { - System.out.println((n*1000)/(System.currentTimeMillis()-t0)+" copy()/sec"); - return; - } - } - } - } - public void testPerformance2a() { - TerminalTextData term=new TerminalTextData(); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - initPerformance(term); - TerminalTextData copy=new TerminalTextData(); - copy.copy(term); - - String s="This is a test string"; - long n=0; - long t0=System.currentTimeMillis(); - char[] chars=new char[term.getWidth()]; - for (int i = 0; i < 10000000; i++) { - for (int j = 0; j < chars.length; j++) { - chars[j]=s.charAt((i+j)%s.length()); - } - for (int line = 0; line < term.getHeight(); line++) { - term.setChars(line, 0, chars, 0,1,style); - copy.copy(term); - n+=1; - if(System.currentTimeMillis()-t0>TIME) { - System.out.println((n*1000)/(System.currentTimeMillis()-t0)+" copy()/sec"); - return; - } - } - } - snapshot.updateSnapshot(true); - } - int N=0; - public void testPerformance2b() { - TerminalTextData term=new TerminalTextData(); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - N=0; - snapshot.addListener(new ITerminalTextDataSnapshot.SnapshotOutOfDateListener(){ - public void snapshotOutOfDate(ITerminalTextDataSnapshot snapshot) { - N++; - }}); - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - initPerformance(term); - TerminalTextData copy=new TerminalTextData(); - copy.copy(term); - - String s="This is a test string"; - long n=0; - long t0=System.currentTimeMillis(); - char[] chars=new char[term.getWidth()]; - for (int i = 0; i < 10000000; i++) { - for (int j = 0; j < chars.length; j++) { - chars[j]=s.charAt((i+j)%s.length()); - } - for (int line = 0; line < term.getHeight(); line++) { - term.setChars(line, 0, chars, 0,1,style); - copy.copy(term); - n+=1; - if(System.currentTimeMillis()-t0>TIME) { - System.out.println((n*1000)/(System.currentTimeMillis()-t0)+" copy()/sec "+n); - return; - } - } - } - snapshot.updateSnapshot(true); - } - public void testPerformance3() { - TerminalTextData term=new TerminalTextData(); - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - initPerformance(term); - TerminalTextData copy=new TerminalTextData(); - copy.copy(term); - String s="This is a test string"; - long n=0; - long t0=System.currentTimeMillis(); - char[] chars=new char[term.getWidth()]; - for (int i = 0; i < 10000000; i++) { - boolean[] linesToCopy=new boolean[term.getHeight()]; - for (int j = 0; j < chars.length; j++) { - chars[j]=s.charAt((i+j)%s.length()); - } - for (int line = 0; line < term.getHeight(); line++) { - term.setChars(line, 0, chars, 0,1,style); - linesToCopy[line]=true; - copy.copyLine(term,0,0); - linesToCopy[line]=false; - n+=1; - if(System.currentTimeMillis()-t0>TIME) { - System.out.println((n*1000)/(System.currentTimeMillis()-t0)+" copy()/sec"); - return; - } - } - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotTest.java deleted file mode 100644 index 7714e97a13d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotTest.java +++ /dev/null @@ -1,1344 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import junit.framework.TestCase; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -public class TerminalTextDataSnapshotTest extends TestCase { - String toMultiLineText(ITerminalTextDataReadOnly term) { - return TerminalTextTestHelper.toMultiLineText(term); - } - - protected ITerminalTextData makeITerminalTextData() { - return new TerminalTextData(); - } - - - public void testTerminalTextDataSnapshot() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - // new snapshots are fully changed - assertEquals(0,snapshot.getFirstChangedLine()); - assertEquals(term.getHeight()-1,snapshot.getLastChangedLine()); - for (int line = 0; line <= snapshot.getLastChangedLine(); line++) { - assertTrue(snapshot.hasLineChanged(line)); - } - // nothing has scrolled - assertEquals(0, snapshot.getScrollWindowSize()); - } - - public void testDetach() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - assertEquals(toMultiLineText(term),toMultiLineText(snapshot)); - snapshot.detach(); - // after detach changes to the term has no effect - term.setChar(0, 0, '?', null); - assertEquals(s, toMultiLineText(snapshot)); - term.setDimensions(2, 2); - assertEquals(s, toMultiLineText(snapshot)); - } - public void testIsOutOfDate() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - - assertFalse(snapshot.isOutOfDate()); - - // make a change and expect it to be changed - term.setChar(0, 0, '?', null); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - // make a change and expect it to be changed - term.setChars(1, 1, new char[]{'?','!','.'},null); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - // scroll - term.scroll(1, 2, -1); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - // scroll - term.scroll(1, 2, 1); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - // scroll - term.scroll(1, 2, -1); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(true); - assertFalse(snapshot.isOutOfDate()); - - // scroll - term.scroll(1, 2, 1); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(true); - assertFalse(snapshot.isOutOfDate()); - - // setDimensions - term.setDimensions(2, 2); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - // setDimensions - term.setDimensions(20, 20); - assertTrue(snapshot.isOutOfDate()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - - } - ITerminalTextDataSnapshot snapshot(String text, ITerminalTextData term) { - TerminalTextTestHelper.fill(term,text); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - return snapshot; - - } - public void testUpdateSnapshot() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - String termString=toMultiLineText(term); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - assertEquals(termString,toMultiLineText(snapshot)); - - // make changes and assert that the snapshot has not changed - // then update the snapshot and expect it to be the - // same as the changed terminal - - // make a change - term.setChar(0, 0, '?', null); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // make a change - term.setChars(1, 1, new char[]{'?','!','.'},null); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // scroll - term.scroll(1, 2, -1); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // scroll - term.scroll(1, 2, 1); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // scroll - term.scroll(1, 2, -1); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(true); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // scroll - term.scroll(1, 2, 1); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(true); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // set dimensions - term.setDimensions(2, 2); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - - // set dimensions - term.setDimensions(20, 20); - assertEquals(termString,toMultiLineText(snapshot)); - - snapshot.updateSnapshot(false); - termString=toMultiLineText(term); - assertEquals(termString,toMultiLineText(snapshot)); - } - - public void testMaxSize() { - String s= - "111\n" + - "222\n" + - "333\n" + - "444\n" + - "555"; - ITerminalTextData term=makeITerminalTextData(); - term.setMaxHeight(8); - TerminalTextTestHelper.fill(term, s); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(toMultiLineText(term), toMultiLineText(snapshot)); - - } - - - public void testGetChar() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - ITerminalTextData termUnchanged=makeITerminalTextData(); - TerminalTextTestHelper.fill(termUnchanged,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - for (int line = 0; line < snapshot.getHeight(); line++) { - for (int column = 0; column < snapshot.getWidth(); column++) { - assertEquals(term.getChar(line, column),snapshot.getChar(line, column)); - } - } - // make a change - term.setChar(0, 0, '?', null); - // check against unchanged data - for (int line = 0; line < snapshot.getHeight(); line++) { - for (int column = 0; column < snapshot.getWidth(); column++) { - assertEquals(termUnchanged.getChar(line, column),snapshot.getChar(line, column)); - } - } - // update and compare against the terminal - snapshot.updateSnapshot(true); - for (int line = 0; line < snapshot.getHeight(); line++) { - for (int column = 0; column < snapshot.getWidth(); column++) { - assertEquals(term.getChar(line, column),snapshot.getChar(line, column)); - } - } - - } - - public void testGetHeight() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - int expectedHeight=term.getHeight(); - assertEquals(expectedHeight, snapshot.getHeight()); - term.setDimensions(term.getHeight()-1, term.getWidth()); - assertEquals(expectedHeight, snapshot.getHeight()); - - // - snapshot.updateSnapshot(false); - expectedHeight=term.getHeight(); - assertEquals(expectedHeight, snapshot.getHeight()); - term.setDimensions(term.getHeight()-1, term.getWidth()); - assertEquals(expectedHeight, snapshot.getHeight()); - } -// -// public void testGetLineSegments() { -// fail("Not yet implemented"); -// } -// - public void testGetStyle() { - ITerminalTextData term=makeITerminalTextData(); - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - term.setDimensions(6, 3); - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - term.setChar(line, column, c, style.setForground(StyleColor.getStyleColor(""+c))); - } - } - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - - for (int line = 0; line < term.getHeight(); line++) { - for (int column = 0; column < term.getWidth(); column++) { - char c=(char)('a'+column+line); - assertSame(style.setForground(StyleColor.getStyleColor(""+c)), snapshot.getStyle(line, column)); - } - } - - } - - public void testGetWidth() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - int expectedWidth=term.getWidth(); - assertEquals(expectedWidth, snapshot.getWidth()); - term.setDimensions(term.getHeight(), term.getWidth()-1); - assertEquals(expectedWidth, snapshot.getWidth()); - - // - snapshot.updateSnapshot(false); - expectedWidth=term.getWidth(); - assertEquals(expectedWidth, snapshot.getWidth()); - term.setDimensions(term.getHeight(), term.getWidth()-1); - assertEquals(expectedWidth, snapshot.getWidth()); - } - - public void testGetFirstChangedLine() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - ITerminalTextDataSnapshot snapshot=snapshot(s,term); - - - assertEquals(0, snapshot.getFirstChangedLine()); - - // if nothing has changed the first changed line i height - snapshot.updateSnapshot(false); - assertEquals(Integer.MAX_VALUE, snapshot.getFirstChangedLine()); - - snapshot=snapshot(s,term); - term.setChar(0, 0, 'x', null); - snapshot.updateSnapshot(false); - assertEquals(0, snapshot.getFirstChangedLine()); - - snapshot=snapshot(s,term); - term.setChar(3, 0, 'x', null); - term.setChar(4, 0, 'x', null); - snapshot.updateSnapshot(false); - assertEquals(3, snapshot.getFirstChangedLine()); - - snapshot=snapshot(s,term); - term.scroll(0, 1, -1); - snapshot.updateSnapshot(false); - assertEquals(0, snapshot.getFirstChangedLine()); - - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - snapshot.updateSnapshot(false); - assertEquals(2, snapshot.getFirstChangedLine()); - - // when scrolling the end of the region 'has changed' - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - snapshot.updateSnapshot(true); - assertEquals(3, snapshot.getFirstChangedLine()); - - // when scrolling the end of the region 'has changed' - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - term.setChar(1, 0, 'x', null); - snapshot.updateSnapshot(true); - assertEquals(1, snapshot.getFirstChangedLine()); - - } - public void testGetLastChangedLine() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - ITerminalTextDataSnapshot snapshot=snapshot(s,term); - - - assertEquals(4, snapshot.getLastChangedLine()); - - // if nothing has changed the first changed line i height - snapshot.updateSnapshot(false); - assertEquals(-1, snapshot.getLastChangedLine()); - - snapshot=snapshot(s,term); - term.setChar(0, 0, 'x', null); - snapshot.updateSnapshot(false); - assertEquals(0, snapshot.getLastChangedLine()); - - snapshot=snapshot(s,term); - term.cleanLine(1); - snapshot.updateSnapshot(false); - assertEquals(1, snapshot.getLastChangedLine()); - - snapshot=snapshot(s,term); - term.setChar(3, 0, 'x', null); - term.setChar(4, 0, 'x', null); - snapshot.updateSnapshot(false); - assertEquals(4, snapshot.getLastChangedLine()); - - snapshot=snapshot(s,term); - term.scroll(0, 1, -1); - snapshot.updateSnapshot(false); - assertEquals(0, snapshot.getLastChangedLine()); - - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - snapshot.updateSnapshot(false); - assertEquals(3, snapshot.getLastChangedLine()); - - // when scrolling the end of the region 'has changed' - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - snapshot.updateSnapshot(true); - assertEquals(3, snapshot.getLastChangedLine()); - - // when scrolling the end of the region 'has changed' - snapshot=snapshot(s,term); - term.scroll(2, 2, -1); - term.setChar(1, 0, 'x', null); - snapshot.updateSnapshot(true); - assertEquals(3, snapshot.getLastChangedLine()); - - } - /** - * @param snapshot - * @param expected a string of 0 and 1 (1 means changed) - */ - void assertChangedLines(ITerminalTextDataSnapshot snapshot, String expected) { - assertEquals(expected.length(),snapshot.getHeight()); - StringBuffer buffer=new StringBuffer(); - for (int line = 0; line < expected.length(); line++) { - if(snapshot.hasLineChanged(line)) - buffer.append('1'); - else - buffer.append('0'); - } - assertEquals(expected, buffer.toString()); - } - public void testHasLineChangedScroll() { - ITerminalTextData term=makeITerminalTextData(); - String s="00\n" + - "11\n" + - "22\n" + - "33\n" + - "44\n" + - "55\n" + - "66\n" + - "77\n" + - "88\n" + - "99"; - ITerminalTextDataSnapshot snapshot=snapshot(s,term); - - term.scroll(2,3,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0000100000"); - - snapshot=snapshot(s,term); - term.scroll(2,3,-2); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0001100000"); - - snapshot=snapshot(s,term); - term.scroll(2,4,-1); - term.scroll(2,4,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0000110000"); - - term.scroll(2,3,1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0011100000"); - - snapshot=snapshot(s,term); - term.scroll(2,3,2); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0011100000"); - - snapshot=snapshot(s,term); - term.scroll(2,4,1); - term.scroll(2,4,1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0011110000"); - - - snapshot=snapshot(s,term); - term.scroll(2,3,-1); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot, "0011100000"); - - snapshot=snapshot(s,term); - term.scroll(2,3,-2); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot, "0011100000"); - - snapshot=snapshot(s,term); - term.scroll(2,4,-1); - term.scroll(2,4,-1); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot, "0011110000"); - } - public void testMultiScrollWithDifferentSizes() { - ITerminalTextData term=makeITerminalTextData(); - String s="00\n" + - "11\n" + - "22\n" + - "33\n" + - "44\n" + - "55\n" + - "66\n" + - "77\n" + - "88\n" + - "99"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.scroll(2,6,-1); - term.scroll(2,5,-1); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot, "0011111100"); - assertEquals(2, snapshot.getFirstChangedLine()); - assertEquals(7, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowShift()); - - // scrolls with different ranges cause no scroll - // optimization - snapshot=snapshot(s,term); - term.scroll(2,6,-1); - term.scroll(2,5,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0011111100"); - assertEquals(2, snapshot.getFirstChangedLine()); - assertEquals(7, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowShift()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - } - public void testHasLineChanged() { - ITerminalTextData term=makeITerminalTextData(); - String s="000000\n" + - "111111\n" + - "222222\n" + - "333333\n" + - "444444\n" + - "555555\n" + - "666666\n" + - "777777\n" + - "888888\n" + - "999999"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.scroll(2,3,-1); - term.setChar(7, 0, '.', null); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0000100100"); - - snapshot=snapshot(s,term); - term.scroll(2,3,-2); - term.setChar(9, 0, '.', null); - term.setChars(0, 0, new char[]{'.','!'}, null); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1001100001"); - - snapshot=snapshot(s,term); - term.scroll(2,4,-1); - term.scroll(2,4,-1); - term.setChars(2, 2, new char[]{'.','!','*'},1,1, null); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0010110000"); - - snapshot=snapshot(s,term); - term.scroll(2,7,-1); - term.setChar(5, 2, '.', null); - term.scroll(2,7,-2); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0001001110"); - - - snapshot=snapshot(s,term); - term.scroll(2,7,-1); - term.setChar(5, 2, '.', null); - term.scroll(2,7,-2); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot, "0011111110"); - - } - - public void testScroll() { - ITerminalTextData term=makeITerminalTextData(); - String s="00\n" + - "11\n" + - "22\n" + - "33\n" + - "44\n" + - "55\n" + - "66\n" + - "77\n" + - "88\n" + - "99"; - ITerminalTextDataSnapshot snapshot=snapshot(s,term); - - term.scroll(2,3,-1); - snapshot.updateSnapshot(true); - assertEquals(2, snapshot.getScrollWindowStartLine()); - assertEquals(3, snapshot.getScrollWindowSize()); - assertEquals(-1, snapshot.getScrollWindowShift()); - assertEquals(4, snapshot.getFirstChangedLine()); - assertEquals(4, snapshot.getLastChangedLine()); - - term.scroll(2,3,-2); - snapshot.updateSnapshot(true); - assertEquals(2, snapshot.getScrollWindowStartLine()); - assertEquals(3, snapshot.getScrollWindowSize()); - assertEquals(-2, snapshot.getScrollWindowShift()); - assertEquals(3, snapshot.getFirstChangedLine()); - assertEquals(4, snapshot.getLastChangedLine()); - - term.scroll(2,4,-1); - term.scroll(2,4,-1); - snapshot.updateSnapshot(true); - assertEquals(2, snapshot.getScrollWindowStartLine()); - assertEquals(4, snapshot.getScrollWindowSize()); - assertEquals(-2, snapshot.getScrollWindowShift()); - assertEquals(4, snapshot.getFirstChangedLine()); - assertEquals(5, snapshot.getLastChangedLine()); - - - snapshot=snapshot(s,term); - term.scroll(2,3,-1); - snapshot.updateSnapshot(false); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - assertEquals(2, snapshot.getFirstChangedLine()); - assertEquals(4, snapshot.getLastChangedLine()); - - } - public void testDisjointScroll() { - ITerminalTextData term=makeITerminalTextData(); - String s="000000\n" + - "111111\n" + - "222222\n" + - "333333\n" + - "444444\n" + - "555555\n" + - "666666\n" + - "777777\n" + - "888888\n" + - "999999"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.scroll(0,2,-1); - term.scroll(4,2,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1100110000"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.scroll(0,3,-1); - term.scroll(2,2,-2); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111000000"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.scroll(0,3,-1); - term.scroll(2,2,-2); - term.scroll(0,3,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111000000"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.scroll(0,3,-1); - term.scroll(2,2,-2); - term.scroll(0,3,-10); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111000000"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.scroll(1,3,-1); - term.scroll(1,3,1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "0111000000"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - } - public void testResize() { - ITerminalTextData term=makeITerminalTextData(); - String s="000000\n" + - "111111\n" + - "222222\n" + - "333333"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.setDimensions(term.getHeight(), term.getWidth()+1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111"); - assertEquals(0, snapshot.getFirstChangedLine()); - assertEquals(3, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.setDimensions(term.getHeight()+1, term.getWidth()); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "11111"); - assertEquals(0, snapshot.getFirstChangedLine()); - assertEquals(4, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.setDimensions(term.getHeight()-1, term.getWidth()); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "111"); - assertEquals(0, snapshot.getFirstChangedLine()); - assertEquals(2, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.setDimensions(0, 0); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, ""); - assertEquals(0, snapshot.getFirstChangedLine()); - assertEquals(-1, snapshot.getLastChangedLine()); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - } - public void testResizeAfterScroll() { - ITerminalTextData term=makeITerminalTextData(); - String s="000000\n" + - "111111\n" + - "222222\n" + - "333333\n" + - "444444\n" + - "555555\n" + - "666666\n" + - "777777\n" + - "888888\n" + - "999999"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.scroll(1,2,-1); - term.setDimensions(5, 4); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "11111"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - - snapshot=snapshot(s,term); - term.scroll(1,2,-1); - term.setDimensions(7, 2); - term.scroll(4,2,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111111"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - snapshot=snapshot(s,term); - - term.scroll(1,2,-1); - term.setDimensions(term.getHeight(),term.getWidth()+1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "1111111111"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - } - public void testScrollAfterResize() { - ITerminalTextData term=makeITerminalTextData(); - String s="000000\n" + - "111111\n" + - "222222\n" + - "333333\n" + - "444444\n" + - "555555\n" + - "666666\n" + - "777777\n" + - "888888\n" + - "999999"; - ITerminalTextDataSnapshot snapshot; - - snapshot=snapshot(s,term); - term.setDimensions(14, 6); - term.scroll(0,14,-1); - snapshot.updateSnapshot(true); - assertChangedLines(snapshot, "11111111111111"); - assertEquals(0, snapshot.getScrollWindowStartLine()); - assertEquals(0, snapshot.getScrollWindowSize()); - assertEquals(0, snapshot.getScrollWindowShift()); - } - private final class SnapshotListener implements ITerminalTextDataSnapshot.SnapshotOutOfDateListener { - int N; - public void snapshotOutOfDate(ITerminalTextDataSnapshot snapshot) { - N++; - } - public void reset() { - N=0; - } - } - - public void testAddListener() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - SnapshotListener listener=new SnapshotListener(); - snapshot.addListener(listener); - assertEquals(0, listener.N); - - // make a change and expect it to be changed - term.setChar(0, 0, '?', null); - assertEquals(1, listener.N); - term.setChar(1, 1, '?', null); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // make a change and expect it to be changed - term.setChars(1, 1, new char[]{'?','!','.'},null); - assertEquals(1, listener.N); - term.setChars(2, 1, new char[]{'?','!','.'},null); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // scroll - term.scroll(1, 2, -1); - assertEquals(1, listener.N); - term.scroll(1, 2, -1); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // scroll - term.scroll(1, 2, 1); - assertEquals(1, listener.N); - term.scroll(1, 2, 1); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // scroll - term.scroll(1, 2, -1); - assertEquals(1, listener.N); - term.scroll(1, 2, -1); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // scroll - term.scroll(1, 2, 1); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // setDimensions - term.setDimensions(2, 2); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener.N); - listener.reset(); - - // setDimensions - term.setDimensions(20, 20); - assertEquals(1, listener.N); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - } - - public void testRemoveListener() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - - SnapshotListener listener1=new SnapshotListener(); - SnapshotListener listener2=new SnapshotListener(); - SnapshotListener listener3=new SnapshotListener(); - snapshot.addListener(listener1); - snapshot.addListener(listener2); - snapshot.addListener(listener3); - assertEquals(0, listener1.N); - - // make a change and expect it to be changed - term.setChar(0, 0, '?', null); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - term.setChar(1, 1, '?', null); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - listener1.reset(); - listener2.reset(); - listener3.reset(); - - // make a change and expect it to be changed - term.setChars(1, 1, new char[]{'?','!','.'},null); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - term.setChars(2, 1, new char[]{'?','!','.'},null); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - listener1.reset(); - listener2.reset(); - listener3.reset(); - - snapshot.removeListener(listener2); - - // scroll - term.scroll(1, 2, -1); - assertEquals(1, listener1.N); - assertEquals(0, listener2.N); - assertEquals(1, listener3.N); - - term.scroll(1, 2, -1); - assertEquals(1, listener1.N); - assertEquals(0, listener2.N); - assertEquals(1, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(0, listener2.N); - assertEquals(1, listener3.N); - - snapshot.addListener(listener2); - listener1.reset(); - listener2.reset(); - listener3.reset(); - - - snapshot.removeListener(listener3); - // scroll - term.scroll(1, 2, 1); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(0, listener3.N); - - term.scroll(1, 2, 1); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(0, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(0, listener3.N); - - snapshot.addListener(listener3); - listener1.reset(); - listener2.reset(); - listener3.reset(); - - // add listener multiple times - snapshot.addListener(listener3); - - // scroll - term.scroll(1, 2, -1); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(2, listener3.N); - - term.scroll(1, 2, -1); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(2, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(2, listener3.N); - - listener1.reset(); - listener2.reset(); - listener3.reset(); - // remove the duplicate listener - snapshot.removeListener(listener3); - - - // scroll - term.scroll(1, 2, 1); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - listener1.reset(); - listener2.reset(); - listener3.reset(); - - - // setDimensions - term.setDimensions(2, 2); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - - snapshot.updateSnapshot(false); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - listener1.reset(); - listener2.reset(); - listener3.reset(); - - - // setDimensions - term.setDimensions(20, 20); - assertEquals(1, listener1.N); - assertEquals(1, listener2.N); - assertEquals(1, listener3.N); - - - snapshot.updateSnapshot(false); - assertFalse(snapshot.isOutOfDate()); - } - public void testWindowOfInterest() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - snapshot.setInterestWindow(7, 4); - snapshot.setInterestWindow(9, 4); - snapshot.updateSnapshot(false); - } - public void testWindowOfInterest2() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - snapshot.updateSnapshot(false); - term.scroll(7, 3,-1); - snapshot.setInterestWindow(9, 4); - snapshot.updateSnapshot(false); - } - public void testAddLine() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - term.setMaxHeight(20); - snapshot.updateSnapshot(false); - assertEquals(10,term.getHeight()); - assertEquals(20,term.getMaxHeight()); - assertFalse(snapshot.isOutOfDate()); - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - assertEquals(11,term.getHeight()); - assertEquals(10,snapshot.getHeight()); - snapshot.updateSnapshot(false); - assertEquals(11,term.getHeight()); - assertEquals(11,snapshot.getHeight()); - assertEquals(20,term.getMaxHeight()); - - term.addLine(); - term.addLine(); - assertEquals(11,snapshot.getHeight()); - assertEquals(13,term.getHeight()); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertEquals(13,snapshot.getHeight()); - assertEquals(13,term.getHeight()); - assertEquals(20,term.getMaxHeight()); - } - public void testHasDimensionsChanged() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - term.setMaxHeight(20); - snapshot.setInterestWindow(3, 4); - snapshot.updateSnapshot(false); - assertEquals(10,term.getHeight()); - assertEquals(20,term.getMaxHeight()); - assertFalse(snapshot.isOutOfDate()); - term.addLine(); - assertTrue(snapshot.isOutOfDate()); - assertEquals(11,term.getHeight()); - assertEquals(10,snapshot.getHeight()); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasDimensionsChanged()); - assertEquals(11,term.getHeight()); - assertEquals(11,snapshot.getHeight()); - assertEquals(20,term.getMaxHeight()); - - term.addLine(); - term.addLine(); - assertEquals(11,snapshot.getHeight()); - assertEquals(13,term.getHeight()); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasDimensionsChanged()); - assertEquals(13,snapshot.getHeight()); - assertEquals(13,term.getHeight()); - assertEquals(20,term.getMaxHeight()); - } - public void testCursor() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - term.setMaxHeight(20); - snapshot.setInterestWindow(3, 4); - snapshot.updateSnapshot(false); - term.setCursorLine(2); - term.setCursorColumn(1); - snapshot.updateSnapshot(false); - assertEquals(2, snapshot.getCursorLine()); - assertEquals(1, snapshot.getCursorColumn()); - term.setCursorLine(3); - term.setCursorColumn(2); - snapshot.updateSnapshot(false); - assertEquals(3, snapshot.getCursorLine()); - assertEquals(2, snapshot.getCursorColumn()); - } - public void testCursor2() { - ITerminalTextData term=makeITerminalTextData(); - TerminalTextTestHelper.fillSimple(term,"0123456789"); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - term.setMaxHeight(20); - snapshot.setInterestWindow(3, 4); - snapshot.updateSnapshot(false); - term.setCursorLine(2); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - term.setCursorColumn(1); - assertTrue(snapshot.isOutOfDate()); - } - public void testHasTerminalChanged() { - ITerminalTextData term=makeITerminalTextData(); - String s="12345\n" + - "abcde\n" + - "ABCDE\n" + - "vwxzy\n" + - "VWXYZ"; - TerminalTextTestHelper.fill(term,s); - - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - assertTrue(snapshot.hasTerminalChanged()); - snapshot.updateSnapshot(false); - - assertTrue(snapshot.hasTerminalChanged()); - - // make a change and expect it to be changed - term.setChar(0, 0, '?', null); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - // make a change and expect it to be changed - term.setChars(1, 1, new char[]{'?','!','.'},null); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - // scroll - term.scroll(1, 2, -1); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - // scroll - term.scroll(1, 2, 1); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - // scroll - term.scroll(1, 2, -1); - snapshot.updateSnapshot(true); - assertTrue(snapshot.hasTerminalChanged()); - - // scroll - term.scroll(1, 2, 1); - snapshot.updateSnapshot(true); - assertTrue(snapshot.hasTerminalChanged()); - - // setDimensions - term.setDimensions(2, 2); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - // setDimensions - term.setDimensions(20, 20); - snapshot.updateSnapshot(false); - assertTrue(snapshot.hasTerminalChanged()); - - snapshot.updateSnapshot(false); - assertFalse(snapshot.hasTerminalChanged()); - - // window of interest changes should NOT set hasTerminalChanged - snapshot.updateSnapshot(false); - snapshot.setInterestWindow(7, 4); - - assertFalse(snapshot.hasTerminalChanged()); - } - public void testGetTerminalTextData() { - ITerminalTextData term=makeITerminalTextData(); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - assertSame(term, snapshot.getTerminalTextData()); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotWindowTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotWindowTest.java deleted file mode 100644 index 130c68da290..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshotWindowTest.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import junit.framework.TestCase; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; - -public class TerminalTextDataSnapshotWindowTest extends TestCase { - String toMultiLineText(ITerminalTextDataReadOnly term) { - return TerminalTextTestHelper.toMultiLineText(term); - } - String toSimpleText(ITerminalTextDataReadOnly term) { - return TerminalTextTestHelper.toSimple(term); - } - - protected ITerminalTextData makeITerminalTextData() { - return new TerminalTextData(); - } - ITerminalTextDataSnapshot snapshotSimple(String text, ITerminalTextData term) { - TerminalTextTestHelper.fillSimple(term,text); - ITerminalTextDataSnapshot snapshot=term.makeSnapshot(); - return snapshot; - - } - /** - * @param snapshot - * @param expected a string of 0 and 1 (1 means changed) - */ - void assertChangedLines(ITerminalTextDataSnapshot snapshot, String expected) { - assertEquals(expected.length(),snapshot.getHeight()); - StringBuffer buffer=new StringBuffer(); - for (int line = 0; line < expected.length(); line++) { - if(snapshot.hasLineChanged(line)) - buffer.append('1'); - else - buffer.append('0'); - } - assertEquals(expected, buffer.toString()); - } - - public void testSetInterestWindow() { - ITerminalTextData term=makeITerminalTextData(); - ITerminalTextDataSnapshot snapshot=snapshotSimple("0123456789",term); - assertEquals(0, snapshot.getInterestWindowStartLine()); - assertEquals(-1, snapshot.getInterestWindowSize()); - snapshot.setInterestWindow(2, 3); - assertEquals(2, snapshot.getInterestWindowStartLine()); - assertEquals(3, snapshot.getInterestWindowSize()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0011100000"); - } - public void testSetChar() { - ITerminalTextData term=makeITerminalTextData(); - ITerminalTextDataSnapshot snapshot=snapshotSimple("0123456789",term); - snapshot.setInterestWindow(2, 3); - snapshot.updateSnapshot(false); - assertEquals(" 234 ", toSimpleText(snapshot)); - - term.setChar(0, 0, 'x', null); - assertFalse(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000000000"); - - term.setChar(1, 0, 'x', null); - assertFalse(snapshot.isOutOfDate()); - - term.setChar(2, 0, 'x', null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0010000000"); - - term.setChar(3, 0, 'x', null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0001000000"); - - term.setChar(4, 0, 'x', null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000100000"); - - term.setChar(5, 0, 'x', null); - assertFalse(snapshot.isOutOfDate()); - - term.setChar(6, 0, 'x', null); - assertFalse(snapshot.isOutOfDate()); - - for (int i = 0; i < 9; i++) { - term.setChar(i, 0, (char)('a'+i), null); - } - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0011100000"); - } - - public void testSetChars() { - ITerminalTextData term=makeITerminalTextData(); - ITerminalTextDataSnapshot snapshot=snapshotSimple("0123456789",term); - snapshot.setInterestWindow(2, 3); - snapshot.updateSnapshot(false); - assertEquals(" 234 ", toSimpleText(snapshot)); - - term.setChars(0, 0, "x".toCharArray(), null); - assertFalse(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000000000"); - - term.setChars(1, 0, "x".toCharArray(), null); - assertFalse(snapshot.isOutOfDate()); - - term.setChars(2, 0, "x".toCharArray(), null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0010000000"); - - term.setChars(3, 0, "x".toCharArray(), null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0001000000"); - - term.setChars(4, 0, "x".toCharArray(), null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000100000"); - - term.setChars(5, 0, "x".toCharArray(), null); - assertFalse(snapshot.isOutOfDate()); - - term.setChars(6, 0, "x".toCharArray(), null); - assertFalse(snapshot.isOutOfDate()); - for (int i = 0; i < 9; i++) { - term.setChars(i, 0, (i+"").toCharArray(), null); - } - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0011100000"); - } - public void testSetChars2() { - ITerminalTextData term=makeITerminalTextData(); - ITerminalTextDataSnapshot snapshot=snapshotSimple("0123456789",term); - snapshot.setInterestWindow(2, 3); - snapshot.updateSnapshot(false); - assertEquals(" 234 ", toSimpleText(snapshot)); - - term.setChars(0, 0, "abcdef".toCharArray(),2,1, null); - assertFalse(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000000000"); - - term.setChars(1, 0, "abcdef".toCharArray(),2 ,1, null); - assertFalse(snapshot.isOutOfDate()); - - term.setChars(2, 0, "abcdef".toCharArray(),2 ,1, null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0010000000"); - - term.setChars(3, 0, "abcdef".toCharArray(),2 ,1, null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0001000000"); - - term.setChars(4, 0, "abcdef".toCharArray(),2 ,1, null); - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0000100000"); - - term.setChars(5, 0, "abcdef".toCharArray(),2 ,1, null); - assertFalse(snapshot.isOutOfDate()); - - term.setChars(6, 0, "abcdef".toCharArray(),2 ,1, null); - assertFalse(snapshot.isOutOfDate()); - for (int i = 0; i < 9; i++) { - term.setChars(i, 0, ("ab"+i+"def").toCharArray(),2 ,1, null); - } - assertTrue(snapshot.isOutOfDate()); - snapshot.updateSnapshot(false); - assertChangedLines(snapshot,"0011100000"); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStoreTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStoreTest.java deleted file mode 100644 index 0e2955da705..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStoreTest.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - -public class TerminalTextDataStoreTest extends AbstractITerminalTextDataTest { - protected ITerminalTextData makeITerminalTextData() { - return new TerminalTextDataStore(); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataTest.java deleted file mode 100644 index 274d246eafb..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataTest.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - -public class TerminalTextDataTest extends AbstractITerminalTextDataTest { - protected ITerminalTextData makeITerminalTextData() { - return new TerminalTextData(); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java deleted file mode 100644 index 752c8b06056..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java +++ /dev/null @@ -1,494 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1 - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import java.util.ArrayList; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.LineSegment; -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -public class TerminalTextDataWindowTest extends AbstractITerminalTextDataTest { - int fOffset; - int fSize; - public TerminalTextDataWindowTest() { - fOffset=2; - fSize=2; - } - protected ITerminalTextData makeITerminalTextData() { - TerminalTextDataWindow term=new TerminalTextDataWindow(); - term.setWindow(fOffset,fSize); - return term; - } - /** - * Used for multi line text - * @param expected - * @param actual - */ - protected void assertEqualsTerm(String expected,String actual) { - assertEquals(stripMultiLine(expected), stripMultiLine(actual)); - } - private String stripMultiLine(String s) { - StringBuffer b=new StringBuffer(); - // String[] lines=s.split("\n"); - // - ArrayList l = new ArrayList(); - int j = 0; - for (int k = 0; k < s.length(); k++) { - if (s.charAt(k) == '\n') { - l.add(s.substring(j, k)); - j = k; - } - } - j = l.size() - 1; - while (j >= 0 && "".equals(l.get(j))) { - j--; - } - String[] lines = new String[j + 1]; - while (j >= 0) { - lines[j] = (String) l.get(j); - j--; - } - // - for (int i = 0; i < lines.length; i++) { - if(i>0) - b.append("\n"); //$NON-NLS-1$ - if(i>=fOffset && i=fOffset && i=fOffset&&line=fOffset&&line=fOffset&&line0) - buff.append("\n"); //$NON-NLS-1$ - for (int column = 0; column < width; column++) { - buff.append(term.getChar(line, column)); - } - } - return buff.toString(); - } - static public String toSimple(String str) { - //return str.replaceAll("\000", " ").replaceAll("\n", ""); - // - StringBuffer buf = new StringBuffer(str.length()); - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - switch (c) { - case '\000': - buf.append(' '); - break; - case '\n': - break; - default: - buf.append(c); - break; - } - } - return buf.toString(); - // - } - /** - * @param term - * @param s each character is one line - */ - static public void fillSimple(ITerminalTextData term, String s) { - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - term.setDimensions(s.length(), 1); - for (int i = 0; i < s.length(); i++) { - char c=s.charAt(i); - term.setChar(i, 0, c, style.setForground(StyleColor.getStyleColor(""+c))); - } - } - /** - * @param term - * @param s lines separated by \n. The terminal will automatically - * resized to fit the text. - */ - static public void fill(ITerminalTextData term, String s) { - int width=0; - int len=0; - int height=0; - for (int i = 0; i < s.length(); i++) { - char c=s.charAt(i); - if(c=='\n') { - width=Math.max(width,len); - len=0; - } else { - if(len==0) - height++; - len++; - } - } - width=Math.max(width,len); - term.setDimensions(height, width); - fill(term,0,0,s); - } - - static public void fill(ITerminalTextData term, int column, int line, String s) { - int xx=column; - int yy=line; - Style style=Style.getStyle(StyleColor.getStyleColor("fg"), StyleColor.getStyleColor("bg"), false, false, false, false); - for (int i = 0; i < s.length(); i++) { - char c=s.charAt(i); - if(c=='\n') { - yy++; - xx=column; - } else { - term.setChar(yy, xx, c, style.setForground(StyleColor.getStyleColor(""+c))); - xx++; - } - } - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnection.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnection.java deleted file mode 100644 index fbf9deb1d24..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnection.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.speedtest; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; - -import org.eclipse.swt.widgets.Display; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -public class SpeedTestConnection extends Thread { - private static int fgNo; - private final ITerminalControl fControl; - private final InputStream fInputStream; - private final SpeedTestSettings fSettings; - protected SpeedTestConnection(InputStream inputStream, SpeedTestSettings settings,ITerminalControl control) { - super("SpeedTestConnection-"+fgNo++); - fControl = control; - fInputStream=inputStream; - fSettings=settings; - } - public void run() { - fControl.setState(TerminalState.CONNECTED); - - try { - readDataForever(fInputStream,fControl.getRemoteToTerminalOutputStream()); - } catch (IOException e) { - connectFailed(e.getMessage(),e.getMessage()); - } - // when reading is done, we set the state to closed - fControl.setState(TerminalState.CLOSED); - } - private void connectFailed(String terminalText, String msg) { - Logger.log(terminalText); - fControl.displayTextInTerminal(terminalText); - fControl.setState(TerminalState.CLOSED); - fControl.setMsg(msg); - } - /** - * Read the data from the input file and display it in the terminal. - * @param in - * @throws IOException - */ - private void readDataForever(InputStream in, OutputStream os) throws IOException { - long N=0; - long T=0; - long tDisplay=0; - int NCalls=0; - int bufferSize=fSettings.getBufferSize(); - int throttle=fSettings.getThrottle(); - // read the data - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - // read until the thread gets interrupted.... - String info=""; - int n=0; - byte[] crnl="\r\n".getBytes("UTF-8"); - long t0=System.currentTimeMillis(); - String line=null; - do { - line=reader.readLine(); - - // read some bytes - if(line!=null) { - os.write(line.getBytes("UTF-8")); - os.write(crnl); - n+=line.length(); - } - // process at least this number of characters to update the UI - if(line==null || n>bufferSize) { - if(throttle>0) - sleep(throttle); - // we assume we get ASCII UTF8 bytes - long t=System.currentTimeMillis(); - T+=t-t0; - N+=n; - NCalls++; - if(t-tDisplay>1000 && T>0) { - long rate=(1000*N)/T; - info=rate+" byte/s = "+rate*8+" baud "+"bytes/call="+N/NCalls; - info=rate+" byte/s with buffer size "+fSettings.getBufferSize(); - setTitle(info); - tDisplay=System.currentTimeMillis(); - } - n=0; - t0=System.currentTimeMillis(); - } - } while(line!=null); - } - private void sleep(int ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - private void setTitle(final String title) { - Display.getDefault().asyncExec(new Runnable(){ - public void run() { - fControl.setTerminalTitle(title); - }}); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java deleted file mode 100644 index 4f397a59989..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestConnector.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.speedtest; - -import java.io.BufferedInputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -public class SpeedTestConnector extends TerminalConnectorImpl { - final SpeedTestSettings fSettings=new SpeedTestSettings(); - InputStream fInputStream; - OutputStream fOutputStream; - SpeedTestConnection fConnection; - public SpeedTestConnector() { - } - synchronized public void connect(ITerminalControl control) { - super.connect(control); - fControl.setState(TerminalState.CONNECTING); - String file=fSettings.getInputFile(); - try { - fInputStream=new BufferedInputStream(new FileInputStream(file)); - } catch (FileNotFoundException e) { - disconnect(); - fControl.setMsg(file+": "+e.getLocalizedMessage()); - return; - } - fOutputStream=System.out; - fControl.setTerminalTitle(fSettings.getInputFile()); - fConnection=new SpeedTestConnection(fInputStream,fSettings,fControl); - fConnection.start(); - } - - synchronized public void doDisconnect() { - if(fConnection!=null){ - fConnection.interrupt(); - fConnection=null; - } - if (fInputStream != null) { - try { - fInputStream.close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - fInputStream=null; - if (fOutputStream != null) { - try { - fOutputStream.close(); - } catch (Exception exception) { - Logger.logException(exception); - } - } - fOutputStream=null; - } - synchronized public InputStream getInputStream() { - return fInputStream; - } - - synchronized public OutputStream getTerminalToRemoteStream() { - return fOutputStream; - } - - public String getSettingsSummary() { - return fSettings.getInputFile(); - } - - public void initialize() { - //throw new RuntimeException("XXX problems\nSpeedTest\nXXX!"); - } - - public void load(ISettingsStore store) { - fSettings.load(store); - } - - public ISettingsPage makeSettingsPage() { - return new SpeedTestSettingsPage(fSettings); - } - - public void save(ISettingsStore store) { - fSettings.save(store); - } - - public void setTerminalSize(int newWidth, int newHeight) { - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java deleted file mode 100644 index 5a94d828516..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettings.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.speedtest; - - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; - -public class SpeedTestSettings { - String fInputFile=""; - String fBufferSize=""; - String fThrottle; - String getInputFile() { - return fInputFile; - } - public String getBufferSizeString() { - return getBufferSize()+""; - } - public void setBufferSizeString(String bufferSize) { - fBufferSize = bufferSize; - } - public int getBufferSize() { - try { - return Integer.parseInt(fBufferSize); - } catch(RuntimeException e) { - return 1024; - } - } - void setInputFile(String testFile) { - fInputFile = testFile; - } - public void load(ISettingsStore store) { - fInputFile=store.get("inputFile"); - fBufferSize=store.get("bufferSize"); - fThrottle=store.get("throttle"); - } - public void save(ISettingsStore store) { - store.put("inputFile", fInputFile); - store.put("bufferSize", fBufferSize); - store.put("throttle", fThrottle); - } - public String getThrottleString() { - return fThrottle; - } - public int getThrottle() { - try { - return Integer.parseInt(fThrottle); - } catch(RuntimeException e) { - return 0; - } - } - public void setThrottleString(String throttle) { - fThrottle = throttle; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettingsPage.java deleted file mode 100644 index f48a7027e93..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/speedtest/SpeedTestSettingsPage.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.speedtest; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage; - -public class SpeedTestSettingsPage extends AbstractSettingsPage { - final SpeedTestSettings fSettings; - Text fInputFile; - Text fBufferSize; - private Text fThrottle; - SpeedTestSettingsPage(SpeedTestSettings settings) { - fSettings=settings; - } - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(2, false); - - composite.setLayout(gridLayout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fInputFile=createTextField(composite, "Input File:");//$NON-NLS-1$ - fBufferSize=createTextField(composite, "Buffer Size:");//$NON-NLS-1$ - fThrottle=createTextField(composite, "Throttle:");//$NON-NLS-1$ - loadSettings(); - } - private Text createTextField(Composite composite, String label) { - new Label(composite, SWT.RIGHT).setText(label); - Text text = new Text(composite, SWT.BORDER); - text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - return text; - } - - public void loadSettings() { - setText(fInputFile, fSettings.getInputFile()); - setText(fBufferSize, fSettings.getBufferSizeString()); - setText(fThrottle, fSettings.getThrottleString()); - } - private void setText(Text text, String value) { - if(value==null) - value=""; - text.setText(value); - } - - public void saveSettings() { - fSettings.setInputFile(fInputFile.getText()); - fSettings.setBufferSizeString(fBufferSize.getText()); - fSettings.setThrottleString(fThrottle.getText()); - } - - public boolean validateSettings() { - return true; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Main.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Main.java deleted file mode 100644 index 5e9f73d01a8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Main.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.terminalcanvas; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - Display display = new Display (); - Shell shell = new Shell (display); - shell.setLayout(new FillLayout()); - new TerminalTextCanvas(shell,SWT.NONE); - shell.setSize (200, 150); - shell.open (); - while (!shell.isDisposed ()) { - if (!display.readAndDispatch ()) display.sleep (); - } - display.dispose (); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java deleted file mode 100644 index a3d21af78d4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/Snippet48.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.terminalcanvas; - - -/* - * Canvas example snippet: scroll an image (flicker free, no double buffering) - * - * For a list of all SWT example snippets see - * http://www.eclipse.org/swt/snippets/ - */ -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.swt.widgets.Shell; - -public class Snippet48 { - -public static void main (String [] args) { - Display display = new Display (); - Shell shell = new Shell (display); - shell.setLayout(new FillLayout()); - Image originalImage = null; - FileDialog dialog = new FileDialog (shell, SWT.OPEN); - dialog.setText ("Open an image file or cancel"); - String string = dialog.open (); - if (string != null) { - originalImage = new Image (display, string); - } - final Image image = originalImage; - final Point origin = new Point (0, 0); - final Canvas canvas = new Canvas (shell, SWT.NO_BACKGROUND | - SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL); - final ScrollBar hBar = canvas.getHorizontalBar (); - hBar.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event e) { - int hSelection = hBar.getSelection (); - int destX = -hSelection - origin.x; - Rectangle rect = image.getBounds (); - canvas.scroll (destX, 0, 0, 0, rect.width, rect.height, false); - origin.x = -hSelection; - } - }); - final ScrollBar vBar = canvas.getVerticalBar (); - vBar.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event e) { - int vSelection = vBar.getSelection (); - int destY = -vSelection - origin.y; - Rectangle rect = image.getBounds (); - canvas.scroll (0, destY, 0, 0, rect.width, rect.height, false); - origin.y = -vSelection; - } - }); - canvas.addListener (SWT.Resize, new Listener () { - public void handleEvent (Event e) { - Rectangle rect = image.getBounds (); - Rectangle client = canvas.getClientArea (); - hBar.setMaximum (rect.width); - vBar.setMaximum (rect.height); - hBar.setThumb (Math.min (rect.width, client.width)); - vBar.setThumb (Math.min (rect.height, client.height)); - int hPage = rect.width - client.width; - int vPage = rect.height - client.height; - int hSelection = hBar.getSelection (); - int vSelection = vBar.getSelection (); - if (hSelection >= hPage) { - if (hPage <= 0) hSelection = 0; - origin.x = -hSelection; - } - if (vSelection >= vPage) { - if (vPage <= 0) vSelection = 0; - origin.y = -vSelection; - } - canvas.redraw (); - } - }); - canvas.addListener (SWT.Paint, new Listener () { - public void handleEvent (Event e) { - GC gc = e.gc; - gc.drawImage (image, origin.x, origin.y); - Rectangle rect = image.getBounds (); - Rectangle client = canvas.getClientArea (); - int marginWidth = client.width - rect.width; - if (marginWidth > 0) { - gc.fillRectangle (rect.width, 0, marginWidth, client.height); - } - int marginHeight = client.height - rect.height; - if (marginHeight > 0) { - gc.fillRectangle (0, rect.height, client.width, marginHeight); - } - } - }); - shell.setSize (200, 150); - shell.open (); - while (!shell.isDisposed ()) { - if (!display.readAndDispatch ()) display.sleep (); - } - originalImage.dispose(); - display.dispose (); -} - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/TerminalTextCanvas.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/TerminalTextCanvas.java deleted file mode 100644 index a99fd9062db..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/TerminalTextCanvas.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.terminalcanvas; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.ScrollBar; - -public class TerminalTextCanvas extends Canvas { - Image image; - Point origin = new Point (0, 0); - public TerminalTextCanvas(Composite parent, int style) { - super(parent, SWT.NO_BACKGROUND | - SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL| style); - loadImage(parent); - - final ScrollBar hBar = getHorizontalBar (); - hBar.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event e) { - int hSelection = hBar.getSelection (); - int destX = -hSelection - origin.x; - Rectangle rect = image.getBounds (); - scroll (destX, 0, 0, 0, rect.width, rect.height, false); - origin.x = -hSelection; - } - }); - final ScrollBar vBar = getVerticalBar (); - vBar.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event e) { - int vSelection = vBar.getSelection (); - int destY = -vSelection - origin.y; - Rectangle rect = image.getBounds (); - scroll (0, destY, 0, 0, rect.width, rect.height, false); - origin.y = -vSelection; - } - }); - addListener (SWT.Resize, new Listener () { - public void handleEvent (Event e) { - Rectangle rect = image.getBounds (); - Rectangle client = getClientArea (); - hBar.setMaximum (rect.width); - vBar.setMaximum (rect.height); - hBar.setThumb (Math.min (rect.width, client.width)); - vBar.setThumb (Math.min (rect.height, client.height)); - int hPage = rect.width - client.width; - int vPage = rect.height - client.height; - int hSelection = hBar.getSelection (); - int vSelection = vBar.getSelection (); - if (hSelection >= hPage) { - if (hPage <= 0) hSelection = 0; - origin.x = -hSelection; - } - if (vSelection >= vPage) { - if (vPage <= 0) vSelection = 0; - origin.y = -vSelection; - } - redraw (); - } - }); - addListener (SWT.Paint, new Listener () { - public void handleEvent (Event e) { - GC gc = e.gc; - System.out.println(gc.getClipping()+" "+origin); - gc.drawImage (image, origin.x, origin.y); - Rectangle rect = image.getBounds (); - Rectangle client = getClientArea (); - int marginWidth = client.width - rect.width; - if (marginWidth > 0) { - gc.fillRectangle (rect.width, 0, marginWidth, client.height); - } - int marginHeight = client.height - rect.height; - if (marginHeight > 0) { - gc.fillRectangle (0, rect.height, client.width, marginHeight); - } - } - }); - } - private void loadImage(Composite parent) { - FileDialog dialog = new FileDialog (parent.getShell(), SWT.OPEN); - dialog.setText ("Open an image file or cancel"); - String string = dialog.open (); - if (string != null) { - image = new Image (getDisplay(), string); - } - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/VirtualCanvas.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/VirtualCanvas.java deleted file mode 100644 index bf0ba0fc7da..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/terminalcanvas/VirtualCanvas.java +++ /dev/null @@ -1,333 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.terminalcanvas; - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.ScrollBar; - -/** - * A Canvas showing a virtual object. - * Virtual: the extent of the total canvas. - * Screen: the visible client area in the screen. - */ -public abstract class VirtualCanvas extends Canvas { - - private final Rectangle fVirtualBounds = new Rectangle(0,0,0,0); - private Rectangle fClientArea; - private GC fPaintGC=null; - public VirtualCanvas(Composite parent, int style) { - super(parent, style|SWT.NO_BACKGROUND|SWT.NO_REDRAW_RESIZE); - fPaintGC= new GC(this); - addListener(SWT.Paint, new Listener() { - public void handleEvent(Event event) { - paint(event.gc); - } - }); - addListener(SWT.Resize, new Listener() { - public void handleEvent(Event event) { - fClientArea=getClientArea(); - updateViewRectangle(); - } - }); - getVerticalBar().addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - scrollY((ScrollBar)e.widget); - postScrollEventHandling(e); - - } - - }); - getHorizontalBar().addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - scrollX((ScrollBar)e.widget); - postScrollEventHandling(e); - - } - }); - addDisposeListener(new DisposeListener(){ - public void widgetDisposed(DisposeEvent e) { - if(fPaintGC!=null){ - fPaintGC.dispose(); - fPaintGC=null; - } - } - - }); - } - public void setAutoSelect(boolean on) { - } - public boolean hasAutoSelect() { - return false; - } - public void doAutoSelect() { - } - - /** HACK: run an event loop if the scrollbar is dragged...*/ - private void postScrollEventHandling(Event e) { - if(true&&e.detail==SWT.DRAG) { - // TODO check if this is always ok??? - // used to process runnables while scrolling - // This fixes the update problems when scrolling! - // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=47582#5 - // TODO investigate: - // The alternative is to call redraw on the new visible area - // redraw(expose.x, expose.y, expose.width, expose.height, true); - - while (!getDisplay().isDisposed() && getDisplay().readAndDispatch()) { - // do nothing here... - } - } - } - - protected void scrollX(ScrollBar hBar) { - int hSelection = hBar.getSelection (); - int destX = -hSelection - fVirtualBounds.x; - fVirtualBounds.x = -hSelection; - scrollSmart(destX, 0); - updateViewRectangle(); - } - protected void scrollXDelta(int delta) { - getHorizontalBar().setSelection(-fVirtualBounds.x+delta); - scrollX(getHorizontalBar()); - } - - protected void scrollY(ScrollBar vBar) { - int vSelection = vBar.getSelection (); - int destY = -vSelection - fVirtualBounds.y; - fVirtualBounds.y = -vSelection; - scrollSmart(0,destY); - updateViewRectangle(); - - } - protected void scrollYDelta(int delta) { - getVerticalBar().setSelection(-fVirtualBounds.y+delta); - scrollY(getVerticalBar()); - } - - - private void scrollSmart(int deltaX, int deltaY) { - Rectangle rect = getBounds(); - scroll (deltaX, deltaY, 0, 0, rect.width, rect.height, false); - } - - protected void revealRect(Rectangle rect) { - Rectangle visibleRect=getScreenRectInVirtualSpace(); - // scroll the X part - int deltaX=0; - if(rect.x0||marginHeight>0){ - Color bg=getBackground(); - gc.setBackground(getBackgroundCanvasColor()); - if (marginWidth > 0) { - gc.fillRectangle (width, clipping.y, marginWidth, clipping.height); - } - if (marginHeight > 0) { - gc.fillRectangle (clipping.x, height, clipping.width, marginHeight); - } - gc.setBackground(bg); - } - } - /** - * @private - */ - protected boolean inClipping(Rectangle clipping, Rectangle r) { - // TODO check if this is OK in all cases (the <=!) - // - if(r.x+r.width<=clipping.x) - return false; - if(clipping.x+clipping.width<=r.x) - return false; - if(r.y+r.height<=clipping.y) - return false; - if(clipping.y+clipping.height<=r.y) - return false; - - return true; - } - /** - * @return the screen rect in virtual space (starting with (0,0)) - * of the visible screen. (x,y>=0) - */ - protected Rectangle getScreenRectInVirtualSpace() { - return new Rectangle(fClientArea.x-fVirtualBounds.x,fClientArea.y-fVirtualBounds.y,fClientArea.width,fClientArea.height); - } - /** - * @return the rect in virtual space (starting with (0,0)) - * of the visible screen. (x,y>=0) - */ - protected Rectangle getRectInVirtualSpace(Rectangle r) { - return new Rectangle(r.x-fVirtualBounds.x,r.y-fVirtualBounds.y,r.width,r.height); - } - - /** - * Sets the extend of the virtual dieplay ares - * @param width - * @param height - */ - protected void setVirtualExtend(int width, int height) { - fVirtualBounds.width=width; - fVirtualBounds.height=height; - updateScrollbars(); - updateViewRectangle(); - } - /** - * sets the scrolling origin. Also sets the scrollbars. - * Does NOT redraw! - * Use negative values (move the virtual origin to the top left - * to see something in the screen (which is located at (0,0)) - * @param x - * @param y - */ - protected void setVirtualOrigin(int x, int y) { - fVirtualBounds.x=x; - fVirtualBounds.y=y; - getHorizontalBar().setSelection(x); - getVerticalBar().setSelection(y); - updateViewRectangle(); - } - - /** - * @param x - * @return the virtual coordinate in scree space - */ - protected int virtualXtoScreen(int x) { - return x+fVirtualBounds.x; - } - protected int virtualYtoScreen(int y) { - return y+fVirtualBounds.y; - } - protected int screenXtoVirtual(int x) { - return x-fVirtualBounds.x; - } - protected int screenYtoVirtual(int y) { - return y-fVirtualBounds.y; - } - /** called when the viewed part is changing */ - private final Rectangle fViewRectangle=new Rectangle(0,0,0,0); - void updateViewRectangle() { - if( - fViewRectangle.x==-fVirtualBounds.x - && fViewRectangle.y==-fVirtualBounds.y - && fViewRectangle.width==fClientArea.width - && fViewRectangle.height==fClientArea.height - ) - return; - fViewRectangle.x=-fVirtualBounds.x; - fViewRectangle.y=-fVirtualBounds.y; - fViewRectangle.width=fClientArea.width; - fViewRectangle.height=fClientArea.height; - viewRectangleChanged(fViewRectangle.x,fViewRectangle.y,fViewRectangle.width,fViewRectangle.height); - } - protected Rectangle getViewRectangle() { - return fViewRectangle; - } - /** - * Called when the viewed part has changed. - * Override when you need this information.... - * Is only called if the values change! - * @param x visible in virtual space - * @param y visible in virtual space - * @param width - * @param height - */ - protected void viewRectangleChanged(int x, int y, int width, int height) { -// System.out.println(x+" "+y+" "+width+" "+height); - } - /** - * @private - */ - private void updateScrollbars() { - Point size= getSize(); - Rectangle clientArea= getClientArea(); - - ScrollBar horizontal= getHorizontalBar(); - if (fVirtualBounds.width <= clientArea.width) { - // TODO IMPORTANT in ScrollBar.setVisible comment out the line - // that checks 'isvisible' and returns (at the beginning) - horizontal.setVisible(false); - horizontal.setSelection(0); - } else { - horizontal.setPageIncrement(clientArea.width - horizontal.getIncrement()); - int max= fVirtualBounds.width + (size.x - clientArea.width); - horizontal.setMaximum(max); - horizontal.setThumb(size.x > max ? max : size.x); - horizontal.setVisible(true); - } - - ScrollBar vertical= getVerticalBar(); - if (fVirtualBounds.height <= clientArea.height) { - vertical.setVisible(false); - vertical.setSelection(0); - } else { - vertical.setPageIncrement(clientArea.height - vertical.getIncrement()); - int max= fVirtualBounds.height + (size.y - clientArea.height); - vertical.setMaximum(max); - vertical.setThumb(size.y > max ? max : size.y); - vertical.setVisible(true); - } - } -} - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/AbstractLineOrientedDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/AbstractLineOrientedDataSource.java deleted file mode 100644 index c23ee5daf1a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/AbstractLineOrientedDataSource.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.Style; - -/** - * Adds line by line - * - */ -abstract class AbstractLineOrientedDataSource implements IDataSource { - abstract public char[] dataSource(); - abstract public Style getStyle(); - - abstract public void next(); - - public int step(ITerminalTextData terminal) { - next(); - char[] chars=dataSource(); - Style style= getStyle(); - int len; - // keep the synchronized block short! - synchronized (terminal) { - terminal.addLine(); - len=Math.min(terminal.getWidth(),chars.length); - int line=terminal.getHeight()-1; - terminal.setChars(line, 0, chars, 0, len, style); - terminal.setCursorLine(line); - terminal.setCursorColumn(len-1); - } - return len; - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/DataReader.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/DataReader.java deleted file mode 100644 index ae1bd5cb31e..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/DataReader.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - -class DataReader implements Runnable { - final Thread fThread; - final IDataSource fDataSource; - final ITerminalTextData fTerminal; - volatile boolean fStart; - volatile boolean fStop; - volatile int fThrottleTime; - final IStatus fStatus; - final String fName; - DataReader(String name, ITerminalTextData terminal, IDataSource dataSource, IStatus status) { - fStatus=status; - fName=name; - fTerminal=terminal; - fDataSource=dataSource; - fThread=new Thread(this,name); - fThread.setDaemon(true); - fThread.start(); - } - public void run() { - long t0=System.currentTimeMillis()-1; - long c=0; - int lines=0; - while(!Thread.interrupted()) { - while(!fStart || fStop) { - sleep(1); - } - if(fThrottleTime>0) - sleep(fThrottleTime); - // synchronize because we have to be sure the size does not change while - // we add lines - int len=fDataSource.step(fTerminal); - // keep the synchronized block short! - c+=len; - lines++; - if((fThrottleTime>0 || (lines%100==0))&&(System.currentTimeMillis()-t0)>1000) { - long t=System.currentTimeMillis()-t0; - final String s=(c*1000)/(t*1024)+"kb/s " + (lines*1000)/t+"lines/sec "+(c*1000*8)/t+" bits/s "; - fStatus.setStatus(s); - lines=0; - t0=System.currentTimeMillis(); - c=0; - } - } - } - public int getThrottleTime() { - return fThrottleTime; - } - public void setThrottleTime(int throttleTime) { - fThrottleTime = throttleTime; - } - private void sleep(int ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - public boolean isStart() { - return fStart; - } - public void setStart(boolean start) { - fStart = start; - } - public String getName() { - return fName; - } - public boolean isStop() { - return fStop; - } - public void setStop(boolean stop) { - fStop = stop; - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FastDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FastDataSource.java deleted file mode 100644 index fad8203255c..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FastDataSource.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import org.eclipse.tm.terminal.model.Style; - -final class FastDataSource extends AbstractLineOrientedDataSource { - char lines[][]=new char[][]{ - "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 ".toCharArray(), - "abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi ".toCharArray(), - }; - - - int pos; - - public char[] dataSource() { - return lines[pos%lines.length]; - } - - public Style getStyle() { - return null; - } - - public void next() { - pos++; - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FileDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FileDataSource.java deleted file mode 100644 index c981159da99..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/FileDataSource.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; - -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -/** - * Reads the file in an infinite loop. - * Makes lines containing 'x' bold. - * - */ -final class FileDataSource extends AbstractLineOrientedDataSource { - private final String fFile; - - BufferedReader reader; - - String line; - - Style style; - - Style styleNormal=Style.getStyle(StyleColor.getStyleColor("black"),StyleColor.getStyleColor("white")); - - Style styleBold=styleNormal.setBold(true); - - FileDataSource(String file) { - fFile = file; - } - - public char[] dataSource() { - return line.toCharArray(); - } - - public Style getStyle() { - return style; - } - - public void next() { - try { - if(reader==null) - reader = new BufferedReader(new FileReader(fFile)); - line=reader.readLine(); - if(line==null) { - reader.close(); - reader=null; - // reopen the file - next(); - return; - } - if(line.lastIndexOf('x')>0) - style=styleBold; - else - style=styleNormal; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IDataSource.java deleted file mode 100644 index dd2edbf150d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IDataSource.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - -interface IDataSource { - /** - * @param terminal - * @return number of characters changed - */ - int step(ITerminalTextData terminal); -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IStatus.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IStatus.java deleted file mode 100644 index ffd8b375ce9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/IStatus.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -public interface IStatus { - void setStatus(String message); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/LineCountingDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/LineCountingDataSource.java deleted file mode 100644 index 685cd4e4ab6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/LineCountingDataSource.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -final class LineCountingDataSource extends AbstractLineOrientedDataSource { - Style styleNormal=Style.getStyle(StyleColor.getStyleColor("black"),StyleColor.getStyleColor("red")); - - Style styles[]=new Style[] { - styleNormal, - styleNormal.setBold(true), - styleNormal.setForground("blue"), - styleNormal.setForground("yellow"), - styleNormal.setBold(true).setUnderline(true), - styleNormal.setReverse(true), - styleNormal.setReverse(true).setBold(true), - styleNormal.setReverse(true).setUnderline(true) - }; - - int pos; - - public char[] dataSource() { - return (pos+" 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789").toCharArray(); - } - - public Style getStyle() { - return styles[pos%styles.length]; - } - - public void next() { - pos++; - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/RandomDataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/RandomDataSource.java deleted file mode 100644 index b5268b4d727..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/RandomDataSource.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import java.util.Random; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -public class RandomDataSource implements IDataSource { - Random fRandom=new Random(); - Style styleNormal=Style.getStyle(StyleColor.getStyleColor("black"),StyleColor.getStyleColor("green")); - Style styles[]=new Style[] { - styleNormal, - styleNormal.setBold(true), - styleNormal.setForground("red"), - styleNormal.setForground("yellow"), - styleNormal.setBold(true).setUnderline(true), - styleNormal.setReverse(true), - styleNormal.setReverse(true).setBold(true), - styleNormal.setReverse(true).setUnderline(true) - }; - - public int step(ITerminalTextData terminal) { - int N=fRandom.nextInt(1000); - int h=terminal.getHeight(); - int w=terminal.getWidth(); - synchronized (terminal) { - for (int i = 0; i < N; i++) { - int line=fRandom.nextInt(h); - int col=fRandom.nextInt(w); - char c=(char)('A'+fRandom.nextInt('z'-'A')); - Style style=styles[fRandom.nextInt(styles.length)]; - terminal.setChar(line, col, c, style); - } - } - return N; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/TerminalTextUITest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/TerminalTextUITest.java deleted file mode 100644 index c608811b8d8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/TerminalTextUITest.java +++ /dev/null @@ -1,253 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import java.io.File; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowData; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.tm.internal.terminal.textcanvas.ITextCanvasModel; -import org.eclipse.tm.internal.terminal.textcanvas.PollingTextCanvasModel; -import org.eclipse.tm.internal.terminal.textcanvas.TextCanvas; -import org.eclipse.tm.internal.terminal.textcanvas.TextLineRenderer; -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; -import org.eclipse.tm.terminal.model.TerminalTextDataFactory; - -/** - * adjust columns when table gets resized.... - * - */ -public class TerminalTextUITest { - static TextCanvas fgTextCanvas; - static ITextCanvasModel fgModel; - static ITerminalTextData fTerminalModel; - static Label fStatusLabel; - static volatile int fHeight; - static volatile int fWidth; - static DataReader fDataReader; - static List fDataReaders=new ArrayList(); - private static Text heightText; - static class Status implements IStatus { - public void setStatus(final String s) { - if(!fStatusLabel.isDisposed()) - Display.getDefault().asyncExec(new Runnable(){ - public void run() { - if(!fStatusLabel.isDisposed()) - fStatusLabel.setText(s); - }}); - } - - } - public static void main(String[] args) { - Display display = new Display(); - Shell shell = new Shell(display); - shell.setLayout(new GridLayout()); - Composite composite=new Composite(shell, SWT.NONE); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - RowLayout layout = new RowLayout(SWT.HORIZONTAL); - layout.wrap = true; - layout.fill = false; - fTerminalModel=TerminalTextDataFactory.makeTerminalTextData(); - fHeight=24; - fWidth=80; - fTerminalModel.setDimensions(fHeight, fWidth); - fTerminalModel.setMaxHeight(fHeight); - ITerminalTextDataSnapshot snapshot=fTerminalModel.makeSnapshot(); - // TODO how to get the initial size correctly! - snapshot.updateSnapshot(false); - fgModel=new PollingTextCanvasModel(snapshot); - fgTextCanvas=new TextCanvas(shell,fgModel, SWT.NONE,new TextLineRenderer(fgTextCanvas,fgModel)); - fgTextCanvas.setLayoutData(new GridData(GridData.FILL_BOTH)); - - - composite.setLayout(layout); - addAutorevealCursorButton(composite); - Text maxHeightText = addMaxHeightInput(composite); - addHeightInput(composite, maxHeightText); - addWidthText(composite); - Text throttleText = addThrottleText(composite); - - IStatus status=new Status(); - DataReader reader=new DataReader("Line Count",fTerminalModel,new LineCountingDataSource(),status); - addDataReader(composite, reader); - reader=new DataReader("Fast",fTerminalModel,new FastDataSource(),status); - addDataReader(composite, reader); - reader=new DataReader("Random",fTerminalModel,new RandomDataSource(),status); - addDataReader(composite, reader); - for (int i = 0; i < args.length; i++) { - File file=new File(args[i]); - reader=new DataReader(file.getName(),fTerminalModel,new VT100DataSource(args[i]),status); - addDataReader(composite, reader); - } - addStopAllButton(composite, reader); - - fStatusLabel=new Label(shell,SWT.NONE); - fStatusLabel.setLayoutData(new GridData(250,15)); - throttleText.setText("100"); - setThrottleForAll(100); - - if(args.length==0) - addLabel(composite, "[Files can be added via commandline]"); - shell.setSize(600,300); - shell.open(); - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) - display.sleep(); - } - display.dispose(); - } - private static Text addMaxHeightInput(Composite composite) { - addLabel(composite, "maxHeight:"); - final Text maxHeightText=new Text(composite,SWT.BORDER); - setLayoutData(maxHeightText,30); - maxHeightText.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e) { - synchronized (fTerminalModel) { - int height=textToInt(maxHeightText); - if(height<1) - return; - if(fTerminalModel.getHeight()>height) { - fTerminalModel.scroll(0, fTerminalModel.getHeight(), height-fTerminalModel.getHeight()); - fTerminalModel.setDimensions(height,fTerminalModel.getWidth()); - heightText.setText(height+""); - } - fTerminalModel.setMaxHeight(height); - } - } - }); - maxHeightText.setText(fHeight+""); - return maxHeightText; - } - private static void addHeightInput(Composite composite, final Text maxHeightText) { - addLabel(composite,"heigth:"); - heightText=new Text(composite,SWT.BORDER); - setLayoutData(heightText,30); - heightText.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e) { - synchronized (fTerminalModel) { - int height=textToInt(heightText); - if(height<1) - return; - maxHeightText.setText(""+height); - fTerminalModel.setDimensions(height,fTerminalModel.getWidth()); - fTerminalModel.setMaxHeight(height); - } - } - }); - heightText.setText(fHeight+""); - } - private static Text addWidthText(Composite composite) { - addLabel(composite,"width:"); - final Text widthText=new Text(composite,SWT.BORDER); - setLayoutData(widthText,30); - widthText.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e) { - synchronized (fTerminalModel) { - int width=textToInt(widthText); - if(width>1) - fTerminalModel.setDimensions(fTerminalModel.getHeight(), width); - } - } - }); - widthText.setText(fWidth+""); - return widthText; - } - private static Text addThrottleText(Composite composite) { - addLabel(composite,"throttle:"); - final Text throttleText=new Text(composite,SWT.BORDER); - setLayoutData(throttleText,30); - throttleText.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e) { - synchronized (fTerminalModel) { - int throttle=textToInt(throttleText); - setThrottleForAll(throttle); - } - }}); - return throttleText; - } - private static void addStopAllButton(Composite composite, DataReader reader) { - final Button stopAllButton=new Button(composite,SWT.CHECK); - stopAllButton.setText("Stop ALL"); - stopAllButton.addSelectionListener(new SelectionAdapter(){ - - public void widgetSelected(SelectionEvent e) { - boolean stop=stopAllButton.getSelection(); - for (Iterator iterator = fDataReaders.iterator(); iterator.hasNext();) { - DataReader reader = (DataReader) iterator.next(); - reader.setStop(stop); - - }}}); - stopAllButton.setSelection(reader.isStart()); - } - private static void addAutorevealCursorButton(Composite composite) { - final Button button=new Button(composite,SWT.CHECK); - button.setText("ScrollLock"); - button.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e) { - boolean scrollLock=button.getSelection(); - fgTextCanvas.setScrollLock(scrollLock); - } - }); - button.setSelection(fgTextCanvas.isScrollLock()); - } - private static void addLabel(Composite composite,String message) { - Label label; - label=new Label(composite, SWT.NONE); - label.setText(message); - } - private static void addDataReader(Composite composite, final DataReader reader) { - fDataReaders.add(reader); - final Button button=new Button(composite,SWT.CHECK); - button.setText(reader.getName()); - button.addSelectionListener(new SelectionAdapter(){ - - public void widgetSelected(SelectionEvent e) { - reader.setStart(button.getSelection()); - }}); - button.setSelection(reader.isStart()); - - } - static private void setThrottleForAll(int throttle) { - for (Iterator iterator = fDataReaders.iterator(); iterator.hasNext();) { - DataReader reader = (DataReader) iterator.next(); - reader.setThrottleTime(throttle); - } - } - static void setLayoutData(Control c,int width) { - c.setLayoutData(new RowData(width,-1)); - } - static int textToInt(Text text) { - try { - return Integer.valueOf(text.getText()).intValue(); - } catch (Exception ex) { - return 0; - } - } -} - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/VT100DataSource.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/VT100DataSource.java deleted file mode 100644 index 5fc2628d108..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/test/ui/VT100DataSource.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Anton Leherbauer (Wind River) - [458398] Add support for normal/application cursor keys mode - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.test.ui; - -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Reader; -import java.io.UnsupportedEncodingException; - -import org.eclipse.tm.internal.terminal.control.impl.ITerminalControlForText; -import org.eclipse.tm.internal.terminal.emulator.VT100Emulator; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.terminal.model.ITerminalTextData; - -/** - * Reads the file in an infinite loop. - * Makes lines containing 'x' bold. - * - */ -final class VT100DataSource implements IDataSource { - VT100Emulator fEmulator; - volatile int fAvailable; - volatile int fRead; - private final String fFile; - - VT100DataSource(String file) { - fFile=file; - } - class InfiniteFileInputStream extends InputStream { - public InfiniteFileInputStream() { - try { - fInputStream=new FileInputStream(fFile); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - public int available() throws IOException { - return fAvailable; - } - private InputStream fInputStream; - public int read() throws IOException { - throw new IOException(); - } - public int read(byte[] b, int off, int len) throws IOException { - while(fAvailable==0) { - try { - Thread.sleep(1); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - len=fAvailable; - int n=fInputStream.read(b, off, len); - if(n<=0) { - fInputStream.close(); - fInputStream=new FileInputStream(fFile); - n=fInputStream.read(b, off, len); - } - fAvailable-=n; - return n; - } - - } - void init(ITerminalTextData terminal) { - final Reader reader; - try { - reader = new InputStreamReader(new InfiniteFileInputStream(), "ISO-8859-1"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - fEmulator=new VT100Emulator(terminal,new ITerminalControlForText() { - - public void disconnectTerminal() { - // TODO Auto-generated method stub - - } - - public OutputStream getOutputStream() { - return new ByteArrayOutputStream(); - } - - public TerminalState getState() { - return TerminalState.CONNECTED; - } - - public ITerminalConnector getTerminalConnector() { - return null; - } - - public void setState(TerminalState state) { - } - - public void setTerminalTitle(String title) { - } - - public void enableApplicationCursorKeys(boolean enable) { - } - }, reader); - } - public int step(ITerminalTextData terminal) { - synchronized(terminal) { - if(fEmulator==null) { - init(terminal); -// fEmulator.setDimensions(48, 132); - fEmulator.setDimensions(24, 80); - fEmulator.setCrAfterNewLine(true); - - } - fAvailable=80; - fEmulator.processText(); - } - return 80; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStreamPerformanceTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStreamPerformanceTest.java deleted file mode 100644 index 3b68ac6ca49..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStreamPerformanceTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import java.io.OutputStream; - -public class PipedInputStreamPerformanceTest { - - /** - * @param args - * @throws InterruptedException - */ - public static void main(String[] args) throws InterruptedException { - runPerformanceTest(); - runPerformanceTest(); - } - - private static void runPerformanceTest() throws InterruptedException { - PipedInputStream in=new PipedInputStream(1024); - OutputStream out=in.getOutputStream(); - PipedStreamTest.runPipe("",in, out,100); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedStreamTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedStreamTest.java deleted file mode 100644 index e1968dbdae5..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/textcanvas/PipedStreamTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - - -class PipedStreamTest { - static class ReadThread extends Thread implements Runnable { - - InputStream pi = null; - - OutputStream po = null; - - ReadThread(String process, InputStream pi, OutputStream po) { - this.pi = pi; - this.po = po; - setDaemon(true); - } - - public void run() { - byte[] buffer = new byte[2048]; - int bytes_read; - try { - for (;;) { - bytes_read = pi.read(buffer); - if (bytes_read == -1) { - po.close(); - pi.close(); - return; - } - po.write(buffer, 0, bytes_read); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - static class FakeInputStream extends InputStream { - int N; - FakeInputStream(int n) { - N=n; - } - public int read(byte[] b, int off, int len) throws IOException { - if(N==0) - return -1; - int n=Math.min(len,N); - for (int i = off; i < off+n; i++) { - b[i]='x'; - } - N-=n; - return n; - } - public int read() throws IOException { - throw new UnsupportedOperationException(); - } - /* - * available has to be implemented! - */ - public int available() throws IOException { - return N; - } - } - static class FakeOutputStream extends OutputStream { - long N; - public void write(int b) throws IOException { - throw new UnsupportedOperationException(); - } - public void write(byte[] b, int off, int len) throws IOException { - N+=len; - } - } - public static void main(String[] args) throws IOException, InterruptedException { - while(true) { - runSunTest(); - runMyTest(); - } - } - private static void runSunTest() throws IOException, InterruptedException { - java.io.PipedInputStream in = new java.io.PipedInputStream(); - OutputStream out = new java.io.PipedOutputStream(in); - runPipe("Sun ",in, out,10); - } - private static void runMyTest() throws IOException, InterruptedException { - PipedInputStream in=new PipedInputStream(4*1024); - OutputStream out=in.getOutputStream(); - runPipe("My ",in, out,99); - } - public static void runPipe(String what,InputStream writeIn, OutputStream readOut,int N) throws InterruptedException { - FakeInputStream in=new FakeInputStream(N*1000*1000); - FakeOutputStream out=new FakeOutputStream(); - ReadThread rt = new ReadThread("reader", in , readOut); - ReadThread wt = new ReadThread("writer", writeIn, out); - long t0=System.currentTimeMillis(); - rt.start(); - wt.start(); - wt.join(); - long t=System.currentTimeMillis(); - long n=out.N; - System.out.println(what+n + " byte in " +(t-t0)+" ms -> "+(1000*n)/((t-t0+1)*1024)+" kb/sec"); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/AllTests.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/AllTests.java deleted file mode 100644 index d8aa16a2879..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/AllTests.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Public Terminal Model test cases. - * Runs in internal model package to allow access to default visible items. - */ -public class AllTests extends TestCase { - public AllTests() { - super(null); - } - - public AllTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(AllTests.class.getName()); - suite.addTestSuite(StyleColorTest.class); - suite.addTestSuite(StyleTest.class); - return suite; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleColorTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleColorTest.java deleted file mode 100644 index b7672bfb817..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleColorTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import junit.framework.TestCase; - -public class StyleColorTest extends TestCase { - - - public void testEqualsObject() { - assertEquals(StyleColor.getStyleColor("foo"),StyleColor.getStyleColor("foo")); - assertFalse(StyleColor.getStyleColor("foox").equals(StyleColor.getStyleColor("foo"))); - } - - public void testSameObject() { - assertSame(StyleColor.getStyleColor("foo"),StyleColor.getStyleColor("foo")); - assertNotSame(StyleColor.getStyleColor("foox"),StyleColor.getStyleColor("foo")); - } - - public void testToString() { - assertEquals("xxx", StyleColor.getStyleColor("xxx").toString()); - } - - public void testGetName() { - assertEquals("xxx", StyleColor.getStyleColor("xxx").getName()); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleTest.java deleted file mode 100644 index e9264381e31..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/model/StyleTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import junit.framework.TestCase; - -public class StyleTest extends TestCase { - final StyleColor c1=StyleColor.getStyleColor("c1"); - final StyleColor c2=StyleColor.getStyleColor("c2"); - final StyleColor c3=StyleColor.getStyleColor("c3"); - - public void testGetStyle() { - Style s1=Style.getStyle(c1, c2, true, false, true, false); - Style s2=Style.getStyle(c1, c2, true, false, true, false); - assertEquals(s1,s2); - assertSame(s1,s2); - s1=s1.setBlink(!s1.isBlink()); - assertNotSame(s1,s2); - assertFalse(s1.equals(s2)); - s1=s1.setBlink(!s1.isBlink()); - assertSame(s1,s2); - } - - public void testSetForground() { - Style s1=Style.getStyle(c1, c2, true, false, true, false); - Style s2=s1; - s2=s1.setForground(c3); - assertNotSame(s1,s2); - assertFalse(s1.equals(s2)); - assertSame(s2.getForground(), c3); - assertSame(s1.getForground(), c1); - assertSame(s1.getBackground(), c2); - assertSame(s2.getBackground(), c2); - s2=s2.setForground(c1); - assertSame(s1, s2); - } - - public void testSetBackground() { - Style s1=Style.getStyle(c1, c2, true, false, true, false); - Style s2=s1; - s2=s1.setBackground(c3); - assertNotSame(s1,s2); - assertFalse(s1.equals(s2)); - assertSame(s2.getForground(), c1); - assertSame(s1.getForground(), c1); - assertSame(s1.getBackground(), c2); - assertSame(s2.getBackground(), c3); - s2=s2.setBackground(c2); - assertSame(s1, s2); - } - - public void testSetBold() { - Style s1=getDefaultStyle(); - Style s2=s1; - assertSame(s1,s2); - assertFalse(s2.isBold()); - s2=s2.setBold(true); - assertNotSame(s1,s2); - assertTrue(s2.isBold()); - s2=s2.setBold(false); - assertSame(s1,s2); - assertFalse(s2.isBold()); - } - - public void testSetBlink() { - Style s1=getDefaultStyle(); - Style s2=s1; - assertSame(s1,s2); - assertFalse(s2.isBlink()); - s2=s2.setBlink(true); - assertNotSame(s1,s2); - assertTrue(s2.isBlink()); - s2=s2.setBlink(false); - assertSame(s1,s2); - assertFalse(s2.isBlink()); - } - - public void testSetUnderline() { - Style s1=getDefaultStyle(); - Style s2=s1; - assertSame(s1,s2); - assertFalse(s2.isUnderline()); - s2=s2.setUnderline(true); - assertNotSame(s1,s2); - assertTrue(s2.isUnderline()); - s2=s2.setUnderline(false); - assertSame(s1,s2); - assertFalse(s2.isUnderline()); - } - - public void testSetReverse() { - Style s1=getDefaultStyle(); - Style s2=s1; - assertSame(s1,s2); - assertFalse(s2.isReverse()); - s2=s2.setReverse(true); - assertNotSame(s1,s2); - assertTrue(s2.isReverse()); - s2=s2.setReverse(false); - assertSame(s1,s2); - assertFalse(s2.isReverse()); - } - - private Style getDefaultStyle() { - return Style.getStyle(c1, c2, false, false, false, false); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedPluginTests.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedPluginTests.java deleted file mode 100644 index ee7a1834a6d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedPluginTests.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - *******************************************************************************/ - -package org.eclipse.tm.terminal.test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Master Test Suite to run all Terminal plug-in tests. - */ -public class AutomatedPluginTests extends TestCase { - /** - * Call each AllTests class from each of the test packages. - */ - public static Test suite() { - TestSuite suite = new TestSuite(AutomatedPluginTests.class.getName()); - //These tests require Eclipse Platform to be up - suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorPluginTest.class); - suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorFactoryTest.class); - - //These tests must run as plain JUnit because they require access - //to "package" protected methods - //suite.addTest(AutomatedTests.suite()); - return suite; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedTests.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedTests.java deleted file mode 100644 index 089f39e0f46..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedTests.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Master test suite to run all terminal unit tests. - */ -public class AutomatedTests extends TestCase { - - public static final String PI_TERMINAL_TESTS = "org.eclipse.tm.terminal.test"; //$NON-NLS-1$ - - public AutomatedTests() { - super(null); - } - - public AutomatedTests(String name) { - super(name); - } - - /** - * Call each AllTests class from each of the test packages. - */ - public static Test suite() { - TestSuite suite = new TestSuite(AutomatedTests.class.getName()); - suite.addTest(org.eclipse.tm.internal.terminal.emulator.AllTests.suite()); - suite.addTest(org.eclipse.tm.internal.terminal.model.AllTests.suite()); - suite.addTest(org.eclipse.tm.terminal.model.AllTests.suite()); - suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.class); - suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalToRemoteInjectionOutputStreamTest.class); - return suite; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal All Unit Tests.launch b/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal All Unit Tests.launch deleted file mode 100644 index fd2e3ebb9d4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal All Unit Tests.launch +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal AutomatedTests.launch b/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal AutomatedTests.launch deleted file mode 100644 index a8d7a4e206d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal AutomatedTests.launch +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal Plugin Tests.launch b/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal Plugin Tests.launch deleted file mode 100644 index 0872cc461c3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/teamConfig/Terminal Plugin Tests.launch +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/test.xml b/terminal/plugins/org.eclipse.tm.terminal.test/test.xml deleted file mode 100644 index ed776df77b9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal.test/test.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/tm32.png b/terminal/plugins/org.eclipse.tm.terminal.test/tm32.png deleted file mode 100644 index 3077b1220dd688632a42e347f90c90cb319835f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1q%}g3C{W4d;kClbxA})R9M5U zmtBlqRTam7``mNyow+m9DJ}i5)G6{^3K#>^Vu&CQ#25t%2}(?iH8BDb9!z*JrVsFh z@e3LvhL{Kv6&e(ZZ)if17NZ?PrfJJZm6}reF`b#tow*<9p1t>4%ZGFBbV`tz;J(?} z=bU@*`LFd~|FzcM4#3Q6z#z~l*8!jkB!B_|=m8nf1v2NH=VQkB=5YtO@*N3KF-ROF zR(zp=q-K_upd-L=IU7KIi2->D+y*M8(dwLw{{q61)R6vooD^;e)x0^M!1A=!8p;O?QUo+WFjz`#zY=vf#Y$%xB%% zJ;odRgoJJe&JtltX`T zEF?+dmT&vkw(+f7w|;Hy+O<~zOixcAyzTbe9!Ob?5%rS()xhPzC1$oPbo@~4g~4Dj zB?%`x#%v}SkT^#_;LbU4Wpr_4E~$TC{bk>|?9!oUckFoZhSjTAZ(6FAX0v$)sHGoL zYOU17a^NE897!d?YALOXkP}L@5(h)Ae{Yy6h69Rga3co}&V2XLM_=f!TGf4g-MV#a z@4ox)yS(?^?c2Bi*3?2$yb&#@2YR9F8=>Qgc_4_ADTJWJpol0UhKLn^R72DX15^tm zObbQ;=U~^a*BVbfwRcOq-EITy+`04D?;ksM+MtsHvCQ)vm~Wq27z>%dsya|b(hA*Z z%+L4e<$*kp^m;;`3o#1b3nGfCp(Qw`B^w49uB-;C_02cm{H3c7A3prrFP?bfRWqA2 zvxT(pHPFpwJB`+f=2t7#3VALxNeDsdWuXvS*OT=;Suc?F0(ohGl;Em@s(=-QI%hbH z#5o>(@Ec6e%s1}8|AF77sm)?G2ekSIWI+4OzfON$RU0bGR4dX0M3i1Hl65_;R!+N} z)9vK+a>4sR6eUJQC1M&elf^Lf^>XX2H?U>PCboV1VX|!5*5Tpq4-A`k&~av#KJw#V zhBd3s!?_}^l%>U)VdvDj;x0{7PEF16_PZ@{?=jOC-FJp0^>EHvAQ2qHqOHS~pn zf&6J86s6US8A&*tSE-7SM8!owq*x=EfT|!t`AoN<*9SqwBhe!gPzwwV4KX@8LbX<< zu0ms|!N!dj@Zt*-s3;NzGrb=86`*OK+H|1C;PN_1Bt}7_fEN%UjfGKZ6bMSCUI7cl z*h4~(7;{uSCIuU^1suzqtP8BB4bDHW}f21TQy zLD3kIP^2AEa6V%78jvl5OY9-yiQ)-i1=FWz2|g#ORA{$5?B0E-02k?t)11R5_DvK9 zNE9l|ps~CHk|4p5Xt)TKsH8!mWW{?y>WYdGVy~pXm=|tX#Z5O}&5p-+vVPq#BO`SV z95_aEu8oRfl!Z!_iG34BzrBVKaaBl1D_Art(I6Tc4T%m36)aY8(WnO_srLvW5Pjjf zYGBjG_0;MKKmFP7$$J?GXPc-hq7hRm%X2@y&gNBm-R5x@V?aeoD~_b%u$o~8Dv*eh z27~C(2q6HqoY*ZjAb~AgE+hJ!S6-PQ?`6agFf&91Q$8&PR-*Ff}mVXurq3_k5WrpZpVZb4|R@i6Nk>MPE<>XNxhnb9$cb zS~S3nszjmYd(_+#n0}8h_J3t(EAHE|%NyCd?Ec9~g7?G_5GhjZ9I;UrFsEhzHq30- z)YP7%XG7o^@WC@QJjCeeC}xKD#fGlBdiET2|hKocmGlYQs>;TL}6xnhPg9mFgr_m;vBf5BMuG@@bW)i<}Z~=YAb7~ zT2Wfd_N&<9UH}ZN54x!QSEr_4fB3_yN-=AM5LmNj4Qtn~#mwk*Isgn04bzHk{ylw+ zS6+UN=bm|vOTTwLkfRtPvGf`Y0W;JThZP??D>?_;K1$XpiK~U+IXyj1mSq?ad_YXt zqx(5He}tL#JoQ8KI0xS6{VmRiC@-ikB;0300e$GBJU<%(gBXQov$^Q`d~2R(_P>Cx zti$>NFo+TXhlt=@ike|oHWz1Q=JZzu>}lYksj1hGeq3UwII<8u8^*@iFt&jtar|)S zBOKlJHXCoe27hH0r;hViuI8j3r7<`}({e_J2K{|^-SoG~ci&_0=vP=1jFsVksT6ne96s zxS3BlQZrpR@4Qie^3P3q7gA}LOLR}O4_8I@@@gLG4Gxh^{y7T}5002ovPDHLkV1l5)GaLW_ diff --git a/terminal/plugins/org.eclipse.tm.terminal/.classpath b/terminal/plugins/org.eclipse.tm.terminal/.classpath deleted file mode 100644 index 25d360efcad..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal/.cvsignore b/terminal/plugins/org.eclipse.tm.terminal/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/terminal/plugins/org.eclipse.tm.terminal/.options b/terminal/plugins/org.eclipse.tm.terminal/.options deleted file mode 100644 index 78cb917d600..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.options +++ /dev/null @@ -1,3 +0,0 @@ -org.eclipse.tm.terminal/debug/log = false -org.eclipse.tm.terminal/debug/log/char = false -org.eclipse.tm.terminal/debug/log/VT100Backend = false diff --git a/terminal/plugins/org.eclipse.tm.terminal/.project b/terminal/plugins/org.eclipse.tm.terminal/.project deleted file mode 100644 index 79c78f7826f..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.tm.terminal - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.core.resources.prefs b/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 775bde20f32..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java=UTF-8 diff --git a/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs b/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index eb9982c343a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,100 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/terminal/plugins/org.eclipse.tm.terminal/HelpContexts.xml b/terminal/plugins/org.eclipse.tm.terminal/HelpContexts.xml deleted file mode 100644 index 761da672632..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/HelpContexts.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - The Terminal View supports direct connections to remote systems via serial or network connections. - - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF deleted file mode 100644 index ccb37735d23..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF +++ /dev/null @@ -1,35 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true -Bundle-Version: 3.3.100.qualifier -Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.ui -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-ClassPath: . -Export-Package: org.eclipse.tm.internal.terminal.connector;x-friends:="org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.control, - org.eclipse.tm.internal.terminal.control.actions, - org.eclipse.tm.internal.terminal.control.impl;x-friends:="org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.emulator;x-friends:="org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.model;x-friends:="org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.preferences, - org.eclipse.tm.internal.terminal.provisional.api; - x-friends:="org.eclipse.tm.terminal.serial, - org.eclipse.tm.terminal.ssh, - org.eclipse.tm.terminal.telnet, - org.eclipse.tm.terminal.local, - org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.provisional.api.provider; - x-friends:="org.eclipse.tm.terminal.serial, - org.eclipse.tm.terminal.ssh, - org.eclipse.tm.terminal.telnet, - org.eclipse.tm.terminal.local, - org.eclipse.tm.terminal.test", - org.eclipse.tm.internal.terminal.textcanvas;x-friends:="org.eclipse.tm.terminal.test", - org.eclipse.tm.terminal.model diff --git a/terminal/plugins/org.eclipse.tm.terminal/README.txt b/terminal/plugins/org.eclipse.tm.terminal/README.txt deleted file mode 100644 index c88bc696e29..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/README.txt +++ /dev/null @@ -1,18 +0,0 @@ -Terminal README -=============== - -The Terminal is a UI-less model of a grid of characters, -plus an SWT widget that's updated asynchronously for -maximum performance. The widget can be hooked up to various -ITerminalConnectors providing an InputStream, OutputStream, -and a method for setting the Terminal Size. - -The widget processes ANSI control characters, including NUL, -backspace, carriage return, linefeed, and a subset of ANSI -escape sequences sufficient to allow use of screen-oriented -applications, such as vi, Emacs, and any GNU readline-enabled -application (Bash, bc, ncftp, etc.). - -This is not yet a fully compliant vt100 / vt102 terminal -emulator! - diff --git a/terminal/plugins/org.eclipse.tm.terminal/about.html b/terminal/plugins/org.eclipse.tm.terminal/about.html deleted file mode 100644 index d4cc693f9f0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/about.ini b/terminal/plugins/org.eclipse.tm.terminal/about.ini deleted file mode 100644 index 3adc27ab587..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=tm32.png - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (not translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -# optional - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/about.properties b/terminal/plugins/org.eclipse.tm.terminal/about.properties deleted file mode 100644 index db887b2cf95..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/about.properties +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Martin Oberhuber - initial API and implementation -################################################################################ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. -# -# Do not translate any values surrounded by {} - -blurb=Target Management Terminal Widget\n\ -\n\ -Version: {featureVersion}\n\ -\n\ -(c) Copyright Wind River Systems, Inc. and others 2003, 2015. All rights reserved.\n\ -Visit http://www.eclipse.org/tm diff --git a/terminal/plugins/org.eclipse.tm.terminal/build.properties b/terminal/plugins/org.eclipse.tm.terminal/build.properties deleted file mode 100644 index 6d04269c268..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/build.properties +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -# Anna Dushistova (MontaVista) - added icons -############################################################################### -bin.includes = .,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - .options,\ - README.txt,\ - about.html,\ - about.ini,\ - about.properties,\ - tm32.png,\ - icons/,\ - HelpContexts.xml,\ - css/ - -source.. = src/ -output.. = bin/ -src.includes = schema/,\ - about.html - diff --git a/terminal/plugins/org.eclipse.tm.terminal/css/org.eclipse.tm.terminal.stylesheet.dark.css b/terminal/plugins/org.eclipse.tm.terminal/css/org.eclipse.tm.terminal.stylesheet.dark.css deleted file mode 100644 index 8e7cba8c5b2..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/css/org.eclipse.tm.terminal.stylesheet.dark.css +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 vogella GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Lars Vogel - initial API and implementation - ******************************************************************************/ - -IEclipsePreferences#org-eclipse-tm-terminal { - preferences: - "TerminalPrefInvertColors=true" -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/icons/clcl16/clear_co.gif b/terminal/plugins/org.eclipse.tm.terminal/icons/clcl16/clear_co.gif deleted file mode 100644 index af30a42f83d2f91801206463e1f4601a747dd38e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 595 zcmZ?wbhEHb6krfwc*el+;Qr&!Uw{Aj`RCh@zn{MT*?;oxyHCG9ef|CO*PkChf49xr z*E9dn%Iz0#-hcJ>)9(*oeotO@Y}T67i#DHMvE%ZZJy-8O|Ni97&*$%czWwy;^S9r3 zo`1jp^2fthKi+)${p!QdZ$ExNd-wC(&%YnO{{Hms_tzi4zyJI_W5&cyo7UdHe|Of* z{<*XJmMv^wG_UL6rjotu%lB?5-?_GG%gWmI%NmdGpZDg~qvKl(k8UnLx~2Hg#?qZ@ zs#Y&v%S5&t*x!DuCAn{q`0`asHmv0urNPAKQAvYB_$;} zIXNyaE;cqcGBPqWG&DFkI4CG6FfcG6Ai&?>-_OtQ|Ns9C0}2#>vM@3*gfi%WTmgy` z2KEgNp{C6(&7tib?WP<(y|$*E9cHRboKu+W?9C^J>Z%9|aC6C9+u2x5)MuAemSmLN zAgMReQb|NuXu%?WgNcR`5^M(!OBhcylH0yhfQMJnWTKUV_?0Uxu3jz-u0F1z+G3{` zuzEW)`F=drwRH^dde6KTp?5HjDwPt!%ua0$DEtSh$2VJr-3M iJ8pc$DH7Bta2KY#wb zefxI%_U+rYZQHbI)0#DFRqv0~ApMGF@$oHuXY?Afzt&YU@8#*FFH zr%#(U?f?J(3={yxpDc_F4B8AjATvOIVqoh$Ae!bOv##%ivfAOCFau8&wgXGj^h7d5 zgbic_SR0;xy2Hivydi4sR4$3$c5$5yZN&+Ub^IH-l?#g4`GgtjB!mRJx|kGH)9(*oeotO@Y}T67i#DHMvE%ZZJy-8O|Ni97&*$%czWwy;^S9r3 zo`1jp^2fthKi+)${p!QdZ$ExNd-wC(&%YnO{{Hms_tzi4zyJI_W5&cyo7UdHe|Of* z{<*XJmMv^wG_UL6rjotu%lB?5-?_GG%gWmI%NmdGpZDg~qvKl(k8UnLx~2Hg#?qZ@ zs#Y&v%S5&t*x!DuCAn{q`0`asHmv0urNPAKQAvYB_$;} zIXNyaE;cqcGBPqWG&DFkI4CG6FfcG6Ai&?>-_OtQ|Ns9C0}2#>vM@3*gfi%WTmgy` z2KEgNp{C6(&7tib?WP<(y|$*E9cHRboKu+W?9C^J>Z%9|aC6C9+u2x5)MuAemSmLN zAgMReQb|NuXu%?WgNcR`5^M(!OBhcylH0yhfQMJnWTKUV_?0Uxu3jz-u0F1z+G3{` zuzEW)`F=drwRH^dde6KTp?5HjDwPt!%ua0$DEtSh$2VJr-3M iJ8pc$DH7Bta - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %terminal.font.description - - - - - - - - - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal/pom.xml b/terminal/plugins/org.eclipse.tm.terminal/pom.xml deleted file mode 100644 index 96ae5f6cabe..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.tm.maven-build - org.eclipse.tm - 4.0.0-SNAPSHOT - ../../../admin/pom-build.xml - - org.eclipse.tm - org.eclipse.tm.terminal - 3.3.100.qualifier - eclipse-plugin - diff --git a/terminal/plugins/org.eclipse.tm.terminal/schema/terminalConnectors.exsd b/terminal/plugins/org.eclipse.tm.terminal/schema/terminalConnectors.exsd deleted file mode 100644 index b503ea5442d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/schema/terminalConnectors.exsd +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A class extending TerminalConnectorImpl - - - - - - - - - - Uniquely identify this connector for programmatic access. Clients will use this ID in order to find and instantiate it. - - - - - - - The name of the connection (used in the UI) - - - - - - - - - - When set to "true", the terminal connector will not be visible to the user in connector selections. - - - - - - - - - - - - - - - - Copyright (c) 2006, 2009 Wind River Systems, Inc. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Eclipse Public License v1.0 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/epl-v10.html - -Contributors: -Michael Scharf (Wind River) - initial API and implementation -Martin Oberhuber (Wind River) - fixed copyright headers and beautified -Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - - - - diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java deleted file mode 100644 index 9f9a3f4c8de..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalConnector.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Michael Scharf (Wind River) - [200541] Extract from TerminalConnectorExtension.TerminalConnectorProxy - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.connector; - -import java.io.OutputStream; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -/** - * An {@link ITerminalConnector} instance, also known as terminal connection - * type, for maintaining a single terminal connection. - * - * It provides all terminal connector functions that can be provided by static - * markup without loading the actual implementation class. The actual - * {@link TerminalConnectorImpl} implementation class is lazily loaded by the - * provided {@link TerminalConnector.Factory} interface when needed. class, and - * delegates to the actual implementation when needed. The following methods can - * be called without initializing the contributed implementation class: - * {@link #getId()}, {@link #getName()}, {@link #getSettingsSummary()},{@link #load(ISettings)}, - * {@link #setTerminalSize(int, int)}, {@link #save(ISettings)}, - * {@link #getAdapter(Class)} - * - * @noextend This class is not intended to be subclassed by clients. - * @noinstantiate This class is not intended to be instantiated by clients. - * Clients can get terminal connector instances through the - * {@link TerminalConnectorExtension} class. - * @since org.eclipse.tm.terminal 2.0 - */ -public class TerminalConnector implements ITerminalConnector { - /** - * Creates an instance of TerminalConnectorImpl. This is used to lazily load - * classed defined in extensions. - * - * @since org.eclipse.tm.terminal 2.0 - */ - public interface Factory { - /** - * Factory method to create the actual terminal connector implementation - * when needed. - * - * @return a Connector - * @throws Exception - */ - TerminalConnectorImpl makeConnector() throws Exception; - } - /** - * The factory for creating impl instances. - */ - private final TerminalConnector.Factory fTerminalConnectorFactory; - /** - * The (display) name of the TerminalConnector - */ - private final String fName; - /** - * The unique id the connector - */ - private final String fId; - /** - * Flag to mark the connector as hidden. - */ - private final boolean fHidden; - /** - * The connector - */ - private TerminalConnectorImpl fConnector; - /** - * If the initialization of the class specified in the extension fails, - * this variable contains the error - */ - private Exception fException; - /** - * The store might be set before the real connector is initialized. - * This keeps the value until the connector is created. - */ - private ISettingsStore fStore; - /** - * Constructor for the terminal connector. - * - * @param terminalConnectorFactory Factory for lazily instantiating the - * TerminalConnectorImpl when needed. - * @param id terminal connector ID. The connector is publicly known under - * this ID. - * @param name translatable name to display the connector in the UI. - */ - public TerminalConnector(TerminalConnector.Factory terminalConnectorFactory, String id, String name, boolean hidden) { - fTerminalConnectorFactory = terminalConnectorFactory; - fId = id; - fName = name; - fHidden = hidden; - } - public String getInitializationErrorMessage() { - getConnectorImpl(); - if(fException!=null) - return fException.getLocalizedMessage(); - return null; - } - public String getId() { - return fId; - } - public String getName() { - return fName; - } - public boolean isHidden() { - return fHidden; - } - private TerminalConnectorImpl getConnectorImpl() { - if(!isInitialized()) { - try { - fConnector=fTerminalConnectorFactory.makeConnector(); - fConnector.initialize(); - } catch (Exception e) { - fException=e; - fConnector=new TerminalConnectorImpl(){ - public void connect(ITerminalControl control) { - // super.connect(control); - control.setState(TerminalState.CLOSED); - control.setMsg(getInitializationErrorMessage()); - } - public OutputStream getTerminalToRemoteStream() { - return null; - } - public String getSettingsSummary() { - return null; - }}; - // that's the place where we log the exception - Logger.logException(e); - } - if(fConnector!=null && fStore!=null) - fConnector.load(fStore); - } - return fConnector; - } - - public boolean isInitialized() { - return fConnector!=null || fException!=null; - } - public void connect(ITerminalControl control) { - getConnectorImpl().connect(control); - } - public void disconnect() { - getConnectorImpl().disconnect(); - } - public OutputStream getTerminalToRemoteStream() { - return getConnectorImpl().getTerminalToRemoteStream(); - } - public String getSettingsSummary() { - if(fConnector!=null) - return getConnectorImpl().getSettingsSummary(); - else - return TerminalMessages.NotInitialized; - } - public boolean isLocalEcho() { - return getConnectorImpl().isLocalEcho(); - } - public void load(ISettingsStore store) { - if(fConnector==null) { - fStore=store; - } else { - getConnectorImpl().load(store); - } - } - public ISettingsPage makeSettingsPage() { - return getConnectorImpl().makeSettingsPage(); - } - public void save(ISettingsStore store) { - // no need to save the settings: it cannot have changed - // because we are not initialized.... - if(fConnector!=null) - getConnectorImpl().save(store); - } - public void setTerminalSize(int newWidth, int newHeight) { - // we assume that setTerminalSize is called also after - // the terminal has been initialized. Else we would have to cache - // the values.... - if(fConnector!=null) { - fConnector.setTerminalSize(newWidth, newHeight); - } - } - public Object getAdapter(Class adapter) { - TerminalConnectorImpl connector=null; - if(isInitialized()) - connector=getConnectorImpl(); - // if we cannot create the connector then we cannot adapt... - if(connector!=null) { - // maybe the connector is adaptable - if(connector instanceof IAdaptable) { - Object result =((IAdaptable)connector).getAdapter(adapter); - // Not sure if the next block is needed.... - if(result==null) - //defer to the platform - result= Platform.getAdapterManager().getAdapter(connector, adapter); - if(result!=null) - return result; - } - // maybe the real adapter is what we need.... - if(adapter.isInstance(connector)) - return connector; - } - // maybe we have to be adapted.... - return Platform.getAdapterManager().getAdapter(this, adapter); - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java deleted file mode 100644 index ea8ef9fd8cf..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/connector/TerminalToRemoteInjectionOutputStream.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.connector; - -import java.io.ByteArrayOutputStream; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -class TerminalToRemoteInjectionOutputStream extends FilterOutputStream { - /** - * This class handles bytes written to the {@link TerminalToRemoteInjectionOutputStream}. - */ - static abstract public class Interceptor { - protected OutputStream fOriginal; - /** - * @param original the injection into the original stream begins - * @throws IOException - */ - public void begin(OutputStream original) throws IOException { - fOriginal=original; - } - /** - * @param b a byte was written to the {@link TerminalToRemoteInjectionOutputStream}. - * @throws IOException - */ - public void write(int b) throws IOException { - } - /** - * @param b bytes written to the {@link TerminalToRemoteInjectionOutputStream}. - * @param off the start offset in the data. - * @param len the number of bytes to write. - * @throws IOException - */ - public void write(byte[] b, int off, int len) throws IOException { - } - /** - * The injection into the normal stream ends. - * @throws IOException - */ - public void close() throws IOException { - } - public void flush() { - } - } - static public class BufferInterceptor extends Interceptor { - private final ByteArrayOutputStream fBuffer=new ByteArrayOutputStream(); - public void close() throws IOException { - fOriginal.write(fBuffer.toByteArray()); - } - public void write(byte[] b, int off, int len) throws IOException { - fBuffer.write(b, off, len); - } - public void write(int b) throws IOException { - fBuffer.write(b); - } - } - private class TerminalFilterOutputStream extends OutputStream { - final private Object fLock=TerminalToRemoteInjectionOutputStream.this; - public void close() throws IOException { - synchronized(fLock) { - if(fInjection==this) { - flush(); - ungrabOutput(); - } - } - } - public void write(byte[] b, int off, int len) throws IOException { - synchronized(fLock) { - checkStream(); - out.write(b, off, len); - } - } - public void write(byte[] b) throws IOException { - synchronized(fLock) { - checkStream(); - out.write(b); - } - } - public void flush() throws IOException { - synchronized(fLock) { - checkStream(); - out.flush(); - } - } - public void write(int b) throws IOException { - synchronized(fLock) { - checkStream(); - out.write(b); - } - } - private void checkStream() throws IOException { - if(fInjection!=this) - throw new IOException("Stream is closed"); //$NON-NLS-1$ - } - } - private Interceptor fInterceptor; - private TerminalFilterOutputStream fInjection; - public TerminalToRemoteInjectionOutputStream(OutputStream out) { - super(out); - } - synchronized protected void ungrabOutput() throws IOException { - if(fInterceptor!=null) { - fInterceptor.close(); - fInterceptor=null; - fInjection=null; - } - } - /** - * There can only be one injection stream active at a time. You must call close on the - * returned output stream to end the injection. - * @param interceptor This is used handle bytes sent while the injection stream is active. - * @return a output stream that can be used to write to the decorated stream. - * @throws IOException - */ - public synchronized OutputStream grabOutput(Interceptor interceptor) throws IOException { - if(fInjection!=null) { - throw new IOException("Buffer in use"); //$NON-NLS-1$ - } - fInterceptor=interceptor; - fInterceptor.begin(out); - fInjection=new TerminalFilterOutputStream(); - return fInjection; - } - /** See {@link #grabOutput(TerminalToRemoteInjectionOutputStream.Interceptor)}. - * @return injection output stream - * @throws IOException - */ - public synchronized OutputStream grabOutput() throws IOException { - return grabOutput(new BufferInterceptor()); - } - synchronized public void close() throws IOException { - if(fInjection!=null) { - fInjection.close(); - } - super.close(); - } - synchronized public void flush() throws IOException { - if(fInterceptor!=null) - fInterceptor.flush(); - out.flush(); - } - synchronized public void write(byte[] b, int off, int len) throws IOException { - if(fInterceptor!=null) - fInterceptor.write(b, off, len); - else - out.write(b, off, len); - } - synchronized public void write(int b) throws IOException { - if(fInterceptor!=null) - fInterceptor.write(b); - else - out.write(b); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java deleted file mode 100644 index ffcdc4a4934..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java +++ /dev/null @@ -1,322 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial implementation - * Michael Scharf (Wing River) - [211659] Add field assist to terminal input field - * Michael Scharf (Wing River) - [196447] The optional terminal input line should be resizeable - * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1 - * Michael Scharf (Wing River) - [236458] Fix 168197 lost the last entry - * Anton Leherbauer (Wind River) - [220971] The optional terminal input line has redraw problems when resizing - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; - -import org.eclipse.jface.fieldassist.IContentProposal; -import org.eclipse.jface.fieldassist.IContentProposalProvider; -import org.eclipse.jface.fieldassist.TextContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Sash; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter; - - - -/** - * Manages the Command History for the command line input - * of the terminal control. - *
  • - *
      Navigate with ARROW_UP,ARROW_DOWN,PAGE_UP,PAGE_DOWN - *
        ESC to cancel history editing - *
          History can be edited (by moving up and edit) but changes are - * not persistent (like in bash). - *
            If the same command is entered multiple times in a row, - * only one entry is kept in the history. - * - * - */ -public class CommandInputFieldWithHistory implements ICommandInputField { - private class FieldAssist implements IContentProposalProvider { - - public IContentProposal[] getProposals(String contents, int position) { - String prefix=contents.substring(0, position); - List result=new ArrayList(); - // show an entry only once - Set seen=new HashSet(); - for (Iterator iterator = fHistory.iterator(); iterator.hasNext();) { - String history = iterator.next(); - if(history.startsWith(prefix) && !seen.contains(history)) { - // the content is the rest of the history item - String content=history.substring(prefix.length()); - result.add(new Proposal(content,history)); - // don't add this proposal again - seen.add(history); - } - } - return result.toArray(new IContentProposal[result.size()]); - } - - } - private static class Proposal implements IContentProposal { - - private final String fContent; - private final String fLabel; - Proposal(String content, String label) { - fContent= content; - fLabel= label; - } - public String getContent() { - return fContent; - } - - public String getLabel() { - return fLabel; - } - - public String getDescription() { - return null; - } - - public int getCursorPosition() { - return fContent.length(); - } - } - - final List fHistory=new ArrayList(); - /** - * Keeps a modifiable history while in history editing mode - */ - List fEditedHistory; - /** - * The current position in the edit history - */ - private int fEditHistoryPos=0; - /** - * The limit of the history. - */ - private final int fMaxSize; - /** - * The input text field. - */ - private Text fInputField; - private Sash fSash; - private Composite fPanel; - public CommandInputFieldWithHistory(int maxHistorySize) { - fMaxSize=maxHistorySize; - } - /** - * Add a line to the history. - * @param line The line to be added to the history. - */ - protected void pushLine(String line) { - endHistoryMode(); - // anything to remember? - if(line==null || line.trim().length()==0) - return; - fHistory.add(0,line); - // ignore if the same as last - if(fHistory.size()>1 && line.equals(fHistory.get(1))) - fHistory.remove(0); - // limit the history size. - if(fHistory.size()>=fMaxSize) - fHistory.remove(fHistory.size()-1); - } - /** - * Sets the history - * @param history or null - */ - public void setHistory(String history) { - endHistoryMode(); - fHistory.clear(); - if(history==null) - return; - // add history entries separated by '\n' - // fHistory.addAll(Arrays.asList(history.split("\n"))); //$NON-NLS-1$ - // - StringTokenizer tok=new StringTokenizer(history,"\n"); //$NON-NLS-1$ - while(tok.hasMoreElements()) - fHistory.add((String) tok.nextElement()); - // - } - /** - * @return the current content of the history buffer and new line separated list - */ - public String getHistory() { - StringBuffer buff=new StringBuffer(); - boolean sep=false; - for (Iterator iterator = fHistory.iterator(); iterator.hasNext();) { - String line=iterator.next(); - if(line.length()>0) { - if(sep) - buff.append("\n"); //$NON-NLS-1$ - else - sep=true; - buff.append(line); - } - } - return buff.toString(); - } - /** - * @param currLine Line of text to be moved in history - * @param count (+1 or -1) for forward and backward movement. -1 goes back - * @return the new string to be displayed in the command line or null, - * if the limit is reached. - */ - public String move(String currLine, int count) { - if(!inHistoryMode()) { - fEditedHistory=new ArrayList(fHistory.size()+1); - fEditedHistory.add(currLine); - fEditedHistory.addAll(fHistory); - fEditHistoryPos=0; - } - fEditedHistory.set(fEditHistoryPos,currLine); - if(fEditHistoryPos+count>=fEditedHistory.size()) - return null; - if(fEditHistoryPos+count<0) - return null; - fEditHistoryPos+=count; - return (String) fEditedHistory.get(fEditHistoryPos); - } - private boolean inHistoryMode() { - return fEditedHistory!=null; - } - - /** - * Exit the history movements and go to position 0; - * @return the string to be shown in the command line - */ - protected String escape() { - if(!inHistoryMode()) - return null; - String line= (String) fEditedHistory.get(0); - endHistoryMode(); - return line; - } - /** - * End history editing - */ - private void endHistoryMode() { - fEditedHistory=null; - fEditHistoryPos=0; - } - public void createControl(final Composite parent,final ITerminalViewControl terminal) { -// fSash = new Sash(parent,SWT.HORIZONTAL|SWT.SMOOTH); - fSash = new Sash(parent,SWT.HORIZONTAL); - final GridData gd_sash = new GridData(SWT.FILL, SWT.CENTER, true, false); - gd_sash.heightHint=5; - fSash.setLayoutData(gd_sash); - fSash.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event e) { - if (e.detail == SWT.DRAG) { - // don't redraw during drag, it causes paint errors - bug 220971 - return; - } - // no idea why this is needed - GridData gdata = (GridData) fInputField.getLayoutData(); - Rectangle sashRect = fSash.getBounds (); - Rectangle containerRect = parent.getClientArea (); - - int h=fInputField.getLineHeight(); - // make sure the input filed height is a multiple of the line height - gdata.heightHint = Math.max(((containerRect.height-e.y-sashRect.height)/h)*h,h); - // do not show less then one line - e.y=Math.min(e.y,containerRect.height-h); - fInputField.setLayoutData(gdata); - parent.layout(); - // else the content assist icon will be replicated - parent.redraw(); - } - }); - fPanel = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; layout.marginHeight = 0; layout.marginTop = 0; layout.marginBottom = 2; - fPanel.setLayout(layout); - fPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - fInputField=new Text(fPanel, SWT.MULTI|SWT.BORDER|SWT.WRAP|SWT.V_SCROLL); - GridData data=new GridData(SWT.FILL, SWT.FILL, true, false); - boolean installDecoration=true; - if(installDecoration) { - // The ContentAssistCommandAdapter says: "The client is responsible for - // ensuring that adequate space is reserved for the decoration." - // TODO: what is the "adequate space"??? - data.horizontalIndent=6; - } - fInputField.setLayoutData(data); - fInputField.setFont(terminal.getFont()); - // Register field assist *before* the key listener. - // Else the ENTER key is sent *first* to the input field - // and then to the field assist popup. - // (https://bugs.eclipse.org/bugs/show_bug.cgi?id=211659) - new ContentAssistCommandAdapter( - fInputField, - new TextContentAdapter(), - new FieldAssist(), - null, - null, - installDecoration); - fInputField.addKeyListener(new KeyListener(){ - public void keyPressed(KeyEvent e) { - // if the field assist has handled the key already then - // ignore it (https://bugs.eclipse.org/bugs/show_bug.cgi?id=211659) - if(!e.doit) - return; - if(e.character==SWT.CR || e.character==SWT.LF) { - e.doit=false; - String line=fInputField.getText(); - if(!terminal.pasteString(line+'\r')) - return; - pushLine(line); - setCommand("");//$NON-NLS-1$ - } else if(e.keyCode==SWT.ARROW_UP || e.keyCode==SWT.PAGE_UP) { - e.doit=false; - setCommand(move(fInputField.getText(),1)); - } else if(e.keyCode==SWT.ARROW_DOWN || e.keyCode==SWT.PAGE_DOWN) { - e.doit=false; - setCommand(move(fInputField.getText(),-1)); - } else if(e.keyCode==SWT.ESC) { - e.doit=false; - setCommand(escape()); - } - } - private void setCommand(String line) { - if(line==null) - return; - fInputField.setText(line); - fInputField.setSelection(fInputField.getCharCount()); - } - public void keyReleased(KeyEvent e) { - } - }); - } - public void setFont(Font font) { - fInputField.setFont(font); - fInputField.getParent().layout(true); - } - public void dispose() { - fSash.dispose(); - fSash=null; - fPanel.dispose(); - fPanel=null; - fInputField.dispose(); - fInputField=null; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ICommandInputField.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ICommandInputField.java deleted file mode 100644 index a00ebeabc2b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ICommandInputField.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control; - -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Composite; - -/** - * Interface to create a command input control. - * - */ -public interface ICommandInputField { - /** - * @param parent - * @param terminal - */ - void createControl(Composite parent, ITerminalViewControl terminal); - - void dispose(); - /** - * Sets the font of a control created with {@link #createControl(Composite, ITerminalViewControl)} - * @param control - * @param font the new text font - */ - void setFont(Font font); - -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalListener.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalListener.java deleted file mode 100644 index 1f4926eb46b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control; - -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -/** - * Provided by a view implementation. - * @author Michael Scharf - * - */ -public interface ITerminalListener { - /** - * Called when the state of the connection has changed. - * @param state - */ - void setState(TerminalState state); - - /** - * Set the title of the terminal. - * @param title - */ - void setTerminalTitle(String title); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalViewControl.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalViewControl.java deleted file mode 100644 index a3e4a269767..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/ITerminalViewControl.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Martin Oberhuber (Wind River) - [265352][api] Allow setting fonts programmatically - ******************************************************************************/ -package org.eclipse.tm.internal.terminal.control; - -import java.io.UnsupportedEncodingException; - -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Control; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -/** - * @author Michael Scharf - * - */ -public interface ITerminalViewControl { - /** - * Set the encoding that the Terminal uses to decode byte streams into - * characters. - * - * @see ITerminalControl#setEncoding(String) - * @since org.eclipse.tm.terminal 2.0 - */ - void setEncoding(String encoding) throws UnsupportedEncodingException; - - /** - * Get the Terminal's current encoding. - * - * @return the current Encoding of the Terminal. - * @see ITerminalControl#getEncoding() - * @since org.eclipse.tm.terminal 2.0 - */ - String getEncoding(); - - boolean isEmpty(); - /** - * Sets the Terminal font - * @deprecated use {@link #setFont(String)} in order to support bold and italic variants of the given font - * @param font - */ - void setFont(Font font); - /** - * Sets the font for the Terminal, using a JFace symbolic font name, such - * that bold and italic variants can be leveraged. - * @since 3.2 - * @param fontName - */ - void setFont(String fontName); - void setInvertedColors(boolean invert); - Font getFont(); - /** - * @return the text control - */ - Control getControl(); - /** - * @return the root of all controls - */ - Control getRootControl(); - boolean isDisposed(); - void selectAll(); - void clearTerminal(); - void copy(); - void paste(); - String getSelection(); - TerminalState getState(); - Clipboard getClipboard(); - void disconnectTerminal(); - void disposeTerminal(); - String getSettingsSummary(); - ITerminalConnector[] getConnectors(); - void setFocus(); - ITerminalConnector getTerminalConnector(); - void setConnector(ITerminalConnector connector); - void connectTerminal(); - /** - * @param write a single character to terminal - */ - void sendKey(char arg0); - /** - * @param string write string to terminal - */ - public boolean pasteString(String string); - - boolean isConnected(); - - /** - * @param inputField null means no input field is shown - */ - void setCommandInputField(ICommandInputField inputField); - /** - * @return null or the current input field - */ - ICommandInputField getCommandInputField(); - - /** - * @return the maximum number of lines to display - * in the terminal view. -1 means unlimited. - */ - public int getBufferLineLimit(); - - /** - * @param bufferLineLimit the maximum number of lines to show - * in the terminal view. -1 means unlimited. - */ - public void setBufferLineLimit(int bufferLineLimit); - boolean isScrollLock(); - void setScrollLock(boolean on); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/TerminalViewControlFactory.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/TerminalViewControlFactory.java deleted file mode 100644 index 5fb3d8c8571..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/TerminalViewControlFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; - -public class TerminalViewControlFactory { - /** - * Instantiate a Terminal widget. - * @param target Callback for notifying the owner of Terminal state changes. - * @param wndParent The Window parent to embed the Terminal in. - * @param connectors Provided connectors. - */ - public static ITerminalViewControl makeControl(ITerminalListener target, Composite wndParent, ITerminalConnector[] connectors) { - return makeControl(target, wndParent, connectors, false); - } - - /** - * Instantiate a Terminal widget. - * @param target Callback for notifying the owner of Terminal state changes. - * @param wndParent The Window parent to embed the Terminal in. - * @param connectors Provided connectors. - * @param useCommonPrefs If true, the Terminal widget will pick up settings - * from the org.eclipse.tm.terminal.TerminalPreferencePage Preference page. - * Otherwise, clients need to maintain settings themselves. - * @since 3.2 - */ - public static ITerminalViewControl makeControl(ITerminalListener target, Composite wndParent, ITerminalConnector[] connectors, boolean useCommonPrefs) { - return new VT100TerminalControl(target, wndParent, connectors, useCommonPrefs); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/AbstractTerminalAction.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/AbstractTerminalAction.java deleted file mode 100644 index bc5ea8d16ac..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/AbstractTerminalAction.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - Adapted from TerminalAction - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; - -public abstract class AbstractTerminalAction extends Action { - private final ITerminalViewControl fTarget; - - public AbstractTerminalAction(String strId) { - this(null, strId, 0); - } - - public AbstractTerminalAction(ITerminalViewControl target, - String strId) { - this(target, strId, 0); - } - - public AbstractTerminalAction(ITerminalViewControl target, - String strId, int style) { - super("", style); //$NON-NLS-1$ - - fTarget = target; - - setId(strId); - } - - abstract public void run(); - - protected void setupAction(String strText, String strToolTip, - String strImage, String strEnabledImage, String strDisabledImage, - boolean bEnabled) { - setupAction(strText, strToolTip, strImage, strEnabledImage, - strDisabledImage, bEnabled, TerminalPlugin.getDefault() - .getImageRegistry()); - } - - protected void setupAction(String strText, String strToolTip, - String strHoverImage, String strEnabledImage, - String strDisabledImage, boolean bEnabled, - ImageRegistry imageRegistry) { - setupAction(strText, strToolTip, imageRegistry - .getDescriptor(strHoverImage), imageRegistry - .getDescriptor(strEnabledImage), imageRegistry - .getDescriptor(strDisabledImage), bEnabled); - } - - protected void setupAction(String strText, String strToolTip, - ImageDescriptor hoverImage, ImageDescriptor enabledImage, - ImageDescriptor disabledImage, boolean bEnabled) { - setText(strText); - setToolTipText(strToolTip); - setEnabled(bEnabled); - if (enabledImage != null) { - setImageDescriptor(enabledImage); - } - if (disabledImage != null) { - setDisabledImageDescriptor(disabledImage); - } - if (hoverImage != null) { - setHoverImageDescriptor(hoverImage); - } - } - - /** - * Return the terminal instance on which the action should operate. - * - * @return the terminal instance on which the action should operate. - */ - protected ITerminalViewControl getTarget() { - return fTarget; - } - - /** - * Subclasses can update their action - * - * @param aboutToShow true before the menu is shown -- false when the menu - * gets hidden - */ - public void updateAction(boolean aboutToShow) { - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.java deleted file mode 100644 index 32ff30ff334..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.osgi.util.NLS; - -public class ActionMessages extends NLS { - static { - NLS.initializeMessages(ActionMessages.class.getName(), - ActionMessages.class); - } - - public static String COPY; - public static String CUT; - public static String PASTE; - public static String SELECTALL; - public static String CLEARALL; - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.properties b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.properties deleted file mode 100644 index fbf2da8263a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ActionMessages.properties +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Initial Contributors: -# The following Wind River employees contributed to the Terminal component -# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, -# Helmut Haigermoser and Ted Williams. -# -# Contributors: -# Michael Scharf (Wind River) - split into core, view and connector plugins -# Martin Oberhuber (Wind River) - fixed copyright headers and beautified -# Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin -############################################################################### - -# NLS_MESSAGEFORMAT_NONE - -COPY = Copy -CUT = Cut -PASTE = Paste -SELECTALL = Select All -CLEARALL = Clear Terminal diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ImageConsts.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ImageConsts.java deleted file mode 100644 index b074161de5a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/ImageConsts.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - extracted from TerminalConsts - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -public interface ImageConsts { - public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$ - public final static String IMAGE_DIR_LOCALTOOL = IMAGE_DIR_ROOT + "clcl16/"; // basic colors - size 16x16 //$NON-NLS-1$ - public final static String IMAGE_DIR_DLCL = IMAGE_DIR_ROOT + "dlcl16/"; // disabled - size 16x16 //$NON-NLS-1$ - public final static String IMAGE_DIR_ELCL = IMAGE_DIR_ROOT+ "elcl16/"; // enabled - size 16x16 //$NON-NLS-1$ - - public static final String IMAGE_CLCL_CLEAR_ALL = "ImageClclClearAll"; //$NON-NLS-1$ - - public static final String IMAGE_DLCL_CLEAR_ALL = "ImageDlclClearAll"; //$NON-NLS-1$ - - public static final String IMAGE_ELCL_CLEAR_ALL = "ImageElclClearAll"; //$NON-NLS-1$ -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionClearAll.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionClearAll.java deleted file mode 100644 index 6e38fa70c56..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionClearAll.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - * Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available - ********************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; - -public class TerminalActionClearAll extends AbstractTerminalAction { - public TerminalActionClearAll() { - super(TerminalActionClearAll.class.getName()); - - setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, - ImageConsts.IMAGE_CLCL_CLEAR_ALL, - ImageConsts.IMAGE_ELCL_CLEAR_ALL, - ImageConsts.IMAGE_DLCL_CLEAR_ALL, false); - } - - public TerminalActionClearAll(ITerminalViewControl target) { - super(target, TerminalActionClearAll.class.getName()); - - setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, - ImageConsts.IMAGE_CLCL_CLEAR_ALL, - ImageConsts.IMAGE_ELCL_CLEAR_ALL, - ImageConsts.IMAGE_DLCL_CLEAR_ALL, false); - } - - public void run() { - ITerminalViewControl target = getTarget(); - if (target != null) { - target.clearTerminal(); - } - } - - public void updateAction(boolean aboutToShow) { - ITerminalViewControl target = getTarget(); - setEnabled(target != null && !target.isEmpty()); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCopy.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCopy.java deleted file mode 100644 index 50c7fcc77e3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCopy.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - * Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -public class TerminalActionCopy extends AbstractTerminalAction { - public TerminalActionCopy() { - super(TerminalActionCopy.class.getName()); - setActionDefinitionId("org.eclipse.tm.terminal.copy"); //$NON-NLS-1$ - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.COPY, ActionMessages.COPY, si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY), si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY), si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED), true); - } - - public TerminalActionCopy(ITerminalViewControl target) { - super(target, TerminalActionCopy.class.getName()); - setActionDefinitionId("org.eclipse.tm.terminal.copy"); //$NON-NLS-1$ - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.COPY, ActionMessages.COPY, si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY), si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY), si - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED), true); - } - - public void run() { - ITerminalViewControl target = getTarget(); - if (target != null) { - String selection = target.getSelection(); - - if (!selection.equals("")) {//$NON-NLS-1$ - target.copy(); - } else { - target.sendKey('\u0003'); - } - } - } - - public void updateAction(boolean aboutToShow) { - ITerminalViewControl target = getTarget(); - boolean bEnabled = target != null; - if (aboutToShow && bEnabled) { - bEnabled = target.getSelection().length() > 0; - } - setEnabled(bEnabled); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCut.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCut.java deleted file mode 100644 index 1dae3fc6ce4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionCut.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -public class TerminalActionCut extends AbstractTerminalAction { - public TerminalActionCut() { - super(TerminalActionCut.class.getName()); - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.CUT, ActionMessages.CUT, si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT), si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT), si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED), true); - } - - public TerminalActionCut(ITerminalViewControl target) { - super(target, TerminalActionCut.class.getName()); - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.CUT, ActionMessages.CUT, si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT), si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT), si - .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED), true); - } - - public void run() { - ITerminalViewControl target = getTarget(); - if (target != null) { - target.sendKey('\u0018'); - } - } - - public void updateAction(boolean aboutToShow) { - // Cut is always disabled - setEnabled(false); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionPaste.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionPaste.java deleted file mode 100644 index cd042be0fbc..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionPaste.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - * Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available - * Uwe Stieber (Wind River) - [294719] [terminal] SWT Widget disposed in TerminalActionPaste - * Martin Oberhuber (Wind River) - [296212] Cannot paste text into terminal on some Linux hosts - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -public class TerminalActionPaste extends AbstractTerminalAction { - public TerminalActionPaste() { - super(TerminalActionPaste.class.getName()); - setActionDefinitionId("org.eclipse.tm.terminal.paste"); //$NON-NLS-1$ - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.PASTE, ActionMessages.PASTE, si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE), si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED), si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE), false); - } - - public TerminalActionPaste(ITerminalViewControl target) { - super(target, TerminalActionPaste.class.getName()); - setActionDefinitionId("org.eclipse.tm.terminal.paste"); //$NON-NLS-1$ - ISharedImages si = PlatformUI.getWorkbench().getSharedImages(); - setupAction(ActionMessages.PASTE, ActionMessages.PASTE, si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE), si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED), si - .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE), false); - } - - public void run() { - ITerminalViewControl target = getTarget(); - if (target != null) { - target.paste(); - } - } - - public void updateAction(boolean aboutToShow) { - ITerminalViewControl target = getTarget(); - boolean bEnabled = target != null && target.getClipboard() != null && !target.getClipboard().isDisposed(); - if (bEnabled) { - String strText = (String) target.getClipboard().getContents( - TextTransfer.getInstance()); - bEnabled = ((strText != null) && (!strText.equals("")) && (target.getState() == TerminalState.CONNECTED));//$NON-NLS-1$ - } - setEnabled(bEnabled); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionSelectAll.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionSelectAll.java deleted file mode 100644 index 6ebba96795d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/actions/TerminalActionSelectAll.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin - * Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.actions; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; - -public class TerminalActionSelectAll extends AbstractTerminalAction { - public TerminalActionSelectAll() { - super(TerminalActionSelectAll.class.getName()); - - setupAction(ActionMessages.SELECTALL, ActionMessages.SELECTALL, - (ImageDescriptor) null, null, null, false); - } - - public TerminalActionSelectAll(ITerminalViewControl target) { - super(target, TerminalActionSelectAll.class.getName()); - - setupAction(ActionMessages.SELECTALL, ActionMessages.SELECTALL, - (ImageDescriptor) null, null, null, false); - } - - public void run() { - ITerminalViewControl target = getTarget(); - if (target != null) { - target.selectAll(); - } - } - - public void updateAction(boolean aboutToShow) { - ITerminalViewControl target = getTarget(); - setEnabled(target != null && !target.isEmpty()); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/ITerminalControlForText.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/ITerminalControlForText.java deleted file mode 100644 index f15468023e7..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/ITerminalControlForText.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Anton Leherbauer (Wind River) - [458398] Add support for normal/application cursor keys mode - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.control.impl; - -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -/** - * need a better name! - * @author Michael Scharf - * - */ -public interface ITerminalControlForText { - - TerminalState getState(); - void setState(TerminalState state); - void setTerminalTitle(String title); - - ITerminalConnector getTerminalConnector(); - - OutputStream getOutputStream(); - - /** - * Enable/disable Application Cursor Keys mode (DECCKM) - * @param enable - */ - void enableApplicationCursorKeys(boolean enable); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalInputStream.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalInputStream.java deleted file mode 100644 index 8bcdf44cfb8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/impl/TerminalInputStream.java +++ /dev/null @@ -1,334 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1996, 2008 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Douglas Lea (Addison Wesley) - [cq:1552] BoundedBufferWithStateTracking adapted to BoundedByteBuffer - *******************************************************************************/ - -package org.eclipse.tm.internal.terminal.control.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Timer; -import java.util.TimerTask; - -import org.eclipse.swt.widgets.Display; - -/** - * The main purpose of this class is to start a runnable in the - * display thread when data is available and to pretend no data - * is available after a given amount of time the runnable is running. - * - */ -public class TerminalInputStream extends InputStream { - /** - * The maximum time in milliseconds the {@link #fNotifyChange} runs until - * {@link #ready()} returns false. - */ - private final int fUITimeout; - /** - * The output stream used by the terminal backend to write to the terminal - */ - protected final OutputStream fOutputStream; - /** - * This runnable is called every time some characters are available from... - */ - private final Runnable fNotifyChange; - /** - * A shared timer for all terminals. This times is used to limit the - * time used in the display thread.... - */ - static Timer fgTimer=new Timer(false); - /** - * A blocking byte queue. - */ - private final BoundedByteBuffer fQueue; - - /** - * The maximum amount of data read and written in one shot. - * The timer cannot interrupt reading this amount of data. - * {@link #available()} and {@link #read(byte[], int, int)} - * This is used as optimization, because reading single characters - * can be very inefficient, because each call is synchronized. - */ - // block size must be smaller than the Queue capacity! - final int BLOCK_SIZE=64; - - - /** - * The runnable that is scheduled in the display tread. Takes care of the - * timeout management. It calls the {@link #fNotifyChange} - */ - // synchronized with fQueue! - private Runnable fRunnable; - - /** - * Used as flag to indicate that the current runnable - * has used enough time in the display thread. - * This variable is set by a timer thread after the - * Runnable starts to run in the Display thread after - * {@link #fUITimeout}. - */ - // synchronized with fQueue! - private boolean fEnoughDisplayTime; - - /** - * A byte bounded buffer used to synchronize the input and the output stream. - *

            - * Adapted from BoundedBufferWithStateTracking - * http://gee.cs.oswego.edu/dl/cpj/allcode.java - * http://gee.cs.oswego.edu/dl/cpj/ - *

            - * BoundedBufferWithStateTracking is part of the examples for the book - * Concurrent Programming in Java: Design Principles and Patterns by - * Doug Lea (ISBN 0-201-31009-0). Second edition published by - * Addison-Wesley, November 1999. The code is - * Copyright(c) Douglas Lea 1996, 1999 and released to the public domain - * and may be used for any purposes whatsoever. - *

            - * For some reasons a solution based on - * PipedOutputStream/PipedIntputStream - * does work *very* slowly: - * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4404700 - *

            - * - */ - class BoundedByteBuffer { - protected final byte[] fBuffer; // the elements - protected int fPutPos = 0; // circular indices - protected int fTakePos = 0; - protected int fUsedSlots = 0; // the count - public BoundedByteBuffer(int capacity) throws IllegalArgumentException { - // make sure we don't deadlock on too small capacity - if(capacityend) - n=end; - // now block the queue for the time we need to - // add some characters - synchronized(fQueue) { - for(int i=noff;i0)try {read(buff);} catch (IOException e) {break;}}};} - fOutputStream =new TerminalOutputStream(); - fNotifyChange=notifyChange; - fQueue=new BoundedByteBuffer(bufferSize); - fUITimeout=uiTimeout; - } - /** - * Posts the runnable {@link #fNotifyChange} to the display Thread, - * unless the runnable is already scheduled. - * It will make {@link #ready} return false after - * {@link #fUITimeout} milli seconds. - */ - void bytesAreAvailable() { - // synchronize on the Queue to reduce the locks - synchronized(fQueue) { - if(fRunnable==null) { - fRunnable=new Runnable(){ - public void run() { - // protect the access to fRunnable - synchronized(fQueue){ - fRunnable=null; - } - // end the reading after some time - startTimer(fUITimeout); - // and start the real runnable - fNotifyChange.run(); - } - - }; - // TODO: make sure we don't create a display if the display is disposed... - Display.getDefault().asyncExec(fRunnable); - } - } - - } - /** - * Starts a timer that sets {@link #fEnoughDisplayTime} to - * true after milliSec. - * @param milliSec The time after which fEnoughDisplayTime is set to true. - */ - void startTimer(int milliSec) { - synchronized(fQueue) { - fEnoughDisplayTime=false; - } - fgTimer.schedule(new TimerTask(){ - public void run() { - synchronized(fQueue) { - fEnoughDisplayTime=true; - // there is some data available - if(fQueue.size()>0) { - // schedule a new runnable to do the work - bytesAreAvailable(); - } - } - }}, milliSec); - } - /** - * @return the output stream used by the backend to write to the terminal. - */ - public OutputStream getOutputStream() { - return fOutputStream; - } - /** - * Must be called in the Display Thread! - * @return true if a character is available for the terminal to show. - */ - public int available() { - int available; - synchronized(fQueue) { - if(fEnoughDisplayTime) - return 0; - available=fQueue.size(); - } - // Limit the available amount of data. - // else our trick of limiting the time spend - // reading might not work. - if(available>BLOCK_SIZE) - available=BLOCK_SIZE; - return available; - } - /** - * @return the next available byte. Check with {@link #available} - * if characters are available. - */ - public int read() throws IOException { - try { - return fQueue.read(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - return -1; - } - } - /** - * Closing a ByteArrayInputStream has no effect. The methods in - * this class can be called after the stream has been closed without - * generating an IOException. - *

            - */ - public void close() throws IOException { - } - - public int read(byte[] cbuf, int off, int len) throws IOException { - int n=0; - // read as much as we can using a single synchronized statement - synchronized (fQueue) { - try { - // The assumption is that the caller has used available to - // check if bytes are available! That's why we don't check - // for fEnoughDisplayTime! - // Make sure that not more than BLOCK_SIZE is read in one call - while(fQueue.size()>0 && n - * - * There are never any ANSI control characters or escape sequences in the - * text being displayed by this method (this includes newlines, carriage - * returns, and tabs). - *

            - */ - void appendString(String buffer); - - /** - * Process a newline (Control-J) character. A newline (NL) character just - * moves the cursor to the same column on the next line, creating new lines - * when the cursor reaches the bottom edge of the terminal. This is - * counter-intuitive, especially to UNIX programmers who are taught that - * writing a single NL to a terminal is sufficient to move the cursor to the - * first column of the next line, as if a carriage return (CR) and a NL were - * written. - *

            - * - * UNIX terminals typically display a NL character as a CR followed by a NL - * because the terminal device typically has the ONLCR attribute bit set - * (see the termios(4) man page for details), which causes the terminal - * device driver to translate NL to CR + NL on output. The terminal itself - * (i.e., a hardware terminal or a terminal emulator, like xterm or this - * code) _always_ interprets a CR to mean "move the cursor to the beginning - * of the current line" and a NL to mean "move the cursor to the same column - * on the next line". - *

            - */ - void processNewline(); - - /** - * This method returns the relative line number of the line containing the - * cursor. The returned line number is relative to the topmost visible line, - * which has relative line number 0. - * - * @return The relative line number of the line containing the cursor. - */ - int getCursorLine(); - - int getCursorColumn(); - - /** - * This method moves the cursor to the specified line and column. Parameter - * targetLine is the line number of a screen line, so it has a - * minimum value of 0 (the topmost screen line) and a maximum value of - * heightInLines - 1 (the bottommost screen line). A line does not have to - * contain any text to move the cursor to any column in that line. - */ - void setCursor(int targetLine, int targetColumn); - - void setCursorColumn(int targetColumn); - - void setCursorLine(int targetLine); - - int getLines(); - - int getColumns(); - - /** - * Enables VT100 line wrapping mode (default is off). - * This corresponds to the VT100 'eat_newline_glitch' terminal capability. - * If enabled, writing to the rightmost column does not cause - * an immediate wrap to the next line. Instead the line wrap occurs on the - * next output character. - * - * @param enable whether to enable or disable VT100 line wrapping mode - */ - void setVT100LineWrapping(boolean enable); - - /** - * @return whether VT100 line wrapping mode is enabled - */ - boolean isVT100LineWrapping(); - - /** - * Enables/disables insert mode (IRM). - * - * @param enable whether to enable insert mode - */ - void setInsertMode(boolean enable); - - /** - * Set scrolling region. Negative values reset the scroll region. - * - * @param top top line of scroll region - * @param bottom bottom line of scroll region - */ - void setScrollRegion(int top, int bottom); - - /** - * Scroll text upwards. - * - * @param lines number of lines to scroll - */ - void scrollUp(int lines); - - /** - * Scroll text downwards. - * - * @param lines number of lines to scroll - */ - void scrollDown(int lines); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/LoggingOutputStream.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/LoggingOutputStream.java deleted file mode 100644 index a4c84a5e10c..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/LoggingOutputStream.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.Logger; - -public class LoggingOutputStream extends FilterOutputStream { - - public LoggingOutputStream(OutputStream out) { - super(out); - } - - public void write(byte[] b, int off, int len) throws IOException { - if(Logger.isLogEnabled()) - Logger.log("Received " + len + " bytes: '" + //$NON-NLS-1$ //$NON-NLS-2$ - Logger.encode(new String(b, 0, len)) + "'"); //$NON-NLS-1$ - - // we cannot call super.write, because this would call our write - // which logs character by character..... - //super.write(b, off, len); - if ((off | len | (b.length - (len + off)) | (off + len)) < 0) - throw new IndexOutOfBoundsException(); - - for (int i = 0 ; i < len ; i++) { - super.write(b[off + i]); - } - } - - public void write(int b) throws IOException { - if(Logger.isLogEnabled()) - Logger.log("Received " + 1 + " bytes: '" + //$NON-NLS-1$ //$NON-NLS-2$ - Logger.encode(new String(new byte[]{(byte)b}, 0, 1)) + "'"); //$NON-NLS-1$ - super.write(b); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100BackendTraceDecorator.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100BackendTraceDecorator.java deleted file mode 100644 index 78531437ee6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100BackendTraceDecorator.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - * Anton Leherbauer (Wind River) - [458218] Add support for ANSI insert mode - * Anton Leherbauer (Wind River) - [458402] Add support for scroll up/down and scroll region - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import java.io.PrintStream; - -import org.eclipse.tm.terminal.model.Style; - -public class VT100BackendTraceDecorator implements IVT100EmulatorBackend { - final IVT100EmulatorBackend fBackend; - final PrintStream fWriter; - public VT100BackendTraceDecorator(IVT100EmulatorBackend backend, PrintStream out) { - fBackend = backend; - fWriter=out; - } - - public void appendString(String buffer) { - fWriter.println("appendString(\""+buffer+"\")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.appendString(buffer); - } - - public void clearAll() { - fWriter.println("clearAll()"); //$NON-NLS-1$ - fBackend.clearAll(); - } - - public void deleteCharacters(int n) { - fWriter.println("deleteCharacters("+n+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.deleteCharacters(n); - } - - public void deleteLines(int n) { - fWriter.println("deleteLines("+n+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.deleteLines(n); - } - - public void eraseAll() { - fWriter.println("eraseAll()"); //$NON-NLS-1$ - fBackend.eraseAll(); - } - - public void eraseLine() { - fWriter.println("eraseLine()"); //$NON-NLS-1$ - fBackend.eraseLine(); - } - - public void eraseLineToCursor() { - fWriter.println("eraseLineToCursor()"); //$NON-NLS-1$ - fBackend.eraseLineToCursor(); - } - - public void eraseLineToEnd() { - fWriter.println("eraseLineToEnd()"); //$NON-NLS-1$ - fBackend.eraseLineToEnd(); - } - - public void eraseToCursor() { - fWriter.println("eraseToCursor()"); //$NON-NLS-1$ - fBackend.eraseToCursor(); - } - - public void eraseToEndOfScreen() { - fWriter.println("eraseToEndOfScreen()"); //$NON-NLS-1$ - fBackend.eraseToEndOfScreen(); - } - - public int getColumns() { - return fBackend.getColumns(); - } - - public int getCursorColumn() { - return fBackend.getCursorColumn(); - } - - public int getCursorLine() { - return fBackend.getCursorLine(); - } - - public Style getDefaultStyle() { - return fBackend.getDefaultStyle(); - } - - public int getLines() { - return fBackend.getLines(); - } - - public Style getStyle() { - return fBackend.getStyle(); - } - - public void insertCharacters(int charactersToInsert) { - fWriter.println("insertCharacters("+charactersToInsert+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.insertCharacters(charactersToInsert); - } - - public void insertLines(int n) { - fWriter.println("insertLines("+n+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.insertLines(n); - } - - public void processNewline() { - fWriter.println("processNewline()"); //$NON-NLS-1$ - fBackend.processNewline(); - } - - public void setCursor(int targetLine, int targetColumn) { - fWriter.println("setCursor("+targetLine+", "+targetColumn+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - fBackend.setCursor(targetLine, targetColumn); - } - - public void setCursorColumn(int targetColumn) { - fWriter.println("setCursorColumn("+targetColumn+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setCursorColumn(targetColumn); - } - - public void setCursorLine(int targetLine) { - fWriter.println("setCursorLine("+targetLine+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setCursorLine(targetLine); - } - - public void setDefaultStyle(Style defaultStyle) { - fWriter.println("setDefaultStyle("+defaultStyle+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setDefaultStyle(defaultStyle); - } - - public void setDimensions(int lines, int cols) { - fWriter.println("setDimensions("+lines+","+cols+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - fBackend.setDimensions(lines, cols); - } - - public void setStyle(Style style) { - fWriter.println("setStyle("+style+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setStyle(style); - } - - public void setVT100LineWrapping(boolean enable) { - fWriter.println("setVT100LineWrapping("+enable+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setVT100LineWrapping(enable); - } - - public boolean isVT100LineWrapping() { - return fBackend.isVT100LineWrapping(); - } - - public void setInsertMode(boolean enable) { - fWriter.println("setInsertMode("+enable+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setInsertMode(enable); - } - - public void setScrollRegion(int top, int bottom) { - fWriter.println("setScrollRegion("+top+','+bottom+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.setScrollRegion(top, bottom); - } - - public void scrollUp(int lines) { - fWriter.println("scrollUp("+lines+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.scrollUp(lines); - } - - public void scrollDown(int lines) { - fWriter.println("scrollDown("+lines+")"); //$NON-NLS-1$ //$NON-NLS-2$ - fBackend.scrollDown(lines); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java deleted file mode 100644 index 7c201c7e8a2..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java +++ /dev/null @@ -1,1390 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Michael Scharf (Wind River) - [209746] There are cases where some colors not displayed correctly - * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1 - * Michael Scharf (Wind River) - [262996] get rid of TerminalState.OPENED - * Martin Oberhuber (Wind River) - [334969] Fix multi-command SGR sequence - * Kris De Volder (VMWare) - [392107] Switched interpretation for ESC[0K and ESC[1K sequences - * Martin Oberhuber (Wind River) - [401386] Regression: No header on top due to incorrect ESC[K interpretation - * Martin Oberhuber (Wind River) - [401480] Handle ESC[39;49m and ESC[G - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - * Anton Leherbauer (Wind River) - [458218] Add support for ANSI insert mode - * Anton Leherbauer (Wind River) - [458398] Add support for normal/application cursor keys mode - * Anton Leherbauer (Wind River) - [458402] Add support for scroll up/down and scroll region - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import java.io.IOException; -import java.io.Reader; - -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; -import org.eclipse.tm.internal.terminal.control.impl.ITerminalControlForText; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.Style; - -/** - * This class processes character data received from the remote host and - * displays it to the user using the Terminal view's StyledText widget. This - * class processes ANSI control characters, including NUL, backspace, carriage - * return, linefeed, and a subset of ANSI escape sequences sufficient to allow - * use of screen-oriented applications, such as vi, Emacs, and any GNU - * readline-enabled application (Bash, bc, ncftp, etc.). - *

            - * - * @author Fran Litterio - * @author Chris Thew - */ -public class VT100Emulator implements ControlListener { - /** This is a character processing state: Initial state. */ - private static final int ANSISTATE_INITIAL = 0; - - /** This is a character processing state: We've seen an escape character. */ - private static final int ANSISTATE_ESCAPE = 1; - - /** - * This is a character processing state: We've seen a '[' after an escape - * character. Expecting a parameter character or a command character next. - */ - private static final int ANSISTATE_EXPECTING_PARAMETER_OR_COMMAND = 2; - - /** - * This is a character processing state: We've seen a ']' after an escape - * character. We are now expecting an operating system command that - * reprograms an intelligent terminal. - */ - private static final int ANSISTATE_EXPECTING_OS_COMMAND = 3; - - /** - * This is a character processing state: We've seen a '[?' after an escape - * character. Expecting a parameter character or a command character next. - */ - private static final int ANSISTATE_EXPECTING_DEC_PRIVATE_COMMAND = 4; - - /** - * This is a character processing state: We've seen one of ()*+-./ after an escape - * character. Expecting a character set designation character. - */ - private static final int ANSISTATE_EXPECTING_CHARSET_DESIGNATION = 5; - - - /** - * This field holds the current state of the Finite TerminalState Automaton (FSA) - * that recognizes ANSI escape sequences. - * - * @see #processNewText() - */ - private int ansiState = ANSISTATE_INITIAL; - - /** - * This field holds a reference to the {@link TerminalControl} object that - * instantiates this class. - */ - private final ITerminalControlForText terminal; - - /** - * This field holds a reference to the StyledText widget that is used to - * display text to the user. - */ - final private IVT100EmulatorBackend text; - /** - * This field hold the saved absolute line number of the cursor when - * processing the "ESC 7" and "ESC 8" command sequences. - */ - private int savedCursorLine = 0; - - /** - * This field hold the saved column number of the cursor when processing the - * "ESC 7" and "ESC 8" command sequences. - */ - private int savedCursorColumn = 0; - - /** - * This field holds an array of StringBuffer objects, each of which is one - * parameter from the current ANSI escape sequence. For example, when - * parsing the escape sequence "\e[20;10H", this array holds the strings - * "20" and "10". - */ - private final StringBuffer[] ansiParameters = new StringBuffer[16]; - - /** - * This field holds the OS-specific command found in an escape sequence of - * the form "\e]...\u0007". - */ - private final StringBuffer ansiOsCommand = new StringBuffer(128); - - /** - * This field holds the index of the next unused element of the array stored - * in field {@link #ansiParameters}. - */ - private int nextAnsiParameter = 0; - - Reader fReader; - - boolean fCrAfterNewLine; - /** - * The constructor. - */ - public VT100Emulator(ITerminalTextData data, ITerminalControlForText terminal, Reader reader) { - super(); - - Logger.log("entered"); //$NON-NLS-1$ - - this.terminal = terminal; - - for (int i = 0; i < ansiParameters.length; ++i) { - ansiParameters[i] = new StringBuffer(); - } - setInputStreamReader(reader); - if(TerminalPlugin.isOptionEnabled(Logger.TRACE_DEBUG_LOG_VT100BACKEND)) - text=new VT100BackendTraceDecorator(new VT100EmulatorBackend(data),System.out); - else - text=new VT100EmulatorBackend(data); - -// text.setDimensions(24, 80); - Style style=Style.getStyle("BLACK", "WHITE"); //$NON-NLS-1$ //$NON-NLS-2$ - text.setDefaultStyle(style); - text.setStyle(style); - } - - /** - * Set the reader that this Terminal gets its input from. - * - * The reader can be changed while the Terminal is running, but a change of - * the reader likely loses some characters which have not yet been fully - * read. Changing the reader can be done in order to change the selected - * Encoding, though. This is typically done when the Terminal is - * constructed, i.e. before it really starts operation; or, when the user - * manually selects a different encoding and thus doesn't care about losing - * old characters. - * - * @param reader the new Reader - */ - public void setInputStreamReader(Reader reader) { - fReader = reader; - } - - public void setDimensions(int lines,int cols) { - text.setDimensions(lines, cols); - ITerminalConnector telnetConnection = getConnector(); - if (telnetConnection != null) { - telnetConnection.setTerminalSize(text.getColumns(), text.getLines()); - } - - } - - /** - * This method performs clean up when this VT100Emulator object is no longer - * needed. After calling this method, no other method on this object should - * be called. - */ - public void dispose() { - } - - /** - * This method is required by interface ControlListener. It allows us to - * know when the StyledText widget is moved. - */ - public void controlMoved(ControlEvent event) { - Logger.log("entered"); //$NON-NLS-1$ - // Empty. - } - - /** - * This method is required by interface ControlListener. It allows us to - * know when the StyledText widget is resized. - */ - public void controlResized(ControlEvent event) { - Logger.log("entered"); //$NON-NLS-1$ - adjustTerminalDimensions(); - } - - /** - * This method erases all text from the Terminal view. - */ - public void clearTerminal() { - Logger.log("entered"); //$NON-NLS-1$ - text.clearAll(); - } - - /** - * This method is called when the user changes the Terminal view's font. We - * attempt to recompute the pixel width of the new font's characters and fix - * the terminal's dimensions. - */ - public void fontChanged() { - Logger.log("entered"); //$NON-NLS-1$ - - if (text != null) - adjustTerminalDimensions(); - } -// /** -// * This method executes in the Display thread to process data received from -// * the remote host by class {@link org.eclipse.tm.internal.terminal.telnet.TelnetConnection} and -// * other implementors of {@link ITerminalConnector}, like the -// * SerialPortHandler. -// *

            -// * These connectors write text to the terminal's buffer through -// * {@link TerminalControl#writeToTerminal(String)} and then have -// * this run method executed in the display thread. This method -// * must not execute at the same time as methods -// * {@link #setNewText(StringBuffer)} and {@link #clearTerminal()}. -// *

            -// * IMPORTANT: This method must be called in strict alternation with method -// * {@link #setNewText(StringBuffer)}. -// *

            -// */ - public void processText() { - try { - // Find the width and height of the terminal, and resize it to display an - // integral number of lines and columns. - - adjustTerminalDimensions(); - - // Restore the caret offset, process and display the new text, then save - // the caret offset. See the documentation for field caretOffset for - // details. - - // ISSUE: Is this causing the scroll-to-bottom-on-output behavior? - - try { - processNewText(); - } catch (IOException e) { - Logger.logException(e); - } - - } catch (Exception ex) { - Logger.logException(ex); - } - } - /** - * This method scans the newly received text, processing ANSI control - * characters and escape sequences and displaying normal text. - * @throws IOException - */ - private void processNewText() throws IOException { - Logger.log("entered"); //$NON-NLS-1$ - - - // Scan the newly received text. - - while (hasNextChar()) { - char character = getNextChar(); - - switch (ansiState) { - case ANSISTATE_INITIAL: - switch (character) { - case '\u0000': - break; // NUL character. Ignore it. - - case '\u0007': - processBEL(); // BEL (Control-G) - break; - - case '\b': - processBackspace(); // Backspace - break; - - case '\t': - processTab(); // Tab. - break; - - case '\n': - processNewline(); // Newline (Control-J) - if(fCrAfterNewLine) - processCarriageReturn(); // Carriage Return (Control-M) - break; - - case '\r': - processCarriageReturn(); // Carriage Return (Control-M) - break; - - case '\u001b': - ansiState = ANSISTATE_ESCAPE; // Escape. - break; - - default: - processNonControlCharacters(character); - break; - } - break; - - case ANSISTATE_ESCAPE: - // We've seen an escape character. Here, we process the character - // immediately following the escape. - - switch (character) { - case '[': - ansiState = ANSISTATE_EXPECTING_PARAMETER_OR_COMMAND; - nextAnsiParameter = 0; - - // Erase the parameter strings in preparation for optional - // parameter characters. - - for (int i = 0; i < ansiParameters.length; ++i) { - ansiParameters[i].delete(0, ansiParameters[i].length()); - } - break; - - case ']': - ansiState = ANSISTATE_EXPECTING_OS_COMMAND; - ansiOsCommand.delete(0, ansiOsCommand.length()); - break; - - case ')': - case '(': - case '*': - case '+': - case '-': - case '.': - case '/': - ansiState = ANSISTATE_EXPECTING_CHARSET_DESIGNATION; - break; - - case '7': - // Save cursor position and character attributes - - ansiState = ANSISTATE_INITIAL; - savedCursorLine = relativeCursorLine(); - savedCursorColumn = getCursorColumn(); - break; - - case '8': - // Restore cursor and attributes to previously saved - // position - - ansiState = ANSISTATE_INITIAL; - moveCursor(savedCursorLine, savedCursorColumn); - break; - - case 'c': - // Reset the terminal - ansiState = ANSISTATE_INITIAL; - resetTerminal(); - break; - - default: - Logger - .log("Unsupported escape sequence: escape '" + character + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - ansiState = ANSISTATE_INITIAL; - break; - } - break; - - case ANSISTATE_EXPECTING_PARAMETER_OR_COMMAND: - if (character == '?') { - ansiState = ANSISTATE_EXPECTING_DEC_PRIVATE_COMMAND; - break; - } - - // Parameters can appear after the '[' in an escape sequence, but they - // are optional. - - if (character == '@' || (character >= 'A' && character <= 'Z') - || (character >= 'a' && character <= 'z')) { - ansiState = ANSISTATE_INITIAL; - processAnsiCommandCharacter(character); - } else { - processAnsiParameterCharacter(character); - } - break; - - case ANSISTATE_EXPECTING_OS_COMMAND: - // A BEL (\u0007) character marks the end of the OSC sequence. - - if (character == '\u0007') { - ansiState = ANSISTATE_INITIAL; - processAnsiOsCommand(); - } else { - ansiOsCommand.append(character); - } - break; - - case ANSISTATE_EXPECTING_DEC_PRIVATE_COMMAND: - // Parameters can appear after the '[?' in an escape sequence, but they - // are optional. - - if (character == '@' || (character >= 'A' && character <= 'Z') - || (character >= 'a' && character <= 'z')) { - ansiState = ANSISTATE_INITIAL; - processDecPrivateCommandCharacter(character); - } else { - processAnsiParameterCharacter(character); - } - break; - - case ANSISTATE_EXPECTING_CHARSET_DESIGNATION: - if (character != '%') - ansiState = ANSISTATE_INITIAL; - // Character set designation commands are ignored - break; - - default: - // This should never happen! If it does happen, it means there is a - // bug in the FSA. For robustness, we return to the initial - // state. - - Logger.log("INVALID ANSI FSA STATE: " + ansiState); //$NON-NLS-1$ - ansiState = ANSISTATE_INITIAL; - break; - } - } - } - private void resetTerminal() { - text.eraseAll(); - text.setCursor(0, 0); - text.setStyle(text.getDefaultStyle()); - text.setScrollRegion(-1, -1); - text.setInsertMode(false); - terminal.enableApplicationCursorKeys(false); - } - /** - * This method is called when we have parsed an OS Command escape sequence. - * The only one we support is "\e]0;...\u0007", which sets the terminal - * title. - */ - private void processAnsiOsCommand() { - if (ansiOsCommand.charAt(0) != '0' || ansiOsCommand.charAt(1) != ';') { - Logger - .log("Ignoring unsupported ANSI OSC sequence: '" + ansiOsCommand + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - terminal.setTerminalTitle(ansiOsCommand.substring(2)); - } - - /** - * This method dispatches control to various processing methods based on the - * command character found in the most recently received ANSI escape - * sequence. This method only handles command characters that follow the - * ANSI standard Control Sequence Introducer (CSI), which is "\e[...", where - * "..." is an optional ';'-separated sequence of numeric parameters. - *

            - */ - private void processAnsiCommandCharacter(char ansiCommandCharacter) { - // If the width or height of the terminal is ridiculously small (one line or - // column or less), don't even try to process the escape sequence. This avoids - // throwing an exception (SPR 107450). The display will be messed up, but what - // did you user expect by making the terminal so small? - - switch (ansiCommandCharacter) { - case '@': - // Insert character(s). - processAnsiCommand_atsign(); - break; - - case 'A': - // Move cursor up N lines (default 1). - processAnsiCommand_A(); - break; - - case 'B': - // Move cursor down N lines (default 1). - processAnsiCommand_B(); - break; - - case 'C': - // Move cursor forward N columns (default 1). - processAnsiCommand_C(); - break; - - case 'D': - // Move cursor backward N columns (default 1). - processAnsiCommand_D(); - break; - - case 'd': - // Line Position Absolute [row] (default = [1,column]) (VPA). - processAnsiCommand_d(); - break; - - case 'E': - // Move cursor to first column of Nth next line (default 1). - processAnsiCommand_E(); - break; - - case 'F': - // Move cursor to first column of Nth previous line (default 1). - processAnsiCommand_F(); - break; - - case 'G': - // Move to column N of current line (default 1). - processAnsiCommand_G(); - break; - - case 'H': - // Set cursor Position. - processAnsiCommand_H(); - break; - - case 'h': - // Reset Mode. - processAnsiCommand_h(); - break; - - case 'J': - // Erase part or all of display. Cursor does not move. - processAnsiCommand_J(); - break; - - case 'K': - // Erase in line (cursor does not move). - processAnsiCommand_K(); - break; - - case 'L': - // Insert line(s) (current line moves down). - processAnsiCommand_L(); - break; - - case 'l': - // Set Mode. - processAnsiCommand_l(); - break; - - case 'M': - // Delete line(s). - processAnsiCommand_M(); - break; - - case 'm': - // Set Graphics Rendition (SGR). - processAnsiCommand_m(); - break; - - case 'n': - // Device Status Report (DSR). - processAnsiCommand_n(); - break; - - case 'P': - // Delete character(s). - processAnsiCommand_P(); - break; - - case 'r': - // Set Scrolling Region. - processAnsiCommand_r(); - break; - - case 'S': - // Scroll up. - processAnsiCommand_S(); - break; - - case 'T': - // Scroll down. - processAnsiCommand_T(); - break; - - case 'X': - // Erase character. - // Emacs, vi, and GNU readline don't seem to use this command, so we ignore - // it for now. - break; - - case 'Z': - // Cursor back tab. - // Emacs, vi, and GNU readline don't seem to use this command, so we ignore - // it for now. - break; - - default: - Logger.log("Ignoring unsupported ANSI command character: '" + //$NON-NLS-1$ - ansiCommandCharacter + "'"); //$NON-NLS-1$ - break; - } - } - - /** - * This method dispatches control to various processing methods based on the - * command character found in the most recently received DEC private mode escape - * sequence. This method only handles command characters that follow the - * control sequence CSI ? - */ - private void processDecPrivateCommandCharacter(char commandCharacter) { - switch (commandCharacter) { - case 'h': - // DEC Private Mode Set (DECSET) - processDecPrivateCommand_h(); - break; - - case 'l': - // DEC Private Mode Reset (DECRST) - processDecPrivateCommand_l(); - break; - - default: - Logger.log("Ignoring unsupported DEC private command character: '" + //$NON-NLS-1$ - commandCharacter + "'"); //$NON-NLS-1$ - break; - } - } - - /** - * This method makes room for N characters on the current line at the cursor - * position. Text under the cursor moves right without wrapping at the end - * of the line. - */ - private void processAnsiCommand_atsign() { - int charactersToInsert = getAnsiParameter(0); - text.insertCharacters(charactersToInsert); - } - - /** - * This method moves the cursor up by the number of lines specified by the - * escape sequence parameter (default 1). - */ - private void processAnsiCommand_A() { - moveCursorUp(getAnsiParameter(0)); - } - - /** - * This method moves the cursor down by the number of lines specified by the - * escape sequence parameter (default 1). - */ - private void processAnsiCommand_B() { - moveCursorDown(getAnsiParameter(0)); - } - - /** - * This method moves the cursor forward by the number of columns specified - * by the escape sequence parameter (default 1). - */ - private void processAnsiCommand_C() { - moveCursorForward(getAnsiParameter(0)); - } - - /** - * This method moves the cursor backward by the number of columns specified - * by the escape sequence parameter (default 1). - */ - private void processAnsiCommand_D() { - moveCursorBackward(getAnsiParameter(0)); - } - - /** - * This method moves the cursor to a specific row. - */ - private void processAnsiCommand_d() { - // Line Position Absolute [row] (default = [1,column]) (VPA). - text.setCursorLine(getAnsiParameter(0) - 1); - } - - /** - * This method moves the cursor to the first column of the Nth next line, - * where N is specified by the ANSI parameter (default 1). - */ - private void processAnsiCommand_E() { - int linesToMove = getAnsiParameter(0); - - moveCursor(relativeCursorLine() + linesToMove, 0); - } - - /** - * This method moves the cursor to the first column of the Nth previous - * line, where N is specified by the ANSI parameter (default 1). - */ - private void processAnsiCommand_F() { - int linesToMove = getAnsiParameter(0); - - moveCursor(relativeCursorLine() - linesToMove, 0); - } - - /** - * This method moves the cursor within the current line to the column - * specified by the ANSI parameter (default is column 1). - */ - private void processAnsiCommand_G() { - moveCursor(relativeCursorLine(), getAnsiParameter(0) - 1); - } - - /** - * This method sets the cursor to a position specified by the escape - * sequence parameters (default is the upper left corner of the screen). - */ - private void processAnsiCommand_H() { - moveCursor(getAnsiParameter(0) - 1, getAnsiParameter(1) - 1); - } - - /** - * This method sets terminal modes. - */ - private void processAnsiCommand_h() { - if (getAnsiParameter(0) == 4) { - // set insert mode - text.setInsertMode(true); - } - } - - /** - * This method deletes some (or all) of the text on the screen without - * moving the cursor. - */ - private void processAnsiCommand_J() { - int ansiParameter; - - if (ansiParameters[0].length() == 0) - ansiParameter = 0; - else - ansiParameter = getAnsiParameter(0); - - switch (ansiParameter) { - case 0: - text.eraseToEndOfScreen(); - break; - - case 1: - // Erase from beginning to current position (inclusive). - text.eraseToCursor(); - break; - - case 2: - // Erase entire display. - - text.eraseAll(); - break; - - default: - Logger.log("Unexpected J-command parameter: " + ansiParameter); //$NON-NLS-1$ - break; - } - } - - /** - * This method deletes some (or all) of the text in the current line without - * moving the cursor. - */ - private void processAnsiCommand_K() { - //Bug 401386: missing parameter must be interpreted as 0, and not 1 like most other defaults. - int ansiParameter = 0; - if (ansiParameters[0].length() > 0) - ansiParameter = getAnsiParameter(0); - - switch (ansiParameter) { - case 0: - // Erase from current position to end (inclusive). - text.eraseLineToEnd(); - break; - - case 1: - // Erase from beginning to current position (inclusive). - text.eraseLineToCursor(); - break; - - case 2: - // Erase entire line. - text.eraseLine(); - break; - - default: - Logger.log("Unexpected K-command parameter: " + ansiParameter); //$NON-NLS-1$ - break; - } - } - - /** - * Insert one or more blank lines. The current line of text moves down. Text - * that falls off the bottom of the screen is deleted. - */ - private void processAnsiCommand_L() { - text.insertLines(getAnsiParameter(0)); - } - - /** - * This method resets terminal modes. - */ - private void processAnsiCommand_l() { - if (getAnsiParameter(0) == 4) { - // reset insert mode - text.setInsertMode(false); - } - } - - /** - * Delete one or more lines of text. Any lines below the deleted lines move - * up, which we implement by appending newlines to the end of the text. - */ - private void processAnsiCommand_M() { - text.deleteLines(getAnsiParameter(0)); - } - - /** - * This method sets a new graphics rendition mode, such as - * foreground/background color, bold/normal text, and reverse video. - */ - private void processAnsiCommand_m() { - if (ansiParameters[0].length() == 0) { - // This a special case: when no ANSI parameter is specified, act like a - // single parameter equal to 0 was specified. - - ansiParameters[0].append('0'); - } - Style style=text.getStyle(); - // There are a non-zero number of ANSI parameters. Process each one in - // order. - - int totalParameters = ansiParameters.length; - int parameterIndex = 0; - - while (parameterIndex < totalParameters - && ansiParameters[parameterIndex].length() > 0) { - int ansiParameter = getAnsiParameter(parameterIndex); - - switch (ansiParameter) { - case 0: - // Reset all graphics modes. - style = text.getDefaultStyle(); - break; - - case 1: - style = style.setBold(true); - break; - - case 4: - style = style.setUnderline(true); - break; - - case 5: - style = style.setBlink(true); - break; - - case 7: - style = style.setReverse(true); - break; - - case 10: // Set primary font. Ignored. - break; - - case 21: - case 22: - style = style.setBold(false); - break; - - case 24: - style = style.setUnderline(false); - break; - - case 25: - style = style.setBlink(false); - break; - - case 27: - style = style.setReverse(false); - break; - - case 30: - style = style.setForground("BLACK"); //$NON-NLS-1$ - break; - - case 31: - style = style.setForground("RED"); //$NON-NLS-1$ - break; - - case 32: - style = style.setForground("GREEN"); //$NON-NLS-1$ - break; - - case 33: - style = style.setForground("YELLOW"); //$NON-NLS-1$ - break; - - case 34: - style = style.setForground("BLUE"); //$NON-NLS-1$ - break; - - case 35: - style = style.setForground("MAGENTA"); //$NON-NLS-1$ - break; - - case 36: - style = style.setForground("CYAN"); //$NON-NLS-1$ - break; - - case 37: - style = style.setForground("WHITE_FOREGROUND"); //$NON-NLS-1$ - break; - - case 39: //Foreground: Default - style = style.setForground(text.getDefaultStyle().getForground()); - break; - - case 40: - style = style.setBackground("BLACK"); //$NON-NLS-1$ - break; - - case 41: - style = style.setBackground("RED"); //$NON-NLS-1$ - break; - - case 42: - style = style.setBackground("GREEN"); //$NON-NLS-1$ - break; - - case 43: - style = style.setBackground("YELLOW"); //$NON-NLS-1$ - break; - - case 44: - style = style.setBackground("BLUE"); //$NON-NLS-1$ - break; - - case 45: - style = style.setBackground("MAGENTA"); //$NON-NLS-1$ - break; - - case 46: - style = style.setBackground("CYAN"); //$NON-NLS-1$ - break; - - case 47: - style = style.setBackground("WHITE"); //$NON-NLS-1$ - break; - - case 49: //Background: Default - style = style.setBackground(text.getDefaultStyle().getBackground()); - break; - - default: - Logger - .log("Unsupported graphics rendition parameter: " + ansiParameter); //$NON-NLS-1$ - break; - } - - ++parameterIndex; - } - text.setStyle(style); - } - - /** - * This method responds to an ANSI Device Status Report (DSR) command from - * the remote endpoint requesting the cursor position. Requests for other - * kinds of status are ignored. - */ - private void processAnsiCommand_n() { - // Do nothing if the numeric parameter was not 6 (which means report cursor - // position). - - if (getAnsiParameter(0) != 6) - return; - - // Send the ANSI cursor position (which is 1-based) to the remote endpoint. - - String positionReport = "\u001b[" + (relativeCursorLine() + 1) + ";" + //$NON-NLS-1$ //$NON-NLS-2$ - (getCursorColumn() + 1) + "R"; //$NON-NLS-1$ - - try { - terminal.getOutputStream().write(positionReport.getBytes("ISO-8859-1")); //$NON-NLS-1$ - terminal.getOutputStream().flush(); - } catch (IOException ex) { - Logger.log("Caught IOException!"); //$NON-NLS-1$ - } - } - - /** - * Deletes one or more characters starting at the current cursor position. - * Characters on the same line and to the right of the deleted characters - * move left. If there are no characters on the current line at or to the - * right of the cursor column, no text is deleted. - */ - private void processAnsiCommand_P() { - text.deleteCharacters(getAnsiParameter(0)); - } - - /** - * Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM). - */ - private void processAnsiCommand_r() { - int top = 0; - int bottom = 0; - if (ansiParameters[0].length() > 0 && ansiParameters[1].length() > 0) { - top = getAnsiParameter(0); - bottom = getAnsiParameter(1); - } - text.setScrollRegion(top-1, bottom-1); - } - - /** - * Scroll up n lines (default = 1 line). - */ - private void processAnsiCommand_S() { - text.scrollUp(getAnsiParameter(0)); - } - - /** - * Scroll down n lines (default = 1 line). - */ - private void processAnsiCommand_T() { - text.scrollDown(getAnsiParameter(0)); - } - - private void processDecPrivateCommand_h() { - int param = getAnsiParameter(0); - switch (param) { - case 1: - // Enable Application Cursor Keys (DECCKM) - terminal.enableApplicationCursorKeys(true); - break; - case 47: - case 1047: - case 1048: - case 1049: - // Use Alternate Screen Buffer (ignored). - break; - default: - Logger.log("Unsupported command parameter: CSI ?" + param + 'h'); //$NON-NLS-1$ - break; - } - } - - private void processDecPrivateCommand_l() { - int param = getAnsiParameter(0); - switch (param) { - case 1: - // Enable Normal Cursor Keys (DECCKM) - terminal.enableApplicationCursorKeys(false); - break; - case 47: - case 1047: - case 1048: - case 1049: - // Use Normal Screen Buffer (ignored, but reset scroll region). - text.setScrollRegion(-1, -1); - break; - default: - Logger.log("Unsupported command parameter: CSI ?" + param + 'l'); //$NON-NLS-1$ - break; - } - } - - /** - * This method returns one of the numeric ANSI parameters received in the - * most recent escape sequence. - * - * @return The parameterIndexth numeric ANSI parameter or -1 if the - * index is out of range. - */ - private int getAnsiParameter(int parameterIndex) { - if (parameterIndex < 0 || parameterIndex >= ansiParameters.length) { - // This should never happen. - return -1; - } - - String parameter = ansiParameters[parameterIndex].toString(); - - if (parameter.length() == 0) - return 1; - - int parameterValue = 1; - - // Don't trust the remote endpoint to send well formed numeric - // parameters. - - try { - parameterValue = Integer.parseInt(parameter); - } catch (NumberFormatException ex) { - parameterValue = 1; - } - - return parameterValue; - } - - /** - * This method processes a single parameter character in an ANSI escape - * sequence. Parameters are the (optional) characters between the leading - * "\e[" and the command character in an escape sequence (e.g., in the - * escape sequence "\e[20;10H", the parameter characters are "20;10"). - * Parameters are integers separated by one or more ';'s. - */ - private void processAnsiParameterCharacter(char ch) { - if (ch == ';') { - ++nextAnsiParameter; - } else { - if (nextAnsiParameter < ansiParameters.length) - ansiParameters[nextAnsiParameter].append(ch); - } - } - /** - * This method processes a contiguous sequence of non-control characters. - * This is a performance optimization, so that we don't have to insert or - * append each non-control character individually to the StyledText widget. - * A non-control character is any character that passes the condition in the - * below while loop. - * @throws IOException - */ - private void processNonControlCharacters(char character) throws IOException { - StringBuffer buffer=new StringBuffer(); - buffer.append(character); - // Identify a contiguous sequence of non-control characters, starting at - // firstNonControlCharacterIndex in newText. - while(hasNextChar()) { - character=getNextChar(); - if(character == '\u0000' || character == '\b' || character == '\t' - || character == '\u0007' || character == '\n' - || character == '\r' || character == '\u001b') { - pushBackChar(character); - break; - } - buffer.append(character); - } - - // Now insert the sequence of non-control characters in the StyledText widget - // at the location of the cursor. - - displayNewText(buffer.toString()); - } - - /** - * This method displays a subset of the newly-received text in the Terminal - * view, wrapping text at the right edge of the screen and overwriting text - * when the cursor is not at the very end of the screen's text. - *

            - * - * There are never any ANSI control characters or escape sequences in the - * text being displayed by this method (this includes newlines, carriage - * returns, and tabs). - *

            - */ - private void displayNewText(String buffer) { - text.appendString(buffer); - } - - - /** - * Process a BEL (Control-G) character. - */ - private void processBEL() { - // TODO - //Display.getDefault().beep(); - } - - /** - * Process a backspace (Control-H) character. - */ - private void processBackspace() { - moveCursorBackward(1); - } - - /** - * Process a tab (Control-I) character. We don't insert a tab character into - * the StyledText widget. Instead, we move the cursor forward to the next - * tab stop, without altering any of the text. Tab stops are every 8 - * columns. The cursor will never move past the rightmost column. - */ - private void processTab() { - moveCursorForward(8 - (getCursorColumn() % 8)); - } - - /** - * Process a newline (Control-J) character. A newline (NL) character just - * moves the cursor to the same column on the next line, creating new lines - * when the cursor reaches the bottom edge of the terminal. This is - * counter-intuitive, especially to UNIX programmers who are taught that - * writing a single NL to a terminal is sufficient to move the cursor to the - * first column of the next line, as if a carriage return (CR) and a NL were - * written. - *

            - * - * UNIX terminals typically display a NL character as a CR followed by a NL - * because the terminal device typically has the ONLCR attribute bit set - * (see the termios(4) man page for details), which causes the terminal - * device driver to translate NL to CR + NL on output. The terminal itself - * (i.e., a hardware terminal or a terminal emulator, like xterm or this - * code) _always_ interprets a CR to mean "move the cursor to the beginning - * of the current line" and a NL to mean "move the cursor to the same column - * on the next line". - *

            - */ - private void processNewline() { - text.processNewline(); - } - - /** - * Process a Carriage Return (Control-M). - */ - private void processCarriageReturn() { - text.setCursorColumn(0); - } - - /** - * This method computes the width of the terminal in columns and its height - * in lines, then adjusts the width and height of the view's StyledText - * widget so that it displays an integral number of lines and columns of - * text. The adjustment is always to shrink the widget vertically or - * horizontally, because if the control were to grow, it would be clipped by - * the edges of the view window (i.e., the view window does not become - * larger to accommodate its contents becoming larger). - *

            - * - * This method must be called immediately before each time text is written - * to the terminal so that we can properly line wrap text. Because it is - * called so frequently, it must be fast when there is no resizing to be - * done. - *

            - */ - private void adjustTerminalDimensions() { - // Compute how many pixels we need to shrink the StyledText control vertically - // to make it display an integral number of lines of text. - - // TODO -// if(text.getColumns()!=80 && text.getLines()!=80) -// text.setDimensions(24, 80); - // If we are in a TELNET connection and we know the dimensions of the terminal, - // we give the size information to the TELNET connection object so it can - // communicate it to the TELNET server. If we are in a serial connection, - // there is nothing we can do to tell the remote host about the size of the - // terminal. - ITerminalConnector telnetConnection = getConnector(); - // TODO MSA: send only if dimensions have really changed! - if (telnetConnection != null) { - telnetConnection.setTerminalSize(text.getColumns(), text.getLines()); - } - - } - - private ITerminalConnector getConnector() { - if(terminal.getTerminalConnector()!=null) - return terminal.getTerminalConnector(); - return null; - } - - /** - * This method returns the relative line number of the line containing the - * cursor. The returned line number is relative to the topmost visible line, - * which has relative line number 0. - * - * @return The relative line number of the line containing the cursor. - */ - private int relativeCursorLine() { - return text.getCursorLine(); - } - - /** - * This method moves the cursor to the specified line and column. Parameter - * targetLine is the line number of a screen line, so it has a - * minimum value of 0 (the topmost screen line) and a maximum value of - * heightInLines - 1 (the bottommost screen line). A line does not have to - * contain any text to move the cursor to any column in that line. - */ - private void moveCursor(int targetLine, int targetColumn) { - text.setCursor(targetLine,targetColumn); - } - - /** - * This method moves the cursor down lines lines, but won't move the - * cursor past the bottom of the screen. This method does not cause any - * scrolling. - */ - private void moveCursorDown(int lines) { - moveCursor(relativeCursorLine() + lines, getCursorColumn()); - } - - /** - * This method moves the cursor up lines lines, but won't move the - * cursor past the top of the screen. This method does not cause any - * scrolling. - */ - private void moveCursorUp(int lines) { - moveCursor(relativeCursorLine() - lines, getCursorColumn()); - } - - /** - * This method moves the cursor forward columns columns, but won't - * move the cursor past the right edge of the screen, nor will it move the - * cursor onto the next line. This method does not cause any scrolling. - */ - private void moveCursorForward(int columnsToMove) { - moveCursor(relativeCursorLine(), getCursorColumn() + columnsToMove); - } - - /** - * This method moves the cursor backward columnsToMove columns, but - * won't move the cursor past the left edge of the screen, nor will it move - * the cursor onto the previous line. This method does not cause any - * scrolling. - */ - private void moveCursorBackward(int columnsToMove) { - moveCursor(relativeCursorLine(), getCursorColumn() - columnsToMove); - } - /** - * Resets the state of the terminal text (foreground color, background color, - * font style and other internal state). It essentially makes it ready for new input. - */ - public void resetState() { - ansiState=ANSISTATE_INITIAL; - text.setStyle(text.getDefaultStyle()); - text.setScrollRegion(-1, -1); - text.setInsertMode(false); - } - -// public OutputStream getOutputStream() { -// return fTerminalInputStream.getOutputStream(); -// } - - /** - * Buffer for {@link #pushBackChar(char)}. - */ - private int fNextChar=-1; - - private char getNextChar() throws IOException { - int c=-1; - if(fNextChar!=-1) { - c= fNextChar; - fNextChar=-1; - } else { - c = fReader.read(); - } - // TODO: better end of file handling - if(c==-1) - c=0; - return (char)c; - } - - private boolean hasNextChar() throws IOException { - if(fNextChar>=0) - return true; - return fReader.ready(); - } - - /** - * Put back one character to the stream. This method can push - * back exactly one character. The character is the next character - * returned by {@link #getNextChar} - * @param c the character to be pushed back. - */ - void pushBackChar(char c) { - //assert fNextChar!=-1: "Already a character waiting:"+fNextChar; //$NON-NLS-1$ - fNextChar=c; - } - private int getCursorColumn() { - return text.getCursorColumn(); - } - public boolean isCrAfterNewLine() { - return fCrAfterNewLine; - } - public void setCrAfterNewLine(boolean crAfterNewLine) { - fCrAfterNewLine = crAfterNewLine; - } - void setVT100LineWrapping(boolean enable) { - text.setVT100LineWrapping(enable); - } - boolean isVT100LineWrapping() { - return text.isVT100LineWrapping(); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java deleted file mode 100644 index 36140d60050..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java +++ /dev/null @@ -1,494 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [206329] Changing terminal size right after connect does not scroll properly - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - * Anton Leherbauer (Wind River) - [458218] Add support for ANSI insert mode - * Anton Leherbauer (Wind River) - [458402] Add support for scroll up/down and scroll region - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.Style; - -/** - * - */ -public class VT100EmulatorBackend implements IVT100EmulatorBackend { - - private static class ScrollRegion { - static final ScrollRegion FULL_WINDOW = new ScrollRegion(0, Integer.MAX_VALUE-1); - private final int fTop; - private final int fBottom; - ScrollRegion(int top, int bottom) { - fTop = top; - fBottom = bottom; - } - boolean contains(int line) { - return line >= fTop && line <= fBottom; - } - int getTopLine() { - return fTop; - } - int getBottomLine() { - return fBottom; - } - int getHeight() { - return fBottom - fTop + 1; - } - } - - /** - * This field holds the number of the column in which the cursor is - * logically positioned. The leftmost column on the screen is column 0, and - * column numbers increase to the right. The maximum value of this field is - * {@link #widthInColumns} - 1. We track the cursor column using this field - * to avoid having to recompute it repeatly using StyledText method calls. - *

            - * - * The StyledText widget that displays text has a vertical bar (called the - * "caret") that appears _between_ character cells, but ANSI terminals have - * the concept of a cursor that appears _in_ a character cell, so we need a - * convention for which character cell the cursor logically occupies when - * the caret is physically between two cells. The convention used in this - * class is that the cursor is logically in column N when the caret is - * physically positioned immediately to the _left_ of column N. - *

            - * - * When fCursorColumn is N, the next character output to the terminal appears - * in column N. When a character is output to the rightmost column on a - * given line (column widthInColumns - 1), the cursor moves to column 0 on - * the next line after the character is drawn (this is the default line wrapping - * mode). If VT100 line wrapping mode is enabled, the cursor does not move - * to the next line until the next character is printed (this is known as - * the VT100 'eat_newline_glitch'). - * If the cursor is in the bottommost line when line wrapping - * occurs, the topmost visible line is scrolled off the top edge of the - * screen. - *

            - */ - private int fCursorColumn; - private int fCursorLine; - /* true if last output occurred on rightmost column - * and next output requires line wrap */ - private boolean fWrapPending; - private boolean fInsertMode; - private Style fDefaultStyle; - private Style fStyle; - int fLines; - int fColumns; - final private ITerminalTextData fTerminal; - private boolean fVT100LineWrapping; - private ScrollRegion fScrollRegion = ScrollRegion.FULL_WINDOW; - - public VT100EmulatorBackend(ITerminalTextData terminal) { - fTerminal=terminal; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#clearAll() - */ - public void clearAll() { - synchronized (fTerminal) { - // clear the history - int n=fTerminal.getHeight(); - for (int line = 0; line < n; line++) { - fTerminal.cleanLine(line); - } - fTerminal.setDimensions(fLines, fTerminal.getWidth()); - setStyle(getDefaultStyle()); - setCursor(0, 0); - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setDimensions(int, int) - */ - public void setDimensions(int lines, int cols) { - synchronized (fTerminal) { - if(lines==fLines && cols==fColumns) - return; // nothing to do - // relative cursor line - int cl=getCursorLine(); - int cc=getCursorColumn(); - int height=fTerminal.getHeight(); - // absolute cursor line - int acl=cl+height-fLines; - int newLines=Math.max(lines,height); - if(lines=fCursorColumn+n; col--) { - char c=fTerminal.getChar(line, col-n); - Style style=fTerminal.getStyle(line, col-n); - fTerminal.setChar(line, col,c, style); - } - int last=Math.min(fCursorColumn+n, fColumns); - for (int col = fCursorColumn; col 0; - int line=toAbsoluteLine(fCursorLine); - int nLines=Math.min(fTerminal.getHeight()-line, fScrollRegion.getBottomLine()-fCursorLine+1); - fTerminal.scroll(line, nLines, n); - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#deleteCharacters(int) - */ - public void deleteCharacters(int n) { - synchronized (fTerminal) { - int line=toAbsoluteLine(fCursorLine); - for (int col = fCursorColumn+n; col < fColumns; col++) { - char c=fTerminal.getChar(line, col); - Style style=fTerminal.getStyle(line, col); - fTerminal.setChar(line, col-n,c, style); - } - int first=Math.max(fCursorColumn, fColumns-n); - for (int col = first; col 0; - int line=toAbsoluteLine(fCursorLine); - int nLines=Math.min(fTerminal.getHeight()-line, fScrollRegion.getBottomLine()-fCursorLine+1); - fTerminal.scroll(line, nLines, -n); - } - } - private boolean isCusorInScrollingRegion() { - return fScrollRegion.contains(fCursorLine); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getDefaultStyle() - */ - public Style getDefaultStyle() { - synchronized (fTerminal) { - return fDefaultStyle; - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setDefaultStyle(org.eclipse.tm.terminal.model.Style) - */ - public void setDefaultStyle(Style defaultStyle) { - synchronized (fTerminal) { - fDefaultStyle = defaultStyle; - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getStyle() - */ - public Style getStyle() { - synchronized (fTerminal) { - if(fStyle==null) - return fDefaultStyle; - return fStyle; - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setStyle(org.eclipse.tm.terminal.model.Style) - */ - public void setStyle(Style style) { - synchronized (fTerminal) { - fStyle=style; - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#appendString(java.lang.String) - */ - public void appendString(String buffer) { - synchronized (fTerminal) { - char[] chars=buffer.toCharArray(); - if (fInsertMode) - insertCharacters(chars.length); - int line=toAbsoluteLine(fCursorLine); - int i=0; - while (i < chars.length) { - if(fWrapPending) { - line = doLineWrap(); - } - int n=Math.min(fColumns-fCursorColumn,chars.length-i); - fTerminal.setChars(line, fCursorColumn, chars, i, n, fStyle); - int col=fCursorColumn+n; - i+=n; - // wrap needed? - if(col == fColumns) { - if (fVT100LineWrapping) { - // deferred line wrapping (eat_newline_glitch) - setCursorColumn(col - 1); - fWrapPending = true; - } else { - line = doLineWrap(); - } - } else { - setCursorColumn(col); - } - } - } - } - - private int doLineWrap() { - int line; - line=toAbsoluteLine(fCursorLine); - fTerminal.setWrappedLine(line); - doNewline(); - line=toAbsoluteLine(fCursorLine); - setCursorColumn(0); - return line; - } - - /** - * MUST be called from a synchronized block! - */ - private void doNewline() { - if (fCursorLine == fScrollRegion.getBottomLine()) - scrollUp(1); - else if (fCursorLine+1>=fLines) { - int h=fTerminal.getHeight(); - fTerminal.addLine(); - if(h!=fTerminal.getHeight()) - setCursorLine(fCursorLine+1); - } else { - setCursorLine(fCursorLine+1); - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#processNewline() - */ - public void processNewline() { - synchronized (fTerminal) { - doNewline(); - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getCursorLine() - */ - public int getCursorLine() { - synchronized (fTerminal) { - return fCursorLine; - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getCursorColumn() - */ - public int getCursorColumn() { - synchronized (fTerminal) { - return fCursorColumn; - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setCursor(int, int) - */ - public void setCursor(int targetLine, int targetColumn) { - synchronized (fTerminal) { - setCursorLine(targetLine); - setCursorColumn(targetColumn); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setCursorColumn(int) - */ - public void setCursorColumn(int targetColumn) { - synchronized (fTerminal) { - if(targetColumn<0) - targetColumn=0; - else if(targetColumn>=fColumns) - targetColumn=fColumns-1; - fCursorColumn=targetColumn; - fWrapPending = false; - // We make the assumption that nobody is changing the - // terminal cursor except this class! - // This assumption gives a huge performance improvement - fTerminal.setCursorColumn(targetColumn); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#setCursorLine(int) - */ - public void setCursorLine(int targetLine) { - synchronized (fTerminal) { - if(targetLine<0) - targetLine=0; - else if(targetLine>=fLines) - targetLine=fLines-1; - fCursorLine=targetLine; - // We make the assumption that nobody is changing the - // terminal cursor except this class! - // This assumption gives a huge performance improvement - fTerminal.setCursorLine(toAbsoluteLine(targetLine)); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getLines() - */ - public int getLines() { - synchronized (fTerminal) { - return fLines; - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.emulator.IVT100EmulatorBackend#getColumns() - */ - public int getColumns() { - synchronized (fTerminal) { - return fColumns; - } - } - - public void setVT100LineWrapping(boolean enable) { - fVT100LineWrapping = enable; - } - - public boolean isVT100LineWrapping() { - return fVT100LineWrapping; - } - - public void setInsertMode(boolean enable) { - fInsertMode = enable; - } - - public void setScrollRegion(int top, int bottom) { - if (top < 0 || bottom < 0) - fScrollRegion = ScrollRegion.FULL_WINDOW; - else if (top < bottom) - fScrollRegion = new ScrollRegion(top, bottom); - } - - public void scrollUp(int n) { - assert n>0; - synchronized (fTerminal) { - int line = toAbsoluteLine(fScrollRegion.getTopLine()); - int nLines = Math.min(fTerminal.getHeight()-line, fScrollRegion.getHeight()); - fTerminal.scroll(line, nLines, -n); - } - } - - public void scrollDown(int n) { - assert n>0; - synchronized (fTerminal) { - int line = toAbsoluteLine(fScrollRegion.getTopLine()); - int nLines = Math.min(fTerminal.getHeight()-line, fScrollRegion.getHeight()); - fTerminal.scroll(line, nLines, n); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java deleted file mode 100644 index 86f44659954..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java +++ /dev/null @@ -1,1353 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [206892] State handling: Only allow connect when CLOSED - * Martin Oberhuber (Wind River) - [206883] Serial Terminal leaks Jobs - * Martin Oberhuber (Wind River) - [208145] Terminal prints garbage after quick disconnect/reconnect - * Martin Oberhuber (Wind River) - [207785] NPE when trying to send char while no longer connected - * Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal - * Ruslan Sychev (Xored Software) - [217675] NPE or SWTException when closing Terminal View while connection establishing - * Michael Scharf (Wing River) - [196447] The optional terminal input line should be resizeable - * Martin Oberhuber (Wind River) - [168197] Replace JFace MessagDialog by SWT MessageBox - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Michael Scharf (Wind River) - [237398] Terminal get Invalid Thread Access when the title is set - * Martin Oberhuber (Wind River) - [240745] Pressing Ctrl+F1 in the Terminal should bring up context help - * Michael Scharf (Wind River) - [240098] The cursor should not blink when the terminal is disconnected - * Anton Leherbauer (Wind River) - [335021] Middle mouse button copy/paste does not work with the terminal - * Max Stepanov (Appcelerator) - [339768] Fix ANSI code for PgUp / PgDn - * Pawel Piech (Wind River) - [333613] "Job found still running" after shutdown - * Martin Oberhuber (Wind River) - [348700] Terminal unusable after disconnect - * Simon Bernard (Sierra Wireless) - [351424] [terminal] Terminal does not support del and insert key - * Martin Oberhuber (Wind River) - [265352][api] Allow setting fonts programmatically - * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - * Anton Leherbauer (Wind River) - [434294] Incorrect handling of function keys with modifiers - * Martin Oberhuber (Wind River) - [434294] Add Mac bindings with COMMAND - * Anton Leherbauer (Wind River) - [434749] UnhandledEventLoopException when copying to clipboard while the selection is empty - * Martin Oberhuber (Wind River) - [436612] Restore Eclipse 3.4 compatibility by using Reflection - * Anton Leherbauer (Wind River) - [458398] Add support for normal/application cursor keys mode - * Anton Leherbauer (Wind River) - [420928] Terminal widget leaks memory - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.emulator; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Field; -import java.net.SocketException; -import java.nio.charset.Charset; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.ParameterizedCommand; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.bindings.Binding; -import org.eclipse.jface.bindings.keys.KeySequence; -import org.eclipse.jface.bindings.keys.KeyStroke; -import org.eclipse.jface.bindings.keys.SWTKeySupport; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.tm.internal.terminal.control.ICommandInputField; -import org.eclipse.tm.internal.terminal.control.ITerminalListener; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.control.impl.ITerminalControlForText; -import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; -import org.eclipse.tm.internal.terminal.preferences.ITerminalConstants; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.textcanvas.PipedInputStream; -import org.eclipse.tm.internal.terminal.textcanvas.PollingTextCanvasModel; -import org.eclipse.tm.internal.terminal.textcanvas.TextCanvas; -import org.eclipse.tm.internal.terminal.textcanvas.TextLineRenderer; -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; -import org.eclipse.tm.terminal.model.TerminalTextDataFactory; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.contexts.IContextActivation; -import org.eclipse.ui.contexts.IContextService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.ui.keys.IBindingService; - -/** - * - * This class was originally written to use nested classes, which unfortunately makes - * this source file larger and more complex than it needs to be. In particular, the - * methods in the nested classes directly access the fields of the enclosing class. - * One day we should pull the nested classes out into their own source files (but still - * in this package). - * - * @author Chris Thew - */ -public class VT100TerminalControl implements ITerminalControlForText, ITerminalControl, ITerminalViewControl -{ - protected final static String[] LINE_DELIMITERS = { "\n" }; //$NON-NLS-1$ - - /** - * This field holds a reference to a TerminalText object that performs all ANSI - * text processing on data received from the remote host and controls how text is - * displayed using the view's StyledText widget. - */ - private final VT100Emulator fTerminalText; - private Display fDisplay; - private TextCanvas fCtlText; - private Composite fWndParent; - private Clipboard fClipboard; - private KeyListener fKeyHandler; - private final ITerminalListener fTerminalListener; - private String fMsg = ""; //$NON-NLS-1$ - private TerminalFocusListener fFocusListener; - private ITerminalConnector fConnector; - private final ITerminalConnector[] fConnectors; - private final boolean fUseCommonPrefs; - private boolean connectOnEnterIfClosed = true; - - PipedInputStream fInputStream; - private static final String defaultEncoding = Charset.defaultCharset().name(); - private String fEncoding = defaultEncoding; - private InputStreamReader fInputStreamReader; - - private ICommandInputField fCommandInputField; - - private volatile TerminalState fState; - - private final ITerminalTextData fTerminalModel; - - private final EditActionAccelerators editActionAccelerators = new EditActionAccelerators(); - - private boolean fApplicationCursorKeys; - - /** - * Listens to changes in the preferences - */ - private final IPropertyChangeListener fPreferenceListener=new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if(event.getProperty().equals(ITerminalConstants.PREF_BUFFERLINES) - || event.getProperty().equals(ITerminalConstants.PREF_INVERT_COLORS)) { - updatePreferences(); - } - } - }; - private final IPropertyChangeListener fFontListener = new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(ITerminalConstants.FONT_DEFINITION)) { - onTerminalFontChanged(); - } - } - }; - - /** - * Is protected by synchronize on this - */ - volatile private Job fJob; - - private PollingTextCanvasModel fPollingTextCanvasModel; - - public VT100TerminalControl(ITerminalListener target, Composite wndParent, ITerminalConnector[] connectors) { - this(target, wndParent, connectors, false); - } - - /** - * Instantiate a Terminal widget. - * @param target Callback for notifying the owner of Terminal state changes. - * @param wndParent The Window parent to embed the Terminal in. - * @param connectors Provided connectors. - * @param useCommonPrefs If true, the Terminal widget will pick up settings - * from the org.eclipse.tm.terminal.TerminalPreferencePage Preference page. - * Otherwise, clients need to maintain settings themselves. - * @since 3.2 - */ - public VT100TerminalControl(ITerminalListener target, Composite wndParent, ITerminalConnector[] connectors, boolean useCommonPrefs) { - fConnectors=connectors; - fUseCommonPrefs = useCommonPrefs; - fTerminalListener=target; - fTerminalModel=TerminalTextDataFactory.makeTerminalTextData(); - fTerminalModel.setMaxHeight(1000); - fInputStream=new PipedInputStream(8*1024); - fTerminalText = new VT100Emulator(fTerminalModel, this, null); - try { - // Use Default Encoding as start, until setEncoding() is called - setEncoding(null); - } catch (UnsupportedEncodingException e) { - // Should never happen - e.printStackTrace(); - // Fall back to local Platform Default Encoding - fEncoding = defaultEncoding; - fInputStreamReader = new InputStreamReader(fInputStream); - fTerminalText.setInputStreamReader(fInputStreamReader); - } - - setupTerminal(wndParent); - } - - public void setEncoding(String encoding) throws UnsupportedEncodingException { - if (encoding == null) { - // TODO better use a standard remote-to-local encoding? - encoding = "ISO-8859-1"; //$NON-NLS-1$ - // TODO or better use the local default encoding? - // encoding = defaultEncoding; - } - fInputStreamReader = new InputStreamReader(fInputStream, encoding); - // remember encoding if above didn't throw an exception - fEncoding = encoding; - fTerminalText.setInputStreamReader(fInputStreamReader); - } - - public String getEncoding() { - return fEncoding; - } - - public ITerminalConnector[] getConnectors() { - return fConnectors; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#copy() - */ - public void copy() { - copy(DND.CLIPBOARD); - } - - private void copy(int clipboardType) { - String selection = getSelection(); - if (selection.length() > 0) { - Object[] data = new Object[] { selection }; - Transfer[] types = new Transfer[] { TextTransfer.getInstance() }; - fClipboard.setContents(data, types, clipboardType); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#paste() - */ - public void paste() { - paste(DND.CLIPBOARD); -// TODO paste in another thread.... to avoid blocking -// new Thread() { -// public void run() { -// for (int i = 0; i < strText.length(); i++) { -// sendChar(strText.charAt(i), false); -// } -// -// } -// }.start(); - } - - private void paste(int clipboardType) { - TextTransfer textTransfer = TextTransfer.getInstance(); - String strText = (String) fClipboard.getContents(textTransfer, clipboardType); - pasteString(strText); - } - - /** - * @param strText the text to paste - */ - public boolean pasteString(String strText) { - if(!isConnected()) - return false; - if (strText == null) - return false; - if (!fEncoding.equals(defaultEncoding)) { - sendString(strText); - } else { - // TODO I do not understand why pasteString would do this here... - for (int i = 0; i < strText.length(); i++) { - sendChar(strText.charAt(i), false); - } - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#selectAll() - */ - public void selectAll() { - getCtlText().selectAll(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#sendKey(char) - */ - public void sendKey(char character) { - Event event; - KeyEvent keyEvent; - - event = new Event(); - event.widget = getCtlText(); - event.character = character; - event.keyCode = 0; - event.stateMask = 0; - event.doit = true; - keyEvent = new KeyEvent(event); - - fKeyHandler.keyPressed(keyEvent); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#clearTerminal() - */ - public void clearTerminal() { - // The TerminalText object does all text manipulation. - - getTerminalText().clearTerminal(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#getClipboard() - */ - public Clipboard getClipboard() { - return fClipboard; - } - - /** - * @return non null selection - */ - public String getSelection() { - String txt= fCtlText.getSelectionText(); - if(txt==null) - txt=""; //$NON-NLS-1$ - return txt; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#setFocus() - */ - public void setFocus() { - getCtlText().setFocus(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#isEmpty() - */ - public boolean isEmpty() { - return getCtlText().isEmpty(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#isDisposed() - */ - public boolean isDisposed() { - return getCtlText().isDisposed(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#isConnected() - */ - public boolean isConnected() { - return fState==TerminalState.CONNECTED; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#disposeTerminal() - */ - public void disposeTerminal() { - Logger.log("entered."); //$NON-NLS-1$ - if(fUseCommonPrefs) { - TerminalPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPreferenceListener); - JFaceResources.getFontRegistry().removeListener(fFontListener); - } - disconnectTerminal(); - fClipboard.dispose(); - fPollingTextCanvasModel.stopPolling(); - getTerminalText().dispose(); - } - - public void connectTerminal() { - Logger.log("entered."); //$NON-NLS-1$ - if(getTerminalConnector()==null) - return; - fTerminalText.resetState(); - fApplicationCursorKeys = false; - if(fConnector.getInitializationErrorMessage()!=null) { - showErrorMessage(NLS.bind( - TerminalMessages.CannotConnectTo, - fConnector.getName(), - fConnector.getInitializationErrorMessage())); - // we cannot connect because the connector was not initialized - return; - } - // clean the error message - setMsg(""); //$NON-NLS-1$ - getTerminalConnector().connect(this); - waitForConnect(); - } - - public ITerminalConnector getTerminalConnector() { - return fConnector; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#disconnectTerminal() - */ - public void disconnectTerminal() { - Logger.log("entered."); //$NON-NLS-1$ - - //Disconnect the remote side first - if (getState()!=TerminalState.CLOSED) { - if(getTerminalConnector()!=null) { - getTerminalConnector().disconnect(); - } - } - - //Ensure that a new Job can be started; then clean up old Job. - Job job; - synchronized(this) { - job = fJob; - fJob = null; - } - if (job!=null) { - job.cancel(); - // Join job to avoid leaving job running after workbench shutdown (333613). - // Interrupt to be fast enough; cannot close fInputStream since it is re-used (bug 348700). - Thread t = job.getThread(); - if(t!=null) t.interrupt(); - try { - job.join(); - } catch (InterruptedException e) {} - } - } - - private void waitForConnect() { - Logger.log("entered."); //$NON-NLS-1$ - - // TODO Eliminate the nested dispatch loop - do { - if (!fDisplay.readAndDispatch()) - fDisplay.sleep(); - } while (getState()==TerminalState.CONNECTING); - - if (getCtlText().isDisposed()) { - disconnectTerminal(); - return; - } - if (getMsg().length() > 0) { - showErrorMessage(getMsg()); - disconnectTerminal(); - return; - } - if (getCtlText().isFocusControl()) { - if (getState() == TerminalState.CONNECTED) - fFocusListener.captureKeyEvents(true); - } - startReaderJob(); - } - - private synchronized void startReaderJob() { - if(fJob==null) { - fJob=new Job("Terminal data reader") { //$NON-NLS-1$ - protected IStatus run(IProgressMonitor monitor) { - IStatus status=Status.OK_STATUS; - try { - while(true) { - while(fInputStream.available()==0 && !monitor.isCanceled()) { - try { - fInputStream.waitForAvailable(500); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - if(monitor.isCanceled()) { - //Do not disconnect terminal here because another reader job may already be running - status=Status.CANCEL_STATUS; - break; - } - try { - // TODO: should block when no text is available! - fTerminalText.processText(); - } catch (Exception e) { - disconnectTerminal(); - status=new Status(IStatus.ERROR,TerminalPlugin.PLUGIN_ID,e.getLocalizedMessage(),e); - break; - } - } - } finally { - // clean the job: start a new one when the connection gets restarted - // Bug 208145: make sure we do not clean an other job that's already started (since it would become a Zombie) - synchronized (VT100TerminalControl.this) { - if (fJob==this) { - fJob=null; - } - } - } - return status; - } - - }; - fJob.setSystem(true); - fJob.schedule(); - } - } - - private void showErrorMessage(String message) { - String strTitle = TerminalMessages.TerminalError; - // [168197] Replace JFace MessagDialog by SWT MessageBox - //MessageDialog.openError( getShell(), strTitle, message); - MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK); - mb.setText(strTitle); - mb.setMessage(message); - mb.open(); - } - - protected void sendString(String string) { - try { - // Send the string after converting it to an array of bytes using the - // platform's default character encoding. - // - // TODO: Find a way to force this to use the ISO Latin-1 encoding. - // TODO: handle Encoding Errors in a better way - - getOutputStream().write(string.getBytes(fEncoding)); - getOutputStream().flush(); - } catch (SocketException socketException) { - displayTextInTerminal(socketException.getMessage()); - - String strMsg = TerminalMessages.SocketError - + "!\n" + socketException.getMessage(); //$NON-NLS-1$ - showErrorMessage(strMsg); - - Logger.logException(socketException); - - disconnectTerminal(); - } catch (IOException ioException) { - showErrorMessage(TerminalMessages.IOError + "!\n" + ioException.getMessage());//$NON-NLS-1$ - - Logger.logException(ioException); - - disconnectTerminal(); - } - } - - public Shell getShell() { - return getCtlText().getShell(); - } - - protected void sendChar(char chKey, boolean altKeyPressed) { - try { - int byteToSend = chKey; - OutputStream os = getOutputStream(); - if (os==null) { - // Bug 207785: NPE when trying to send char while no longer connected - Logger.log("NOT sending '" + byteToSend + "' because no longer connected"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - if (altKeyPressed) { - // When the ALT key is pressed at the same time that a character is - // typed, translate it into an ESCAPE followed by the character. The - // alternative in this case is to set the high bit of the character - // being transmitted, but that will cause input such as ALT-f to be - // seen as the ISO Latin-1 character '�', which can be confusing to - // European users running Emacs, for whom Alt-f should move forward a - // word instead of inserting the '�' character. - // - // TODO: Make the ESCAPE-vs-highbit behavior user configurable. - - byte[] bytesToSend = String.valueOf(chKey).getBytes(fEncoding); - StringBuilder b = new StringBuilder("sending ESC"); //$NON-NLS-1$ - for (int i = 0; i < bytesToSend.length; i++) { - if (i != 0) b.append(" +"); //$NON-NLS-1$ - b.append(" '" + bytesToSend[i] + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - } - Logger.log(b.toString()); - os.write('\u001b'); - os.write(bytesToSend); - } else { - byte[] bytesToSend = String.valueOf(chKey).getBytes(fEncoding); - StringBuilder b = new StringBuilder("sending"); //$NON-NLS-1$ - for (int i = 0; i < bytesToSend.length; i++) { - if (i != 0) b.append(" +"); //$NON-NLS-1$ - b.append(" '" + bytesToSend[i] + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - } - Logger.log(b.toString()); - os.write(bytesToSend); - } - os.flush(); - } - } catch (SocketException socketException) { - Logger.logException(socketException); - - displayTextInTerminal(socketException.getMessage()); - - String strMsg = TerminalMessages.SocketError - + "!\n" + socketException.getMessage(); //$NON-NLS-1$ - - showErrorMessage(strMsg); - Logger.logException(socketException); - - disconnectTerminal(); - } catch (IOException ioException) { - Logger.logException(ioException); - - displayTextInTerminal(ioException.getMessage()); - - String strMsg = TerminalMessages.IOError + "!\n" + ioException.getMessage(); //$NON-NLS-1$ - - showErrorMessage(strMsg); - Logger.logException(ioException); - - disconnectTerminal(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#setupTerminal(org.eclipse.swt.widgets.Composite) - */ - public void setupTerminal(Composite parent) { - Assert.isNotNull(parent); - boolean wasDisposed = true; - TerminalState oldState = fState; - fState = TerminalState.CLOSED; - if (fClipboard != null && !fClipboard.isDisposed()) { - // terminal was not disposed (DnD) - wasDisposed = false; - fClipboard.dispose(); - fPollingTextCanvasModel.stopPolling(); - } - if (fWndParent != null && !fWndParent.isDisposed()) { - // terminal widget gets a new parent (DnD) - fWndParent.dispose(); - } - setupControls(parent); - setCommandInputField(fCommandInputField); - setupListeners(); - if (fUseCommonPrefs && wasDisposed) { - updatePreferences(); - onTerminalFontChanged(); - TerminalPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(fPreferenceListener); - JFaceResources.getFontRegistry().addListener(fFontListener); - } - setupHelp(fWndParent, TerminalPlugin.HELP_VIEW); - - if (!wasDisposed) { - fState = oldState; - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.control.ITerminalViewControl#updatePreferences() - */ - private void updatePreferences() { - int bufferLineLimit = Platform.getPreferencesService().getInt(TerminalPlugin.PLUGIN_ID, ITerminalConstants.PREF_BUFFERLINES, 0, null); - boolean invert = Platform.getPreferencesService().getBoolean(TerminalPlugin.PLUGIN_ID, ITerminalConstants.PREF_INVERT_COLORS, false, null); - setBufferLineLimit(bufferLineLimit); - setInvertedColors(invert); - } - - private void onTerminalFontChanged() { - // set the font for all - setFont(ITerminalConstants.FONT_DEFINITION); - } - - /* - * (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.control.ITerminalViewControl#setFont(java.lang.String) - */ - public void setFont(String fontName) { - Font font=JFaceResources.getFont(fontName); - getCtlText().setFont(font); - if(fCommandInputField!=null) { - fCommandInputField.setFont(font); - } - // Tell the TerminalControl singleton that the font has changed. - fCtlText.updateFont(fontName); - getTerminalText().fontChanged(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#onFontChanged() - */ - public void setFont(Font font) { - getCtlText().setFont(font); - if(fCommandInputField!=null) { - fCommandInputField.setFont(font); - } - - // Tell the TerminalControl singleton that the font has changed. - fCtlText.onFontChange(); - getTerminalText().fontChanged(); - } - public Font getFont() { - return getCtlText().getFont(); - } - public Control getControl() { - return fCtlText; - } - public Control getRootControl() { - return fWndParent; - } - protected void setupControls(Composite parent) { - fWndParent=new Composite(parent,SWT.NONE); - GridLayout layout=new GridLayout(); - layout.marginWidth=0; layout.marginHeight=0; layout.verticalSpacing=0; - fWndParent.setLayout(layout); - - ITerminalTextDataSnapshot snapshot=fTerminalModel.makeSnapshot(); - // TODO how to get the initial size correctly! - snapshot.updateSnapshot(false); - fPollingTextCanvasModel=new PollingTextCanvasModel(snapshot); - fCtlText=new TextCanvas(fWndParent,fPollingTextCanvasModel,SWT.NONE,new TextLineRenderer(fCtlText,fPollingTextCanvasModel)); - - fCtlText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - fCtlText.addResizeHandler(new TextCanvas.ResizeListener() { - public void sizeChanged(int lines, int columns) { - fTerminalText.setDimensions(lines, columns); - } - }); - fCtlText.addMouseListener(new MouseAdapter() { - public void mouseUp(MouseEvent e) { - // update selection used by middle mouse button paste - if (e.button == 1 && getSelection().length() > 0) { - copy(DND.SELECTION_CLIPBOARD); - } - } - }); - - fDisplay = getCtlText().getDisplay(); - fClipboard = new Clipboard(fDisplay); - } - - protected void setupListeners() { - fKeyHandler = new TerminalKeyHandler(); - fFocusListener = new TerminalFocusListener(); - - getCtlText().addKeyListener(fKeyHandler); - getCtlText().addFocusListener(fFocusListener); - - } - - /** - * Setup all the help contexts for the controls. - */ - protected void setupHelp(Composite parent, String id) { - Control[] children = parent.getChildren(); - - for (int nIndex = 0; nIndex < children.length; nIndex++) { - if (children[nIndex] instanceof Composite) { - setupHelp((Composite) children[nIndex], id); - } - } - - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, id); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#displayTextInTerminal(java.lang.String) - */ - public void displayTextInTerminal(String text) { - writeToTerminal("\r\n"+text+"\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ - } - private void writeToTerminal(String text) { - try { - getRemoteToTerminalOutputStream().write(text.getBytes(fEncoding)); - } catch (UnsupportedEncodingException e) { - // should never happen! - e.printStackTrace(); - } catch (IOException e) { - // should never happen! - e.printStackTrace(); - } - - } - - public OutputStream getRemoteToTerminalOutputStream() { - if(Logger.isLogEnabled()) { - return new LoggingOutputStream(fInputStream.getOutputStream()); - } else { - return fInputStream.getOutputStream(); - } - } - protected boolean isLogCharEnabled() { - return TerminalPlugin.isOptionEnabled(Logger.TRACE_DEBUG_LOG_CHAR); - } - - public OutputStream getOutputStream() { - if(getTerminalConnector()!=null) - return getTerminalConnector().getTerminalToRemoteStream(); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#setMsg(java.lang.String) - */ - public void setMsg(String msg) { - fMsg = msg; - } - - public String getMsg() { - return fMsg; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#getCtlText() - */ - protected TextCanvas getCtlText() { - return fCtlText; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#getTerminalText() - */ - public VT100Emulator getTerminalText() { - return fTerminalText; - } - protected class TerminalFocusListener implements FocusListener { - private IContextActivation terminalContextActivation = null; - private IContextActivation editContextActivation = null; - - protected TerminalFocusListener() { - super(); - } - - public void focusGained(FocusEvent event) { - // Disable all keyboard accelerators (e.g., Control-B) so the Terminal view - // can see every keystroke. Without this, Emacs, vi, and Bash are unusable - // in the Terminal view. - if (getState() == TerminalState.CONNECTED) - captureKeyEvents(true); - - IContextService contextService = (IContextService) PlatformUI - .getWorkbench().getAdapter(IContextService.class); - editContextActivation = contextService - .activateContext("org.eclipse.tm.terminal.EditContext"); //$NON-NLS-1$ - } - - public void focusLost(FocusEvent event) { - // Enable all keybindings. - captureKeyEvents(false); - - // Restore the command context to its previous value. - - IContextService contextService = (IContextService) PlatformUI - .getWorkbench().getAdapter(IContextService.class); - contextService.deactivateContext(editContextActivation); - } - - protected void captureKeyEvents(boolean capture) { - IBindingService bindingService = (IBindingService) PlatformUI - .getWorkbench().getAdapter(IBindingService.class); - IContextService contextService = (IContextService) PlatformUI - .getWorkbench().getAdapter(IContextService.class); - - boolean enableKeyFilter = !capture; - if (bindingService.isKeyFilterEnabled() != enableKeyFilter) - bindingService.setKeyFilterEnabled(enableKeyFilter); - - if (capture && terminalContextActivation == null) { - // The above code fails to cause Eclipse to disable menu-activation - // accelerators (e.g., Alt-F for the File menu), so we set the command - // context to be the Terminal view's command context. This enables us to - // override menu-activation accelerators with no-op commands in our - // plugin.xml file, which enables the Terminal view to see absolutely _all_ - // key-presses. - terminalContextActivation = contextService - .activateContext("org.eclipse.tm.terminal.TerminalContext"); //$NON-NLS-1$ - - } else if (!capture && terminalContextActivation != null) { - contextService.deactivateContext(terminalContextActivation); - terminalContextActivation = null; - } - } - } - - protected class TerminalKeyHandler extends KeyAdapter { - public void keyPressed(KeyEvent event) { - //TODO next 2 lines are probably obsolete now - if (getState()==TerminalState.CONNECTING) - return; - - //TODO we should no longer handle copy & paste specially. - //Instead, we should have Ctrl+Shift always go to local since there is no escape sequence for this. - //On Mac, Command+Anything already goes always to local. - //Note that this decision means that Command will NOT be Meta in Emacs on a Remote. - int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(event); - if (editActionAccelerators.isCopyAction(accelerator)) { - copy(); - return; - } - if (editActionAccelerators.isPasteAction(accelerator)) { - paste(); - return; - } - - // We set the event.doit to false to prevent any further processing of this - // key event. The only reason this is here is because I was seeing the F10 - // key both send an escape sequence (due to this method) and switch focus - // to the Workbench File menu (forcing the user to click in the Terminal - // view again to continue entering text). This fixes that. - - event.doit = false; - - char character = event.character; - int modifierKeys = event.stateMask & SWT.MODIFIER_MASK; - boolean ctrlKeyPressed = (event.stateMask & SWT.CTRL) != 0; - boolean onlyCtrlKeyPressed = modifierKeys == SWT.CTRL; - boolean macCmdKeyPressed = (event.stateMask & SWT.COMMAND) != 0; - - // To fix SPR 110341, we consider the Alt key to be pressed only when the - // Control key is _not_ also pressed. This works around a bug in SWT where, - // on European keyboards, the AltGr key being pressed appears to us as Control - // + Alt being pressed simultaneously. - boolean altKeyPressed = (event.stateMask & SWT.ALT) != 0 && !ctrlKeyPressed; - - //if (!isConnected()) { - if (fState==TerminalState.CLOSED) { - // Pressing ENTER while not connected causes us to connect. - if (character == '\r' && isConnectOnEnterIfClosed()) { - connectTerminal(); - return; - } - - // Ignore all other keyboard input when not connected. - // Allow other key handlers (such as Ctrl+F1) do their work - event.doit = true; - return; - } - - // Manage the Del key - if (event.keyCode == 0x000007f) { - sendString("\u001b[3~"); //$NON-NLS-1$ - return; - } - - // TODO Linux tty is usually expecting a DEL (^?) character - // but this causes issues with some telnet servers and - // serial connections. Workaround: stty erase ^H - //if (event.keyCode == SWT.BS) { - // sendChar(SWT.DEL, altKeyPressed); - // return; - //} - - // If the event character is NUL ('\u0000'), then a special key was pressed - // (e.g., PageUp, PageDown, an arrow key, a function key, Shift, Alt, - // Control, etc.). The one exception is when the user presses Control-@, - // which sends a NUL character, in which case we must send the NUL to the - // remote endpoint. This is necessary so that Emacs will work correctly, - // because Control-@ (i.e., NUL) invokes Emacs' set-mark-command when Emacs - // is running on a terminal. When the user presses Control-@, the keyCode - // is 50. - // On a Mac, the Cmd key is always used for local commands. - - if (macCmdKeyPressed || (character == '\u0000' && event.keyCode != 50)) { - // A special key was pressed. Figure out which one it was and send the - // appropriate ANSI escape sequence. - // - // IMPORTANT: Control will not enter this method for these special keys - // unless certain tags are present in the plugin.xml file - // for the Terminal view. Do not delete those tags. - - String escSeq = null; - boolean anyModifierPressed = modifierKeys != 0; - boolean onlyMacCmdKeyPressed = modifierKeys == SWT.COMMAND; - - switch (event.keyCode) { - case 0x1000001: // Up arrow. - if (!anyModifierPressed) - escSeq = fApplicationCursorKeys ? "\u001bOA" : "\u001b[A"; //$NON-NLS-1$ //$NON-NLS-2$ - break; - - case 0x1000002: // Down arrow. - if (!anyModifierPressed) - escSeq = fApplicationCursorKeys ? "\u001bOB" : "\u001b[B"; //$NON-NLS-1$ //$NON-NLS-2$ - break; - - case 0x1000003: // Left arrow. - if (onlyCtrlKeyPressed) { - escSeq = "\u001b[1;5D"; //$NON-NLS-1$ - } else if (!anyModifierPressed) { - escSeq = fApplicationCursorKeys ? "\u001bOD" : "\u001b[D"; //$NON-NLS-1$ //$NON-NLS-2$ - } else if (onlyMacCmdKeyPressed) { - // Cmd-Left is "Home" on the Mac - escSeq = fApplicationCursorKeys ? "\u001bOH" : "\u001b[H"; //$NON-NLS-1$ //$NON-NLS-2$ - } - break; - - case 0x1000004: // Right arrow. - if (onlyCtrlKeyPressed) { - escSeq = "\u001b[1;5C"; //$NON-NLS-1$ - } else if (!anyModifierPressed) { - escSeq = fApplicationCursorKeys ? "\u001bOC" : "\u001b[C"; //$NON-NLS-1$ //$NON-NLS-2$ - } else if (onlyMacCmdKeyPressed) { - // Cmd-Right is "End" on the Mac - escSeq = fApplicationCursorKeys ? "\u001bOF" : "\u001b[F"; //$NON-NLS-1$ //$NON-NLS-2$ - } - break; - - case 0x1000005: // PgUp key. - if (!anyModifierPressed) - escSeq = "\u001b[5~"; //$NON-NLS-1$ - break; - - case 0x1000006: // PgDn key. - if (!anyModifierPressed) - escSeq = "\u001b[6~"; //$NON-NLS-1$ - break; - - case 0x1000007: // Home key. - if (!anyModifierPressed) - escSeq = fApplicationCursorKeys ? "\u001bOH" : "\u001b[H"; //$NON-NLS-1$ //$NON-NLS-2$ - break; - - case 0x1000008: // End key. - if (!anyModifierPressed) - escSeq = fApplicationCursorKeys ? "\u001bOF" : "\u001b[F"; //$NON-NLS-1$ //$NON-NLS-2$ - break; - - case 0x1000009: // Insert. - if (!anyModifierPressed) - escSeq = "\u001b[2~"; //$NON-NLS-1$ - break; - - case 0x100000a: // F1 key. - if (!anyModifierPressed) - escSeq = "\u001bOP"; //$NON-NLS-1$ - break; - - case 0x100000b: // F2 key. - if (!anyModifierPressed) - escSeq = "\u001bOQ"; //$NON-NLS-1$ - break; - - case 0x100000c: // F3 key. - if (!anyModifierPressed) - escSeq = "\u001bOR"; //$NON-NLS-1$ - break; - - case 0x100000d: // F4 key. - if (!anyModifierPressed) - escSeq = "\u001bOS"; //$NON-NLS-1$ - break; - - case 0x100000e: // F5 key. - if (!anyModifierPressed) - escSeq = "\u001b[15~"; //$NON-NLS-1$ - break; - - case 0x100000f: // F6 key. - if (!anyModifierPressed) - escSeq = "\u001b[17~"; //$NON-NLS-1$ - break; - - case 0x1000010: // F7 key. - if (!anyModifierPressed) - escSeq = "\u001b[18~"; //$NON-NLS-1$ - break; - - case 0x1000011: // F8 key. - if (!anyModifierPressed) - escSeq = "\u001b[19~"; //$NON-NLS-1$ - break; - - case 0x1000012: // F9 key. - if (!anyModifierPressed) - escSeq = "\u001b[20~"; //$NON-NLS-1$ - break; - - case 0x1000013: // F10 key. - if (!anyModifierPressed) - escSeq = "\u001b[21~"; //$NON-NLS-1$ - break; - - case 0x1000014: // F11 key. - if (!anyModifierPressed) - escSeq = "\u001b[23~"; //$NON-NLS-1$ - break; - - case 0x1000015: // F12 key. - if (!anyModifierPressed) - escSeq = "\u001b[24~"; //$NON-NLS-1$ - break; - - default: - // Ignore other special keys. Control flows through this case when - // the user presses SHIFT, CONTROL, ALT, and any other key not - // handled by the above cases. - break; - } - - if (escSeq == null) { - // Any unmapped key should be handled locally by Eclipse - event.doit = true; - processKeyBinding(event, accelerator); - } else - sendString(escSeq); - - // It's ok to return here, because we never locally echo special keys. - - return; - } - - Logger.log("stateMask = " + event.stateMask); //$NON-NLS-1$ - - if (onlyCtrlKeyPressed) { - switch (character) { - case ' ': - // Send a NUL character -- many terminal emulators send NUL when - // Control-Space is pressed. This is used to set the mark in Emacs. - character = '\u0000'; - break; - case '/': - // Ctrl+/ is undo in emacs - character = '\u001f'; - break; - } - } - - //TODO: At this point, Ctrl+M sends the same as Ctrl+Shift+M . - //This is undesired. Fixing this here might make the special Ctrl+Shift+C - //handling unnecessary further up. - sendChar(character, altKeyPressed); - - // Special case: When we are in a TCP connection and echoing characters - // locally, send a LF after sending a CR. - // ISSUE: Is this absolutely required? - - if (character == '\r' && getTerminalConnector() != null - && isConnected() - && getTerminalConnector().isLocalEcho()) { - sendChar('\n', false); - } - - // Now decide if we should locally echo the character we just sent. We do - // _not_ locally echo the character if any of these conditions are true: - // - // o This is a serial connection. - // - // o This is a TCP connection (i.e., m_telnetConnection is not null) and - // the remote endpoint is not a TELNET server. - // - // o The ALT (or META) key is pressed. - // - // o The character is any of the first 32 ISO Latin-1 characters except - // Control-I or Control-M. - // - // o The character is the DELETE character. - - if (getTerminalConnector() == null - || getTerminalConnector().isLocalEcho() == false || altKeyPressed - || (character >= '\u0001' && character < '\t') - || (character > '\t' && character < '\r') - || (character > '\r' && character <= '\u001f') - || character == '\u007f') { - // No local echoing. - return; - } - - // Locally echo the character. - - StringBuffer charBuffer = new StringBuffer(); - charBuffer.append(character); - - // If the character is a carriage return, we locally echo it as a CR + LF - // combination. - - if (character == '\r') - charBuffer.append('\n'); - - writeToTerminal(charBuffer.toString()); - } - - /* - * Process given event as Eclipse key binding. - */ - private void processKeyBinding(KeyEvent event, int accelerator) { - IBindingService bindingService = (IBindingService) PlatformUI - .getWorkbench().getAdapter(IBindingService.class); - KeyStroke keyStroke = SWTKeySupport.convertAcceleratorToKeyStroke(accelerator); - Binding binding = bindingService.getPerfectMatch(KeySequence.getInstance(keyStroke)); - if (binding != null) { - ParameterizedCommand cmd = binding.getParameterizedCommand(); - if (cmd != null) { - IHandlerService handlerService = (IHandlerService) PlatformUI - .getWorkbench().getAdapter(IHandlerService.class); - Event cmdEvent = new Event(); - cmdEvent.type = SWT.KeyDown; - cmdEvent.display = event.display; - cmdEvent.widget = event.widget; - cmdEvent.character = event.character; - cmdEvent.keyCode = event.keyCode; - ////Bug - KeyEvent.keyLocation was introduced in Eclipse 3.6 - ////Use reflection for now to remain backward compatible down to Eclipse 3.4 - //cmdEvent.keyLocation = event.keyLocation; - try { - Field f1 = event.getClass().getField("keyLocation"); //$NON-NLS-1$ - Field f2 = cmdEvent.getClass().getField("keyLocation"); //$NON-NLS-1$ - f2.set(cmdEvent, f1.get(event)); - } catch(NoSuchFieldException nsfe) { - /* ignore, this is Eclipse 3.5 or earlier */ - } catch(Throwable t) { - t.printStackTrace(); - } - cmdEvent.stateMask = event.stateMask; - event.doit = false; - try { - handlerService.executeCommand(cmd, cmdEvent); - } catch (ExecutionException e) { - TerminalPlugin.getDefault().getLog().log( - new Status(IStatus.ERROR,TerminalPlugin.PLUGIN_ID,e.getLocalizedMessage(),e)); - } catch (Exception e) { - // ignore other exceptions from cmd execution - } - } - } - } - - } - - public void setTerminalTitle(String title) { - fTerminalListener.setTerminalTitle(title); - } - - - public TerminalState getState() { - return fState; - } - - - public void setState(TerminalState state) { - fState=state; - fTerminalListener.setState(state); - // enable the (blinking) cursor if the terminal is connected - runAsyncInDisplayThread(new Runnable() { - public void run() { - if(fCtlText!=null && !fCtlText.isDisposed()) { - if (isConnected()) { - fCtlText.setCursorEnabled(true); - fPollingTextCanvasModel.startPolling(); - } else { - fCtlText.setCursorEnabled(false); - // Stop capturing all key events - fFocusListener.captureKeyEvents(false); - fPollingTextCanvasModel.stopPolling(); - } - } - } - }); - } - /** - * @param runnable run in display thread - */ - private void runAsyncInDisplayThread(Runnable runnable) { - if(Display.findDisplay(Thread.currentThread())!=null) - runnable.run(); - else if(PlatformUI.isWorkbenchRunning() && PlatformUI.getWorkbench().getDisplay() != null && !PlatformUI.getWorkbench().getDisplay().isDisposed()) - PlatformUI.getWorkbench().getDisplay().asyncExec(runnable); - // else should not happen and we ignore it... - } - - public String getSettingsSummary() { - if(getTerminalConnector()!=null) - return getTerminalConnector().getSettingsSummary(); - return ""; //$NON-NLS-1$ - } - - public void setConnector(ITerminalConnector connector) { - fConnector=connector; - - } - public ICommandInputField getCommandInputField() { - return fCommandInputField; - } - - public void setCommandInputField(ICommandInputField inputField) { - if(fCommandInputField!=null) - fCommandInputField.dispose(); - fCommandInputField=inputField; - if(fCommandInputField!=null) - fCommandInputField.createControl(fWndParent, this); - if(fWndParent.isVisible()) - fWndParent.layout(true); - } - - public int getBufferLineLimit() { - return fTerminalModel.getMaxHeight(); - } - - public void setBufferLineLimit(int bufferLineLimit) { - if(bufferLineLimit<=0) - return; - synchronized (fTerminalModel) { - if(fTerminalModel.getHeight()>bufferLineLimit) - fTerminalModel.setDimensions(bufferLineLimit, fTerminalModel.getWidth()); - fTerminalModel.setMaxHeight(bufferLineLimit); - } - } - - public boolean isScrollLock() { - return fCtlText.isScrollLock(); - } - - public void setScrollLock(boolean on) { - fCtlText.setScrollLock(on); - } - - public void setInvertedColors(boolean invert) { - fCtlText.setInvertedColors(invert); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#setConnectOnEnterIfClosed(boolean) - */ - public final void setConnectOnEnterIfClosed(boolean on) { - connectOnEnterIfClosed = on; - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#isConnectOnEnterIfClosed() - */ - public final boolean isConnectOnEnterIfClosed() { - return connectOnEnterIfClosed; - } - - public void setVT100LineWrapping(boolean enable) { - getTerminalText().setVT100LineWrapping(enable); - } - - public boolean isVT100LineWrapping() { - return getTerminalText().isVT100LineWrapping(); - } - - public void enableApplicationCursorKeys(boolean enable) { - fApplicationCursorKeys = enable; - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/ISnapshotChanges.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/ISnapshotChanges.java deleted file mode 100644 index 088b483e027..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/ISnapshotChanges.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - -public interface ISnapshotChanges { - - /** - * @param line might bigger than the number of lines.... - */ - void markLineChanged(int line); - - /** - * Marks all lines in the range as changed - * @param line >=0 - * @param n might be out of range - */ - void markLinesChanged(int line, int n); - - /** - * Marks all lines within the scrolling region - * changed and resets the scrolling information - */ - void convertScrollingIntoChanges(); - - /** - * @return true if something has changed - */ - boolean hasChanged(); - - /** - * @param startLine - * @param size - * @param shift - */ - void scroll(int startLine, int size, int shift); - - /** - * Mark all lines changed - * @param height if no window is set this is the number of - * lines that are marked as changed - */ - void setAllChanged(int height); - - int getFirstChangedLine(); - - int getLastChangedLine(); - - int getScrollWindowStartLine(); - - int getScrollWindowSize(); - - int getScrollWindowShift(); - - boolean hasLineChanged(int line); - - void markDimensionsChanged(); - boolean hasDimensionsChanged(); - void markCursorChanged(); - - /** - * @return true if the terminal data has changed - */ - boolean hasTerminalChanged(); - /** - * mark the terminal as changed - */ - void setTerminalChanged(); - - - void copyChangedLines(ITerminalTextData dest, ITerminalTextData source); - - /** - * @param startLine -1 means follow the end of the data - * @param size number of lines to follow - */ - void setInterestWindow(int startLine, int size); - int getInterestWindowStartLine(); - int getInterestWindowSize(); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SnapshotChanges.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SnapshotChanges.java deleted file mode 100644 index 9bcbdb56681..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SnapshotChanges.java +++ /dev/null @@ -1,391 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import org.eclipse.tm.terminal.model.ITerminalTextData; - - -/** - * Collects the changes of the {@link ITerminalTextData} - * - */ -public class SnapshotChanges implements ISnapshotChanges { - /** - * The first line changed - */ - private int fFirstChangedLine; - /** - * The last line changed - */ - private int fLastChangedLine; - private int fScrollWindowStartLine; - private int fScrollWindowSize; - private int fScrollWindowShift; - /** - * true, if scrolling should not tracked anymore - */ - private boolean fScrollDontTrack; - /** - * The lines that need to be copied - * into the snapshot (lines that have - * not changed don't have to be copied) - */ - private boolean[] fChangedLines; - - private int fInterestWindowSize; - private int fInterestWindowStartLine; - private boolean fDimensionsChanged; - private boolean fTerminalHasChanged; - private boolean fCursorHasChanged; - - public SnapshotChanges(int nLines) { - setChangedLinesLength(nLines); - fFirstChangedLine=Integer.MAX_VALUE; - fLastChangedLine=-1; - } - public SnapshotChanges(int windowStart, int windowSize) { - setChangedLinesLength(windowStart+windowSize); - fFirstChangedLine=Integer.MAX_VALUE; - fLastChangedLine=-1; - fInterestWindowStartLine=windowStart; - fInterestWindowSize=windowSize; - - } - /** - * This is used in asserts to throw an {@link RuntimeException}. - * This is useful for tests. - * @return never -- throws an exception - */ - private boolean throwRuntimeException() { - throw new RuntimeException(); - } - /** - * @param line - * @param size - * @return true if the range overlaps with the interest window - */ - boolean isInInterestWindow(int line, int size) { - if(fInterestWindowSize<=0) - return true; - if(line+size<=fInterestWindowStartLine || line>=fInterestWindowStartLine+fInterestWindowSize) - return false; - return true; - } - /** - * @param line - * @return true if the line is within the interest window - */ - boolean isInInterestWindow(int line) { - if(fInterestWindowSize<=0) - return true; - if(line=fInterestWindowStartLine+fInterestWindowSize) - return false; - return true; - } - /** - * @param line - * @return the line within the window - */ - int fitLineToWindow(int line) { - if(fInterestWindowSize<=0) - return line; - if(linebefore {@link #fitLineToWindow(int)} has been called! - * @param size - * @return the adjusted size. - *

            Note:

            {@link #fitLineToWindow(int)} has to be called on the line to - * move the window correctly! - */ - int fitSizeToWindow(int line, int size) { - if(fInterestWindowSize<=0) - return size; - if(linefInterestWindowStartLine+fInterestWindowSize) - size=fInterestWindowStartLine+fInterestWindowSize-line; - return size; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ISnapshotChanges#markLineChanged(int) - */ - public void markLineChanged(int line) { - if(!isInInterestWindow(line)) - return; - line=fitLineToWindow(line); - if(linefLastChangedLine) - fLastChangedLine=line; - // in case the terminal got resized we expand - // don't remember the changed line because - // there is nothing to copy - if(line0 || fScrollWindowShift!=0 ||fDimensionsChanged || fCursorHasChanged) - return true; - return false; - } - public void markDimensionsChanged() { - fDimensionsChanged=true; - } - public boolean hasDimensionsChanged() { - return fDimensionsChanged; - } - public boolean hasTerminalChanged() { - return fTerminalHasChanged; - } - public void setTerminalChanged() { - fTerminalHasChanged=true; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ISnapshotChanges#scroll(int, int, int) - */ - public void scroll(int startLine, int size, int shift) { - size=fitSizeToWindow(startLine, size); - startLine=fitLineToWindow(startLine); - // let's track only negative shifts - if(fScrollDontTrack) { - // we are in a state where we cannot track scrolling - // so let's simply mark the scrolled lines as changed - markLinesChanged(startLine, size); - } else if(shift>=0) { - // we cannot handle positive scroll - // forget about clever caching of scroll events - doNotTrackScrollingAnymore(); - // mark all lines inside the scroll region as changed - markLinesChanged(startLine, size); - } else { - // we have already scrolled - if(fScrollWindowShift<0) { - // we have already scrolled - if(fScrollWindowStartLine==startLine && fScrollWindowSize==size) { - // we are scrolling the same region again? - fScrollWindowShift+=shift; - scrollChangesLinesWithNegativeShift(startLine,size,shift); - } else { - // mark all lines in the old scroll region as changed - doNotTrackScrollingAnymore(); - // mark all lines changed, because - markLinesChanged(startLine, size); - } - } else { - // first scroll in this change -- we just notify it - fScrollWindowStartLine=startLine; - fScrollWindowSize=size; - fScrollWindowShift=shift; - scrollChangesLinesWithNegativeShift(startLine,size,shift); - } - } - } - /** - * Some incompatible scrolling occurred. We cannot do the - * scroll optimization anymore... - */ - private void doNotTrackScrollingAnymore() { - if(fScrollWindowSize>0) { - // convert the current scrolling into changes - markLinesChanged(fScrollWindowStartLine, fScrollWindowSize); - fScrollWindowStartLine=0; - fScrollWindowSize=0; - fScrollWindowShift=0; - } - // don't be clever on scrolling anymore - fScrollDontTrack=true; - } - /** - * Scrolls the changed lines data - * - * @param line - * @param n - * @param shift must be negative! - */ - private void scrollChangesLinesWithNegativeShift(int line, int n, int shift) { - assert shift <0 || throwRuntimeException(); - // scroll the region - // don't run out of bounds! - int m=Math.min(line+n+shift,getChangedLineLength()+shift); - for (int i = line; i < m; i++) { - setChangedLine(i, hasLineChanged(i-shift)); - // move the first changed line up. - // We don't have to move the maximum down, - // because with a shift scroll, the max is moved - // my the next loop in this method - if(i0) { - int shift=oldStartLine-startLine; - if(shift==0) { - if(size>oldSize) { - // add lines to the end - markLinesChanged(oldStartLine+oldSize, size-oldSize); - } - // else no lines within the window have changed - - } else if(Math.abs(shift)TerminalTextData.toMultiLineText(this,0,200)) - * @param term the terminal - * @param start start line to show - * @param len number of lines to show -- negative numbers means show all - * @return a string representation of the content - */ - static public String toMultiLineText(ITerminalTextDataReadOnly term, int start, int len) { - if(len<0) - len=term.getHeight(); - StringBuffer buff=new StringBuffer(); - int width=term.getWidth(); - int n=Math.min(len,term.getHeight()-start); - for (int line = start; line < n; line++) { - if(line>0) - buff.append("\n"); //$NON-NLS-1$ - for (int column = 0; column < width; column++) { - buff.append(term.getChar(line, column)); - } - } - // get rid of the empty space at the end of the lines - //return buff.toString().replaceAll("\000+", ""); //$NON-NLS-1$//$NON-NLS-2$ - // - int i = buff.length() - 1; - while (i >= 0 && buff.charAt(i) == '\000') { - i--; - } - buff.setLength(i + 1); - return buff.toString(); - // - } - - /** - * Show the first 100 lines - * see {@link #toMultiLineText(ITerminalTextDataReadOnly, int, int)} - * @param term A read-only terminal model - * @return a string representation of the terminal - */ - static public String toMultiLineText(ITerminalTextDataReadOnly term) { - return toMultiLineText(term, 0, 100); - } - - public TerminalTextData() { - this(new TerminalTextDataFastScroll()); - -// this(new TerminalTextDataStore()); - } - public TerminalTextData(ITerminalTextData data) { - fData=data; - } - public int getWidth() { - return fData.getWidth(); - } - public int getHeight() { - // no need for an extra variable - return fData.getHeight(); - } - public void setDimensions(int height, int width) { - int h=getHeight(); - int w=getWidth(); - if(w==width && h==height) - return; - fData.setDimensions(height, width); - sendDimensionsChanged(h, w, height, width); - } - private void sendDimensionsChanged(int oldHeight, int oldWidth, int newHeight, int newWidth) { - // determine what has changed - if(oldWidth==newWidth) { - if(oldHeightoldHeight) { - //the line was appended - sendLinesChangedToSnapshot(oldHeight, 1); - int width=getWidth(); - sendDimensionsChanged(oldHeight, width, newHeight, width); - - } else { - // the line was scrolled - sendScrolledToSnapshots(0, oldHeight, -1); - } - - } - - public void copy(ITerminalTextData source) { - fData.copy(source); - fCursorLine=source.getCursorLine(); - fCursorColumn=source.getCursorColumn(); - } - - public void copyLine(ITerminalTextData source, int sourceLine, int destLine) { - fData.copyLine(source, sourceLine, destLine); - } - public void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine, int length) { - fData.copyRange(source, sourceStartLine, destStartLine, length); - } - public char[] getChars(int line) { - return fData.getChars(line); - } - public Style[] getStyles(int line) { - return fData.getStyles(line); - } - public int getMaxHeight() { - return fData.getMaxHeight(); - } - public void setMaxHeight(int height) { - fData.setMaxHeight(height); - } - public void cleanLine(int line) { - fData.cleanLine(line); - sendLineChangedToSnapshots(line); - } - public int getCursorColumn() { - return fCursorColumn; - } - public int getCursorLine() { - return fCursorLine; - } - public void setCursorColumn(int column) { - fCursorColumn=column; - sendCursorChanged(); - } - public void setCursorLine(int line) { - fCursorLine=line; - sendCursorChanged(); - } - - public boolean isWrappedLine(int line) { - return fData.isWrappedLine(line); - } - - public void setWrappedLine(int line) { - fData.setWrappedLine(line); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java deleted file mode 100644 index e6101581c46..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java +++ /dev/null @@ -1,259 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007-2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; -import org.eclipse.tm.terminal.model.LineSegment; -import org.eclipse.tm.terminal.model.Style; - -/** - * This class is optimized for scrolling the entire {@link #getHeight()}. - * The scrolling is done by moving an offset into the data and using - * the modulo operator. - * - */ -public class TerminalTextDataFastScroll implements ITerminalTextData { - - final ITerminalTextData fData; - private int fHeight; - private int fMaxHeight; - /** - * The offset into the array. - */ - int fOffset; - public TerminalTextDataFastScroll(ITerminalTextData data,int maxHeight) { - fMaxHeight=maxHeight; - fData=data; - fData.setDimensions(maxHeight, fData.getWidth()); - if(maxHeight>2) - assert shiftOffset(-2) || throwRuntimeException(); - } - public TerminalTextDataFastScroll(int maxHeight) { - this(new TerminalTextDataStore(),maxHeight); - } - public TerminalTextDataFastScroll() { - this(new TerminalTextDataStore(),1); - } - /** - * This is used in asserts to throw an {@link RuntimeException}. - * This is useful for tests. - * @return never -- throws an exception - */ - private boolean throwRuntimeException() { - throw new RuntimeException(); - } - /** - * - * @param line - * @return the actual line number in {@link #fData} - */ - int getPositionOfLine(int line) { - return (line+fOffset)%fMaxHeight; - } - /** - * Moves offset by delta. This does not move the data! - * @param delta - */ - void moveOffset(int delta) { - assert Math.abs(delta)=0 && destStartLine+length<=fHeight) || throwRuntimeException(); - for (int i = 0; i < length; i++) { - fData.copyLine(source, i+sourceStartLine, getPositionOfLine(i+destStartLine)); - } - } - - public char getChar(int line, int column) { - assert (line>=0 && line=0 && line=0 && line=0 && line=0 && line=0 && startLine+size<=fHeight) || throwRuntimeException(); - if(shift>=fMaxHeight || -shift>=fMaxHeight) { - cleanLines(startLine, fMaxHeight-startLine); - return; - } - if(size==fHeight) { - // This is the case this class is optimized for! - moveOffset(-shift); - // we only have to clean the lines that appear by the move - if(shift<0) { - cleanLines(Math.max(startLine, startLine+size+shift),Math.min(-shift, getHeight()-startLine)); - } else { - cleanLines(startLine, Math.min(shift, getHeight()-startLine)); - } - } else { - // we have to copy the lines. - if(shift<0) { - // move the region up - // shift is negative!! - for (int i = startLine; i < startLine+size+shift; i++) { - fData.copyLine(fData, getPositionOfLine(i-shift), getPositionOfLine(i)); - } - // then clean the opened lines - cleanLines(Math.max(0, startLine+size+shift),Math.min(-shift, getHeight()-startLine)); - } else { - for (int i = startLine+size-1; i >=startLine && i-shift>=0; i--) { - fData.copyLine(fData, getPositionOfLine(i-shift), getPositionOfLine(i)); - } - cleanLines(startLine, Math.min(shift, getHeight()-startLine)); - } - } - } - - public void setChar(int line, int column, char c, Style style) { - assert (line>=0 && line=0 && line=0 && line=0 || throwRuntimeException(); - assert width>=0 || throwRuntimeException(); - if(height > fMaxHeight) - setMaxHeight(height); - fHeight=height; - if(width!=fData.getWidth()) - fData.setDimensions(fMaxHeight, width); - } - - public void setMaxHeight(int maxHeight) { - assert maxHeight>=fHeight || throwRuntimeException(); - // move everything to offset0 - int start=getPositionOfLine(0); - if(start!=0) { - // invent a more efficient algorithm.... - ITerminalTextData buffer=new TerminalTextDataStore(); - // create a buffer with the expected height - buffer.setDimensions(maxHeight, getWidth()); - int n=Math.min(fMaxHeight-start,maxHeight); - // copy the first part - buffer.copyRange(fData, start, 0, n); - // copy the second part - if(n=0 && line=0 && linenot threadsafe! - */ -class TerminalTextDataSnapshot implements ITerminalTextDataSnapshot { - /** - * The changes of the current snapshot relative to the - * previous snapshot - */ - volatile ISnapshotChanges fCurrentChanges; - /** - * Keeps track of changes that happened since the current - * snapshot has been made. - */ - ISnapshotChanges fFutureChanges; - /** - * Is used as lock and is the reference to the terminal we take snapshots from. - */ - final TerminalTextData fTerminal; - /** - * A snapshot copy of of fTerminal - */ - // snapshot does not need internal synchronisation - final TerminalTextDataWindow fSnapshot; - // this variable is synchronized on fTerminal! - private SnapshotOutOfDateListener[] fListener=new SnapshotOutOfDateListener[0]; - // this variable is synchronized on fTerminal! - private boolean fListenersNeedNotify; - private int fInterestWindowSize; - private int fInterestWindowStartLine; - - TerminalTextDataSnapshot(TerminalTextData terminal) { - fSnapshot = new TerminalTextDataWindow(); - fTerminal = terminal; - fCurrentChanges = new SnapshotChanges(fTerminal.getHeight()); - fCurrentChanges.setTerminalChanged(); - fFutureChanges = new SnapshotChanges(fTerminal.getHeight()); - fFutureChanges.markLinesChanged(0, fTerminal.getHeight()); - fListenersNeedNotify=true; - fInterestWindowSize=-1; - } - /** - * This is used in asserts to throw an {@link RuntimeException}. - * This is useful for tests. - * @return never -- throws an exception - */ - private boolean throwRuntimeException() { - throw new RuntimeException(); - } - - public void detach() { - fTerminal.removeSnapshot(this); - } - - public boolean isOutOfDate() { - // this is called from fTerminal, therefore we lock on fTerminal - synchronized (fTerminal) { - return fFutureChanges.hasChanged(); - } - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#snapshot() - */ - public void updateSnapshot(boolean detectScrolling) { - // make sure terminal does not change while we make the snapshot - synchronized (fTerminal) { - // let's make the future changes current - fCurrentChanges=fFutureChanges; - fFutureChanges=new SnapshotChanges(fTerminal.getHeight()); - fFutureChanges.setInterestWindow(fInterestWindowStartLine, fInterestWindowSize); - // and update the snapshot - if(fSnapshot.getHeight()!=fTerminal.getHeight()||fSnapshot.getWidth()!=fTerminal.getWidth()) { - if(fInterestWindowSize==-1) - fSnapshot.setWindow(0, fTerminal.getHeight()); - // if the dimensions have changed, we need a full copy - fSnapshot.copy(fTerminal); - // and we mark all lines as changed - fCurrentChanges.setAllChanged(fTerminal.getHeight()); - } else { - // first we do the scroll on the copy - int start=fCurrentChanges.getScrollWindowStartLine(); - int lines=Math.min(fCurrentChanges.getScrollWindowSize(), fSnapshot.getHeight()-start); - fSnapshot.scroll(start, lines, fCurrentChanges.getScrollWindowShift()); - // and then create the snapshot of the changed lines - fCurrentChanges.copyChangedLines(fSnapshot, fTerminal); - } - fListenersNeedNotify=true; - fSnapshot.setCursorLine(fTerminal.getCursorLine()); - fSnapshot.setCursorColumn(fTerminal.getCursorColumn()); - } - if(!detectScrolling) { - // let's pretend there was no scrolling and - // convert the scrolling into line changes - fCurrentChanges.convertScrollingIntoChanges(); - } - } - - public char getChar(int line, int column) { - return fSnapshot.getChar(line, column); - } - - public int getHeight() { - return fSnapshot.getHeight(); - } - - public LineSegment[] getLineSegments(int line, int column, int len) { - return fSnapshot.getLineSegments(line, column, len); - } - - public Style getStyle(int line, int column) { - return fSnapshot.getStyle(line, column); - } - - public int getWidth() { - return fSnapshot.getWidth(); - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#getFirstChangedLine() - */ - public int getFirstChangedLine() { - return fCurrentChanges.getFirstChangedLine(); - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#getLastChangedLine() - */ - public int getLastChangedLine() { - return fCurrentChanges.getLastChangedLine(); - } - - public boolean hasLineChanged(int line) { - return fCurrentChanges.hasLineChanged(line); - } - public boolean hasDimensionsChanged() { - return fCurrentChanges.hasDimensionsChanged(); - } - public boolean hasTerminalChanged() { - return fCurrentChanges.hasTerminalChanged(); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#getScrollChangeY() - */ - public int getScrollWindowStartLine() { - return fCurrentChanges.getScrollWindowStartLine(); - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#getScrollChangeN() - */ - public int getScrollWindowSize() { - return fCurrentChanges.getScrollWindowSize(); - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.model.ITerminalTextDataSnapshot#getScrollChangeShift() - */ - public int getScrollWindowShift() { - return fCurrentChanges.getScrollWindowShift(); - } - - /** - * Announces a change in line line - * @param line - */ - void markLineChanged(int line) { - // threading - fFutureChanges.markLineChanged(line); - fFutureChanges.setTerminalChanged(); - notifyListers(); - } - /** - * Announces a change of n lines beginning with line line - * @param line - * @param n - */ - void markLinesChanged(int line,int n) { - fFutureChanges.markLinesChanged(line,n); - fFutureChanges.setTerminalChanged(); - notifyListers(); - } - - void markDimensionsChanged() { - fFutureChanges.markDimensionsChanged(); - fFutureChanges.setTerminalChanged(); - notifyListers(); - } - void markCursorChanged() { - fFutureChanges.markCursorChanged(); - fFutureChanges.setTerminalChanged(); - notifyListers(); - } - - /** - * @param startLine - * @param size - * @param shift - */ - void scroll(int startLine, int size, int shift) { - fFutureChanges.scroll(startLine,size,shift); - fFutureChanges.setTerminalChanged(); - notifyListers(); - } - /** - * Notifies listeners about the change - */ - private void notifyListers() { - // this code has to be called from a block synchronized on fTerminal - synchronized (fTerminal) { - if(fListenersNeedNotify) { - for (int i = 0; i < fListener.length; i++) { - fListener[i].snapshotOutOfDate(this); - } - fListenersNeedNotify=false; - } - } - } - public ITerminalTextDataSnapshot makeSnapshot() { - return fSnapshot.makeSnapshot(); - } - - synchronized public void addListener(SnapshotOutOfDateListener listener) { - List list=new ArrayList(); - list.addAll(Arrays.asList(fListener)); - list.add(listener); - fListener=(SnapshotOutOfDateListener[]) list.toArray(new SnapshotOutOfDateListener[list.size()]); - } - - synchronized public void removeListener(SnapshotOutOfDateListener listener) { - List list=new ArrayList(); - list.addAll(Arrays.asList(fListener)); - list.remove(listener); - fListener=(SnapshotOutOfDateListener[]) list.toArray(new SnapshotOutOfDateListener[list.size()]); - } - public String toString() { - return fSnapshot.toString(); - } - - - public int getInterestWindowSize() { - return fInterestWindowSize; - } - - - public int getInterestWindowStartLine() { - return fInterestWindowStartLine; - } - - public void setInterestWindow(int startLine, int size) { - assert startLine>=0 || throwRuntimeException(); - assert size>=0 || throwRuntimeException(); - fInterestWindowStartLine=startLine; - fInterestWindowSize=size; - fSnapshot.setWindow(startLine, size); - fFutureChanges.setInterestWindow(startLine, size); - notifyListers(); - } - - - public char[] getChars(int line) { - return fSnapshot.getChars(line); - } - - - public Style[] getStyles(int line) { - return fSnapshot.getStyles(line); - } - public int getCursorColumn() { - return fSnapshot.getCursorColumn(); - } - public int getCursorLine() { - return fSnapshot.getCursorLine(); - } - public ITerminalTextData getTerminalTextData() { - return fTerminal; - } - public boolean isWrappedLine(int line) { - return fSnapshot.isWrappedLine(line); - } -} - - diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java deleted file mode 100644 index b5927ff26bb..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java +++ /dev/null @@ -1,344 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.model; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.List; - -import org.eclipse.tm.terminal.model.ITerminalTextData; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; -import org.eclipse.tm.terminal.model.LineSegment; -import org.eclipse.tm.terminal.model.Style; - -/** - * This class is thread safe. - * - */ -public class TerminalTextDataStore implements ITerminalTextData { - private char[][] fChars; - private Style[][] fStyle; - private int fWidth; - private int fHeight; - private int fMaxHeight; - private int fCursorColumn; - private int fCursorLine; - final private BitSet fWrappedLines = new BitSet(); - - public TerminalTextDataStore() { - fChars=new char[0][]; - fStyle=new Style[0][]; - fWidth=0; - } - /** - * This is used in asserts to throw an {@link RuntimeException}. - * This is useful for tests. - * @return never -- throws an exception - */ - private boolean throwRuntimeException() { - throw new RuntimeException(); - } - - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getWidth() - */ - public int getWidth() { - return fWidth; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getHeight() - */ - public int getHeight() { - return fHeight; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#setDimensions(int, int) - */ - public void setDimensions(int height, int width) { - assert height>=0 || throwRuntimeException(); - assert width>=0 || throwRuntimeException(); - // just extend the region - if(height>fChars.length) { - int h=4*height/3; - if(fMaxHeight>0 && h>fMaxHeight) - h=fMaxHeight; - fStyle=(Style[][]) resizeArray(fStyle, height); - fChars=(char[][]) resizeArray(fChars, height); - } - // clean the new lines - if(height>fHeight) { - for (int i = fHeight; i < height; i++) { - cleanLine(i); - } - } - // set dimensions after successful resize! - fWidth=width; - fHeight=height; - } - /** - * Reallocates an array with a new size, and copies the contents of the old - * array to the new array. - * - * @param origArray the old array, to be reallocated. - * @param newSize the new array size. - * @return A new array with the same contents (chopped off if needed or filled with 0 or null). - */ - private Object resizeArray(Object origArray, int newSize) { - int oldSize = Array.getLength(origArray); - if(oldSize==newSize) - return origArray; - Class elementType = origArray.getClass().getComponentType(); - Object newArray = Array.newInstance(elementType, newSize); - int preserveLength = Math.min(oldSize, newSize); - if (preserveLength > 0) - System.arraycopy(origArray, 0, newArray, 0, preserveLength); - return newArray; - } - - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getLineSegments(int, int, int) - */ - public LineSegment[] getLineSegments(int line, int column, int len) { - // get the styles and chars for this line - Style[] styles=fStyle[line]; - char[] chars=fChars[line]; - int col=column; - int n=column+len; - - // expand the line if needed.... - if(styles==null) - styles=new Style[n]; - else if(styles.length=fChars[line].length) - return 0; - return fChars[line][column]; - } - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getStyle(int, int) - */ - public Style getStyle(int line, int column) { - assert column=fStyle[line].length) - return null; - return fStyle[line][column]; - } - - void ensureLineLength(int iLine, int length) { - if(length>fWidth) - throw new RuntimeException(); - if(fChars[iLine]==null) { - fChars[iLine]=new char[length]; - } else if(fChars[iLine].length=startLine && i-shift>=0; i--) { - fChars[i]=fChars[i-shift]; - fStyle[i]=fStyle[i-shift]; - fWrappedLines.set(i, fWrappedLines.get(i-shift)); - } - cleanLines(startLine, Math.min(shift, getHeight()-startLine)); - } - } - /** - * Replaces the lines with new empty data - * @param line - * @param len - */ - private void cleanLines(int line, int len) { - for (int i = line; i < line+len; i++) { - cleanLine(i); - } - } - - /* - * @return a text representation of the object. - * Lines are separated by '\n'. No style information is returned. - */ - public String toString() { - StringBuffer buff=new StringBuffer(); - for (int line = 0; line < getHeight(); line++) { - if(line>0) - buff.append("\n"); //$NON-NLS-1$ - for (int column = 0; column < fWidth; column++) { - buff.append(getChar(line, column)); - } - } - return buff.toString(); - } - - - public ITerminalTextDataSnapshot makeSnapshot() { - throw new UnsupportedOperationException(); - } - - public void addLine() { - if(fMaxHeight>0 && getHeight()char=='\000' and style=null. - * - */ -public class TerminalTextDataWindow implements ITerminalTextData { - final ITerminalTextData fData; - int fWindowStartLine; - int fWindowSize; - int fHeight; - int fMaxHeight; - public TerminalTextDataWindow(ITerminalTextData data) { - fData=data; - } - public TerminalTextDataWindow() { - this(new TerminalTextDataStore()); - } - /** - * This is used in asserts to throw an {@link RuntimeException}. - * This is useful for tests. - * @return never -- throws an exception - */ - private boolean throwRuntimeException() { - throw new RuntimeException(); - } - /** - * @param line - * @return true if the line is within the window - */ - boolean isInWindow(int line) { - return line>=fWindowStartLine && line0 && getHeight()0) - fData.copyRange(source, fWindowStartLine, 0, n); - } - public void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine, int length) { - int n=length; - int dStart=destStartLine-fWindowStartLine; - int sStart=sourceStartLine; - // if start outside our range, cut the length to copy - if(dStart<0) { - n+=dStart; - sStart-=dStart; - dStart=0; - } - // do not exceed the window size - n=Math.min(n,fWindowSize); - if(n>0) - fData.copyRange(source, sStart, dStart, n); - - } - public void copyLine(ITerminalTextData source, int sourceLine, int destLine) { - if(isInWindow(destLine)) - fData.copyLine(source, sourceLine, destLine-fWindowStartLine); - } - public void scroll(int startLine, int size, int shift) { - assert (startLine>=0 && startLine+size<=fHeight) || throwRuntimeException(); - int n=size; - int start=startLine-fWindowStartLine; - // if start outside our range, cut the length to copy - if(start<0) { - n+=start; - start=0; - } - n=Math.min(n,fWindowSize-start); - // do not exceed the window size - if(n>0) - fData.scroll(start, n, shift); - } - public void setChar(int line, int column, char c, Style style) { - if(!isInWindow(line)) - return; - fData.setChar(line-fWindowStartLine, column, c, style); - } - public void setChars(int line, int column, char[] chars, int start, int len, Style style) { - if(!isInWindow(line)) - return; - fData.setChars(line-fWindowStartLine, column, chars, start, len, style); - } - public void setChars(int line, int column, char[] chars, Style style) { - if(!isInWindow(line)) - return; - fData.setChars(line-fWindowStartLine, column, chars, style); - } - public void setDimensions(int height, int width) { - assert height>=0 || throwRuntimeException(); - fData.setDimensions(fWindowSize, width); - fHeight=height; - } - public void setMaxHeight(int height) { - fMaxHeight=height; - } - public void setWindow(int startLine, int size) { - fWindowStartLine=startLine; - fWindowSize=size; - fData.setDimensions(fWindowSize, getWidth()); - } - public int getWindowStartLine() { - return fWindowStartLine; - } - public int getWindowSize() { - return fWindowSize; - } - public void setHeight(int height) { - fHeight = height; - } - public void cleanLine(int line) { - if(isInWindow(line)) - fData.cleanLine(line-fWindowStartLine); - } - public int getCursorColumn() { - return fData.getCursorColumn(); - } - public int getCursorLine() { - return fData.getCursorLine(); - } - public void setCursorColumn(int column) { - fData.setCursorColumn(column); - } - public void setCursorLine(int line) { - fData.setCursorLine(line); - } - public boolean isWrappedLine(int line) { - if(isInWindow(line)) - return fData.isWrappedLine(line - fWindowStartLine); - return false; - } - public void setWrappedLine(int line) { - if(isInWindow(line)) - fData.setWrappedLine(line - fWindowStartLine); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/ITerminalConstants.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/ITerminalConstants.java deleted file mode 100644 index 0c3bae84c49..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/ITerminalConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.preferences; - -public interface ITerminalConstants { - - public static final String PREF_HAS_MIGRATED = "TerminalPref.migrated"; //$NON-NLS-1$ - - public static final String PREF_BUFFERLINES = "TerminalPrefBufferLines"; //$NON-NLS-1$ - public static final String PREF_INVERT_COLORS = "TerminalPrefInvertColors"; //$NON-NLS-1$ - public static final int DEFAULT_BUFFERLINES = 1000; - public static final boolean DEFAULT_INVERT_COLORS = false; - - public static final String FONT_DEFINITION = "terminal.views.view.font.definition"; //$NON-NLS-1$ - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferenceInitializer.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferenceInitializer.java deleted file mode 100644 index 5abef797f8a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferenceInitializer.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget - * Martin Oberhuber (Wind River) - [436612] Restore Eclipse 3.4 compatibility - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; - -public class TerminalPreferenceInitializer extends AbstractPreferenceInitializer { - - public TerminalPreferenceInitializer() { - } - - public void initializeDefaultPreferences() { - //DefaultScope.INSTANCE was only added in Eclipse 3.7 - we want to be compatible further back - //IEclipsePreferences defaultPrefs = DefaultScope.INSTANCE.getNode(TerminalPlugin.PLUGIN_ID); - IEclipsePreferences defaultPrefs = new DefaultScope().getNode(TerminalPlugin.PLUGIN_ID); - defaultPrefs.putBoolean(ITerminalConstants.PREF_INVERT_COLORS, ITerminalConstants.DEFAULT_INVERT_COLORS); - defaultPrefs.putInt(ITerminalConstants.PREF_BUFFERLINES, ITerminalConstants.DEFAULT_BUFFERLINES); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferencePage.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferencePage.java deleted file mode 100644 index c002e3850f0..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/preferences/TerminalPreferencePage.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following Wind River employees contributed to the Terminal component - * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, - * Helmut Haigermoser and Ted Williams. - * - * Contributors: - * Michael Scharf (Wind River) - split into core, view and connector plugins - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.preferences; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.tm.internal.terminal.control.impl.TerminalMessages; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class TerminalPreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { - protected BooleanFieldEditor fInvertColors; - - protected IntegerFieldEditor fEditorBufferSize; - - public TerminalPreferencePage() { - super(GRID); - } - protected void createFieldEditors() { - setupPage(); - } - public void init(IWorkbench workbench) { - // do nothing - } - protected void setupPage() { - setupData(); - setupEditors(); - } - protected void setupData() { - TerminalPlugin plugin; - IPreferenceStore preferenceStore; - - plugin = TerminalPlugin.getDefault(); - preferenceStore = plugin.getPreferenceStore(); - setPreferenceStore(preferenceStore); - } - protected void setupEditors() { - fInvertColors = new BooleanFieldEditor( - ITerminalConstants.PREF_INVERT_COLORS, TerminalMessages.INVERT_COLORS, - getFieldEditorParent()); - fEditorBufferSize = new IntegerFieldEditor(ITerminalConstants.PREF_BUFFERLINES, - TerminalMessages.BUFFERLINES, getFieldEditorParent()); - - fEditorBufferSize.setValidRange(0, Integer.MAX_VALUE); - - addField(fInvertColors); - addField(fEditorBufferSize); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java deleted file mode 100644 index 501f45fb430..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/AbstractSettingsPage.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.fieldassist.ControlDecoration; -import org.eclipse.jface.fieldassist.FieldDecoration; -import org.eclipse.jface.fieldassist.FieldDecorationRegistry; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Control; - -/** - * Abstract settings page providing a common implementation of the listener handling. - */ -public abstract class AbstractSettingsPage implements ISettingsPage, IMessageProvider { - // A message associated with the control. - private String message = null; - - // The message type of the associated message. - private int messageType = IMessageProvider.NONE; - - // Reference to the listener - private final ListenerList listeners = new ListenerList(); - - // Flag to control the control decorations - private boolean hasDecoration = false; - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#addListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener) - */ - public void addListener(Listener listener) { - Assert.isNotNull(listener); - listeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#removeListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener) - */ - public void removeListener(Listener listener) { - Assert.isNotNull(listener); - listeners.remove(listener); - } - - /** - * Fire the listeners for the given control. - * - * @param control The control or null. - */ - public void fireListeners(Control control) { - Object[] list = listeners.getListeners(); - for (int i = 0; i < list.length; i++) { - Object l = list[i]; - if (!(l instanceof Listener)) continue; - ((Listener)l).onSettingsPageChanged(control); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IMessageProvider#getMessage() - */ - public final String getMessage() { - return message; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType() - */ - public final int getMessageType() { - return messageType; - } - - /** - * Set the message and the message type. - * - * @param message The message or null. - * @param messageType The type of the message (NONE, INFORMATION, WARNING, ERROR). - */ - public final void setMessage(String message, int messageType) { - this.message = message; - this.messageType = messageType; - } - - /** - * Sets if or if not the settings panel widgets will have control decorations - * or not. The method has effect only if called before {@link #createControl(org.eclipse.swt.widgets.Composite)}. - * - * @param value True if the panel widgets have control decorations, false otherwise. - */ - public final void setHasControlDecoration(boolean value) { - this.hasDecoration = value; - } - - /** - * Returns if or if not the settings panel widgets will have control - * decorations or not. - * - * @return True if the panel widgets have control decorations, false otherwise. - */ - protected final boolean hasControlDecoration() { - return hasDecoration; - } - - /** - * Creates a new instance of a {@link ControlDecoration} object associated with - * the given control. The method is called after the control has been created. - * - * @param control The control. Must not be null. - * @return The control decoration object instance. - */ - protected final ControlDecoration createControlDecoration(Control control) { - Assert.isNotNull(control); - if (!hasDecoration) return null; - ControlDecoration controlDecoration = new ControlDecoration(control, getControlDecorationPosition()); - controlDecoration.setShowOnlyOnFocus(false); - control.setData("controlDecoration", controlDecoration); //$NON-NLS-1$ - return controlDecoration; - } - - /** - * Returns the control decoration position. The default is - * {@link SWT#TOP} | {@link SWT#LEFT}. - * - * @return The control position. - */ - protected int getControlDecorationPosition() { - return SWT.TOP | SWT.LEFT; - } - - /** - * Updates the control decoration of the given control to represent the given message - * and message type. If the message is null or the message type is - * {@link IMessageProvider#NONE} no decoration will be shown. - * - * @param control The control. Must not be null. - * @param message The message. - * @param messageType The message type. - */ - protected final void updateControlDecoration(Control control, String message, int messageType) { - Assert.isNotNull(control); - - ControlDecoration controlDecoration = (ControlDecoration)control.getData("controlDecoration"); //$NON-NLS-1$ - if (controlDecoration != null) { - // The description is the same as the message - controlDecoration.setDescriptionText(message); - - // The icon depends on the message type - FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); - - // Determine the id of the decoration to show - String decorationId = FieldDecorationRegistry.DEC_INFORMATION; - if (messageType == IMessageProvider.ERROR) { - decorationId = FieldDecorationRegistry.DEC_ERROR; - } else if (messageType == IMessageProvider.WARNING) { - decorationId = FieldDecorationRegistry.DEC_WARNING; - } - - // Get the field decoration - FieldDecoration fieldDeco = registry.getFieldDecoration(decorationId); - if (fieldDeco != null) { - controlDecoration.setImage(fieldDeco.getImage()); - } - - if (message == null || messageType == IMessageProvider.NONE) { - controlDecoration.hide(); - } - else { - controlDecoration.show(); - } - } - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsPage.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsPage.java deleted file mode 100644 index 560000c81ee..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsPage.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2013 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * @author Michael Scharf - * - * TODO: Michael Scharf: provide a long description of a wizard - * TODO: Michael Scharf: allow multiple pages to be generated - *

            - * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. - *

            - */ -public interface ISettingsPage { - - public interface Listener { - - /** - * Invoked by settings page controls to signal that the settings page - * changed and page container may update their state. - * - * @param control The control which triggered the event or null - */ - public void onSettingsPageChanged(Control control); - } - - /** - * Create a page to be shown in a dialog or wizard to setup the connection. - * @param parent - */ - void createControl(Composite parent); - - /** - * Called before the page is shown. Loads the state from the {@link ITerminalConnector}. - */ - void loadSettings(); - - /** - * Called when the OK button is pressed. - */ - void saveSettings(); - - /** - * @return true if the - */ - boolean validateSettings(); - - /** - * Adds the given listener. - *

            - * Has not effect if the same listener is already registered. - * - * @param listener The listener. Must not be null. - */ - public void addListener(Listener listener); - - /** - * Removes the given listener. - *

            - * Has no effect if the same listener was not registered. - * - * @param listener The listener. Must not be null. - */ - public void removeListener(Listener listener); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java deleted file mode 100644 index b7dd8592922..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ISettingsStore.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -/** - * A simple interface to a store to persist the state of a connection. - * - * @author Michael Scharf - *

            - * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. - *

            - */ -public interface ISettingsStore { - /** - * @param key alpha numeric key, may contain dots (.) - * @return value - */ - String get(String key); - - /** - * @param key alpha numeric key, may contain dots (.) - * @param defaultValue - * @return the value or the default - */ - String get(String key, String defaultValue); - - /** - * Save a string value - * @param key alpha numeric key, may contain dots (.) - * @param value - */ - void put(String key, String value); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java deleted file mode 100644 index ae4ed505d37..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalConnector.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import java.io.OutputStream; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -/** - * A contributed connection type to manage a single connection. - * - * Implementations of this class are contributed through the - * org.eclipse.tm.terminal.terminalConnectors extension point. This - * class gives access to the static markup of a terminal connector extension as - * well as providing the lifecycle management for the dynamically loaded - * {@link TerminalConnectorImpl} instance, which performs the actual - * communications. This pattern allows for lazy initialization, bundle - * activation and class loading of the actual {@link TerminalConnectorImpl} - * instance. - * - * Clients can get terminal connector instances from the - * {@link TerminalConnectorExtension} class, or from - * {@link ITerminalViewControl#getTerminalConnector()} when running inside an - * active terminal widget. - * - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - * - * @author Michael Scharf - *

            - * EXPERIMENTAL. This class or interface has been added - * as part of a work in progress. There is no guarantee that this API - * will work or that it will remain the same. Please do not use this API - * without consulting with the Target Management team. - *

            - */ -public interface ITerminalConnector extends IAdaptable { - /** - * @return an ID of this connector. The id from the plugin.xml. - * @since org.eclipse.tm.terminal 2.0 - */ - String getId(); - - /** - * @return null the name (as specified in the plugin.xml) - * @since org.eclipse.tm.terminal 2.0 - */ - String getName(); - - /** - * @return True if the connector is not visible in user - * selections. - * @since org.eclipse.tm.terminal 3.0.1 - */ - boolean isHidden(); - - /** - * @return true if the {@link TerminalConnectorImpl} has been initialized. - * If there was an initialization error, {@link #getInitializationErrorMessage()} - * returns the error message. - * @since org.eclipse.tm.terminal 2.0 - */ - boolean isInitialized(); - - /** - * This method initializes the connector if it is not initialized! - * If the connector was initialized successfully, null is - * returned. Otherwise an error message describing the problem is returned. - * @return null or a localized error message. - * @since org.eclipse.tm.terminal 2.0 - */ - String getInitializationErrorMessage(); - - /** - * Connect using the current state of the settings. - * @param control Used to inform the UI about state changes and messages from the connection. - */ - void connect(ITerminalControl control); - - /** - * Disconnect if connected. Else do nothing. - */ - void disconnect(); - - /** - * @return true if a local echo is needed. - * TODO:Michael Scharf: this should be handed within the connection.... - */ - boolean isLocalEcho(); - - /** - * Notify the remote site that the size of the terminal has changed. - * @param newWidth - * @param newHeight - */ - void setTerminalSize(int newWidth, int newHeight); - - /** - * @return the terminal to remote stream (bytes written to this stream will - * be sent to the remote site). For the stream in the other direction (remote to - * terminal see {@link ITerminalControl#getRemoteToTerminalOutputStream()} - * @since org.eclipse.tm.terminal 2.0 - */ - OutputStream getTerminalToRemoteStream(); - - /** - * Load the state of this connection. Is typically called before - * {@link #connect(ITerminalControl)}. - * - * @param store a string based data store. Short keys like "foo" can be used to - * store the state of the connection. - */ - void load(ISettingsStore store); - - /** - * When the view or dialog containing the terminal is closed, - * the state of the connection is saved into the settings store store - * @param store - */ - void save(ISettingsStore store); - - /** - * FIXME should not have UI related stuff in ITerminalConnector, since - * connectors may be totally programmatic and UI-less. Better make the - * connector adapt to an interface that controls the UI aspect. - * - * @return a new page that can be used in a dialog to setup this connection. - * The dialog should persist its settings with the - * {@link #load(ISettings)} and {@link #save(ISettings)} - * methods. - */ - ISettingsPage makeSettingsPage(); - - /** - * @return A string that represents the settings of the connection. This representation - * may be shown in the status line of the terminal view. - */ - String getSettingsSummary(); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java deleted file mode 100644 index 372772cc0c6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use - * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend - * Anton Leherbauer (Wind River) - [433751] Add option to enable VT100 line wrapping mode - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; - -/** - * Represents the terminal view as seen by a terminal connection. - *

            - * EXPERIMENTAL. This class or interface has been added as part - * of a work in progress. There is no guarantee that this API will work or that - * it will remain the same. Please do not use this API without consulting with - * the Target Management team. - *

            - * - * @author Michael Scharf - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ITerminalControl { - - /** - * @return the current state of the connection - */ - TerminalState getState(); - - /** - * @param state - */ - void setState(TerminalState state); - - /** - * Setup the terminal control within the given parent composite. - * - * @param parent The parent composite. Must not be null. - */ - void setupTerminal(Composite parent); - - /** - * A shell to show dialogs. - * @return the shell in which the terminal is shown. - */ - Shell getShell(); - - /** - * Set the encoding that the Terminal uses to decode bytes from the - * Terminal-to-remote-Stream into Unicode Characters used in Java; or, to - * encode Characters typed by the user into bytes sent over the wire to the - * remote. - * - * By default, the local Platform Default Encoding is used. Also note that - * the encoding must not be applied in case the terminal stream is processed - * by some data transfer protocol which requires binary data. - * - * Validity of the encoding set here is not checked. Since some encodings do - * not cover the entire range of Unicode characters, it can happen that a - * particular Unicode String typed in by the user can not be encoded into a - * byte Stream with the encoding specified. and UnsupportedEncodingException - * will be thrown in this case at the time the String is about to be - * processed. - * - * The concrete encoding to use can either be specified manually by a user, - * by means of a dialog, or a connector can try to obtain it automatically - * from the remote side e.g. by evaluating an environment variable such as - * LANG on UNIX systems. - * - * @since org.eclipse.tm.terminal 2.0 - */ - void setEncoding(String encoding) throws UnsupportedEncodingException; - - /** - * Return the current encoding. That's interesting when the previous - * setEncoding() call failed and the fallback default encoding should be - * queried, such that e.g. a combobox with encodings to choose can be - * properly initialized. - * - * @return the current Encoding of the Terminal. - * @since org.eclipse.tm.terminal 2.0 - */ - String getEncoding(); - - /** - * Show a text in the terminal. If puts newlines at the beginning and the - * end. - * - * @param text TODO: Michael Scharf: Is this really needed? - */ - void displayTextInTerminal(String text); - - /** - * @return a stream used to write to the terminal. Any bytes written to this - * stream appear in the terminal or are interpreted by the emulator as - * control sequences. The stream in the opposite direction, terminal - * to remote is in {@link ITerminalConnector#getTerminalToRemoteStream()}. - */ - OutputStream getRemoteToTerminalOutputStream(); - - /** - * Set the title of the terminal view. - * @param title - */ - void setTerminalTitle(String title); - - /** - * Show an error message during connect. - * @param msg - * TODO: Michael Scharf: Should be replaced by a better error notification mechanism! - */ - void setMsg(String msg); - - /** - * Sets if or if not the terminal view control should try to reconnect - * the terminal connection if the user hits ENTER in a closed terminal. - *

            - * Reconnect on ENTER if terminal is closed is enabled by default. - * - * @param on True to enable the reconnect, false to disable it. - */ - void setConnectOnEnterIfClosed(boolean on); - - /** - * Returns if or if not the terminal view control should try to reconnect - * the terminal connection if the user hits ENTER in a closed terminal. - * - * @return True the reconnect is enabled, false if disabled. - */ - boolean isConnectOnEnterIfClosed(); - - /** - * Enables VT100 line wrapping mode (default is off). - * This corresponds to the VT100 'eat_newline_glitch' terminal capability. - * If enabled, writing to the rightmost column does not cause - * an immediate wrap to the next line. Instead the line wrap occurs on the - * next output character. - * - * @param enable whether to enable or disable VT100 line wrapping mode - */ - void setVT100LineWrapping(boolean enable); - - /** - * @return whether VT100 line wrapping mode is enabled - */ - boolean isVT100LineWrapping(); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java deleted file mode 100644 index 58eca4a55b6..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/LayeredSettingsStore.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -/** - * Uses an array of {@link ISettingsStore} to find a value. - *

            - * EXPERIMENTAL. This class or interface has been added as part - * of a work in progress. There is no guarantee that this API will work or that - * it will remain the same. Please do not use this API without consulting with - * the Target Management team. - *

            - */ -public class LayeredSettingsStore implements ISettingsStore { - - private final ISettingsStore[] fStores; - - /** - * @param stores the stores used to search the values. - * {@link #put(String, String)} will put the value in the - * first store in the list. - */ - public LayeredSettingsStore(ISettingsStore[] stores) { - fStores=stores; - } - /** - * Convince constructor for two stores - * @param s1 first store - * @param s2 second store - */ - public LayeredSettingsStore(ISettingsStore s1, ISettingsStore s2) { - this(new ISettingsStore[]{s1,s2}); - } - public String get(String key) { - for (int i = 0; i < fStores.length; i++) { - String value=fStores[i].get(key); - if(value!=null) - return value; - } - return null; - } - - public String get(String key, String defaultValue) { - String value=get(key); - if ((value == null) || (value.equals(""))) //$NON-NLS-1$ - return defaultValue; - return value; - } - - public void put(String key, String value) { - fStores[0].put(key,value); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java deleted file mode 100644 index e465587f72a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/Logger.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Fran Litterio (Wind River) - initial API and implementation - * Ted Williams (Wind River) - refactored 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.internal.terminal.provisional.api; - -import java.io.FileOutputStream; -import java.io.PrintStream; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin; - -/** - * A simple logger class. Every method in this class is static, so they can be - * called from both class and instance methods. To use this class, write code - * like this: - *

            - * - *

            - * Logger.log("something has happened");
            - * Logger.log("counter is " + counter);
            - * 
            - * - * @author Fran Litterio - *

            - * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. - *

            - */ -public final class Logger { - public static final String TRACE_DEBUG_LOG = "org.eclipse.tm.terminal/debug/log"; //$NON-NLS-1$ - public static final String TRACE_DEBUG_LOG_CHAR = "org.eclipse.tm.terminal/debug/log/char"; //$NON-NLS-1$ - public static final String TRACE_DEBUG_LOG_VT100BACKEND = "org.eclipse.tm.terminal/debug/log/VT100Backend"; //$NON-NLS-1$ - - private static PrintStream logStream; - - static { - // Any of the three known debugging options turns on the creation of the log file - boolean createLogFile = TerminalPlugin.isOptionEnabled(TRACE_DEBUG_LOG) - || TerminalPlugin.isOptionEnabled(TRACE_DEBUG_LOG_CHAR) - || TerminalPlugin.isOptionEnabled(TRACE_DEBUG_LOG_VT100BACKEND); - - // Log only if tracing is enabled - if (createLogFile && TerminalPlugin.getDefault() != null) { - IPath logFile = Platform.getStateLocation(TerminalPlugin.getDefault().getBundle()); - if (logFile != null && logFile.toFile().isDirectory()) { - logFile = logFile.append("tmterminal.log"); //$NON-NLS-1$ - try { - logStream = new PrintStream(new FileOutputStream(logFile.toFile(), true)); - } catch (Exception ex) { - logStream = System.err; - logStream.println("Exception when opening log file -- logging to stderr!"); //$NON-NLS-1$ - ex.printStackTrace(logStream); - } - } - } - } - - /** - * Encodes a String such that non-printable control characters are - * converted into user-readable escape sequences for logging. - * @param message String to encode - * @return encoded String - */ - public static final String encode(String message) { - boolean encoded = false; - StringBuffer buf = new StringBuffer(message.length()+32); - for (int i=0; i=' ' && c<'\u007f') { - buf.append(c); - } else if (c <= '\u00ff') { - buf.append('\\'); buf.append('x'); - buf.append(Integer.toHexString(c)); - encoded=true; - } else { - buf.append('\\'); buf.append('u'); - if (c<='\u0fff') { - buf.append('0'); - } - buf.append(Integer.toHexString(c)); - encoded=true; - } - } - } - if (encoded) { - return buf.toString(); - } - return message; - } - - /** - * Checks if logging is enabled. - * @return true if logging is enabled. - */ - public static final boolean isLogEnabled() { - return (logStream!=null); - } - - /** - * Logs the specified message. Do not append a newline to parameter - * message. This method does that for you. - * - * @param message A String containing the message to log. - */ - public static final void log(String message) { - if (logStream != null) { - // Read my own stack to get the class name, method name, and line - // number of - // where this method was called. - - StackTraceElement caller = new Throwable().getStackTrace()[1]; - int lineNumber = caller.getLineNumber(); - String className = caller.getClassName(); - String methodName = caller.getMethodName(); - className = className.substring(className.lastIndexOf('.') + 1); - - logStream.println(className + "." + methodName + ":" + lineNumber + ": " + message); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ - logStream.flush(); - } - } - - /** - * Writes a stack trace for an exception to both Standard Error and to the - * log file. - */ - public static final void logException(Exception ex) { - // log in eclipse error log - if (TerminalPlugin.getDefault() != null) { - TerminalPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TerminalPlugin.PLUGIN_ID, IStatus.OK, ex.getMessage(), ex)); - } else { - ex.printStackTrace(); - } - // Additional Tracing for debug purposes: - // Read my own stack to get the class name, method name, and line number - // of where this method was called - if(logStream!=null) { - StackTraceElement caller = new Throwable().getStackTrace()[1]; - int lineNumber = caller.getLineNumber(); - String className = caller.getClassName(); - String methodName = caller.getMethodName(); - className = className.substring(className.lastIndexOf('.') + 1); - - PrintStream tmpStream = System.err; - - if (logStream != null) { - tmpStream = logStream; - } - - tmpStream.println(className - + "." + methodName + ":" + lineNumber + ": " + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - "Caught exception: " + ex); //$NON-NLS-1$ - ex.printStackTrace(tmpStream); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java deleted file mode 100644 index 0d5daba6b0b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/PreferenceSettingStore.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import org.eclipse.core.runtime.Preferences; - -/** - * A preference based settings store. - *

            - * EXPERIMENTAL. This class or interface has been added as part - * of a work in progress. There is no guarantee that this API will work or that - * it will remain the same. Please do not use this API without consulting with - * the Target Management team. - *

            - */ -public class PreferenceSettingStore implements ISettingsStore { - private final String fPrefix; - private final Preferences fPreferences; - - /** - * Creates a ISettingStore that uses the preferences as backend. - * - * @param preferences the backed. - * @param prefix a string that is prepended to the key - */ - public PreferenceSettingStore(Preferences preferences, String prefix) { - fPreferences=preferences; - fPrefix=prefix; - } - public String get(String key) { - return fPreferences.getString(makeKey(key)); - } - public String get(String key, String defaultValue) { - String value=get(key); - if ((value == null) || (value.equals(""))) //$NON-NLS-1$ - return defaultValue; - - return value; - } - - public void put(String key, String value) { - fPreferences.setValue(makeKey(key), value); - } - /** - * @param key - * @return the full path in the preferences - */ - private String makeKey(String key) { - return fPrefix+key; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalConnectorExtension.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalConnectorExtension.java deleted file mode 100644 index 8ad6db4b0ae..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalConnectorExtension.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.RegistryFactory; -import org.eclipse.tm.internal.terminal.connector.TerminalConnector; -import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl; - -/** - * A factory to get {@link ITerminalConnector} instances. - * - * @author Michael Scharf - * - * @noextend This class is not intended to be subclassed by clients. - * @noinstantiate This class is not intended to be instantiated by clients. - * - *

            - * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will work or - * that it will remain the same. Please do not use this API without consulting - * with the Target Management - * team. - *

            - */ -public class TerminalConnectorExtension { - static private ITerminalConnector makeConnector(final IConfigurationElement config) { - String id = config.getAttribute("id"); //$NON-NLS-1$ - if(id==null || id.length()==0) - id=config.getAttribute("class"); //$NON-NLS-1$ - String name= config.getAttribute("name"); //$NON-NLS-1$ - if(name==null || name.length()==0) { - name=id; - } - String hidden = config.getAttribute("hidden"); //$NON-NLS-1$ - boolean isHidden = hidden != null ? new Boolean(hidden).booleanValue() : false; - TerminalConnector.Factory factory=new TerminalConnector.Factory(){ - public TerminalConnectorImpl makeConnector() throws Exception { - return (TerminalConnectorImpl)config.createExecutableExtension("class"); //$NON-NLS-1$ - }}; - return new TerminalConnector(factory,id,name, isHidden); - } - - /** - * Return a specific terminal connector for a given connector id. The - * terminal connector is not yet instantiated to any real connection. - * - * @param id the id of the terminal connector in the - * org.eclipse.tm.terminal.terminalConnectors - * extension point - * @return a new ITerminalConnector with id or null if there - * is no extension with that id. - * @since org.eclipse.tm.terminal 2.0 - */ - public static ITerminalConnector makeTerminalConnector(String id) { - IConfigurationElement[] config = RegistryFactory.getRegistry().getConfigurationElementsFor("org.eclipse.tm.terminal.terminalConnectors"); //$NON-NLS-1$ - for (int i = 0; i < config.length; i++) { - if(id.equals(config[i].getAttribute("id"))) { //$NON-NLS-1$ - return makeConnector(config[i]); - } - } - return null; - } - /** - * Return a list of available terminal connectors (connection types). - * - * The terminal connectors returned are not yet instantiated to any real - * connection. Each terminal connector can connect to one remote system at a - * time. - * - * @return a new list of {@link ITerminalConnector} instances defined in the - * org.eclipse.tm.terminal.terminalConnectors - * extension point - * @since org.eclipse.tm.terminal 2.0 return value is ITerminalConnector[] - */ - public static ITerminalConnector[] makeTerminalConnectors() { - IConfigurationElement[] config = RegistryFactory.getRegistry().getConfigurationElementsFor("org.eclipse.tm.terminal.terminalConnectors"); //$NON-NLS-1$ - List result=new ArrayList(); - for (int i = 0; i < config.length; i++) { - result.add(makeConnector(config[i])); - } - return (ITerminalConnector[]) result.toArray(new ITerminalConnector[result.size()]); - } - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalState.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalState.java deleted file mode 100644 index 179267081f3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/TerminalState.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - fixed copyright headers and beautified - * Michael Scharf (Wind River) - [262996] get rid of TerminalState.OPENED - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api; - -/** - * Represent the sate of a terminal connection. - * In java 1.5 this would be an enum. - * @author Michael Scharf - * - *

            - * EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. - *

            - */ -public class TerminalState { - /** - * The terminal is not connected. - */ - public final static TerminalState CLOSED=new TerminalState("CLOSED"); //$NON-NLS-1$ - - /** - * The terminal is about to connect. - */ - public final static TerminalState CONNECTING=new TerminalState("CONNECTING..."); //$NON-NLS-1$ - - /** - * The terminal is connected. - */ - public final static TerminalState CONNECTED=new TerminalState("CONNECTED"); //$NON-NLS-1$ - - private final String fState; - - public TerminalState(String state) { - fState = state; - } - - public String toString() { - return fState; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java deleted file mode 100644 index 779a081693a..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/provider/TerminalConnectorImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.provisional.api.provider; - -import java.io.OutputStream; - -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage; -import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; -import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; -import org.eclipse.tm.internal.terminal.provisional.api.Logger; -import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; - -/** - * Abstract base class for all terminal connector implementations to be - * registered via the org.eclipse.tm.terminal.terminalConnectors - * extension point. - * - * @since org.eclipse.tm.terminal 2.0 - */ -public abstract class TerminalConnectorImpl { - - /** - * The TerminalControl associated with this connector. - * Required for advertising state changes when needed. - */ - protected ITerminalControl fControl; - - /** - * Initialize this connector. This is called once after the constructor, in - * order to perform any required initializations such as loading required - * native libraries. Any work that may lead to runtime exceptions should be - * done in this method rather than in the constructor. - * - * @throws Exception when the connector fails to initialize (due to missing - * required libraries, for instance). - */ - public void initialize() throws Exception { - } - - /** - * Connect using the current state of the settings. - * - * This method is designed to be overridden by actual implementations, in - * order to open the streams required for communicating with the remote - * side. Extenders must call super.connect(control) as the - * first thing they are doing. - * - * @param control Used to inform the UI about state changes and messages - * from the connection. - */ - public void connect(ITerminalControl control) { - Logger.log("entered."); //$NON-NLS-1$ - fControl = control; - } - - /** - * Disconnect if connected. Else do nothing. Has to set the state of the - * {@link ITerminalControl} when finished disconnecting. - */ - public final void disconnect() { - Logger.log("entered."); //$NON-NLS-1$ - doDisconnect(); - fControl.setState(TerminalState.CLOSED); - } - - /** - * Disconnect if connected. Else do nothing. Clients should override to - * perform any extra work needed for disconnecting. - */ - protected void doDisconnect() { - // Do nothing by default - } - - /** - * @return the terminal to remote stream (bytes written to this stream will - * be sent to the remote site). For the stream in the other direction (remote to - * terminal see {@link ITerminalControl#getRemoteToTerminalOutputStream()} - */ - abstract public OutputStream getTerminalToRemoteStream(); - - /** - * @return A string that represents the settings of the connection. This representation - * may be shown in the status line of the terminal view. - */ - abstract public String getSettingsSummary(); - - /** - * Test if local echo is needed. The default implementation returns - * false. Override to modify this behavior. - * - * @return true if a local echo is needed. TODO:Michael Scharf: this should - * be handed within the connection.... - */ - public boolean isLocalEcho() { - return false; - } - - /** - * Return a settings page for configuring this connector, or - * null if it cannot be configured. - * - * The dialog should persist its settings with the - * {@link #load(ISettings)} and {@link #save(ISettings)} methods. - * - * @return a new page that can be used in a dialog to setup this connection, - * or null. - */ - public ISettingsPage makeSettingsPage() { - return null; - } - - /** - * Load the state or settings of this connection. Is typically called before - * {@link #connect(ITerminalControl)}. - * - * Connectors that have nothing to configure do not need to implement this. - * Those terminals that do have configuration (which they expose via - * {@link #makeSettingsPage()} need to override this method to load - * settings. - * - * @param store a string based data store. Short keys like "foo" can be used - * to store the state of the connection. - */ - public void load(ISettingsStore store) { - // do nothing by default - } - - /** - * When the view or dialog containing the terminal is closed, the state of - * the connection is saved into the settings store store. - * - * Connectors that have no state or settings to persist do not need to - * override this. Others should override to persist their settings. - * - * @param store the store for persisting settings. - */ - public void save(ISettingsStore store) { - // do nothing by default - } - - /** - * Notify the remote site that the size of the terminal has changed. - * - * Concrete connectors should override this if they have the possibility to - * inform the remote about changed terminal size. - * - * @param newWidth the new width in characters. - * @param newHeight the new height in characters. - */ - public void setTerminalSize(int newWidth, int newHeight) { - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java deleted file mode 100644 index 8306f92d9b4..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java +++ /dev/null @@ -1,348 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1 - * Anton Leherbauer (Wind River) - [219589] Copy an entire line selection - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.swt.graphics.Point; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; - -abstract public class AbstractTextCanvasModel implements ITextCanvasModel { - protected List fListeners = new ArrayList(); - private int fCursorLine; - private int fCursorColumn; - private boolean fShowCursor; - private long fCursorTime; - private boolean fCursorIsEnabled; - private final ITerminalTextDataSnapshot fSnapshot; - private int fLines; - - private int fSelectionStartLine=-1; - private int fSeletionEndLine; - private int fSelectionStartCoumn; - private int fSelectionEndColumn; - private ITerminalTextDataSnapshot fSelectionSnapshot; - private String fCurrentSelection=""; //$NON-NLS-1$ - private final Point fSelectionAnchor=new Point(0,0); - /** - * do not update while update is running - */ - boolean fInUpdate; - private int fCols; - - public AbstractTextCanvasModel(ITerminalTextDataSnapshot snapshot) { - fSnapshot=snapshot; - fLines=fSnapshot.getHeight(); - } - public void addCellCanvasModelListener(ITextCanvasModelListener listener) { - fListeners.add(listener); - } - - public void removeCellCanvasModelListener(ITextCanvasModelListener listener) { - fListeners.remove(listener); - } - - protected void fireCellRangeChanged(int x, int y, int width, int height) { - for (Iterator iter = fListeners.iterator(); iter.hasNext();) { - ITextCanvasModelListener listener = (ITextCanvasModelListener) iter.next(); - listener.rangeChanged(x, y, width, height); - } - } - protected void fireDimensionsChanged( int width,int height) { - for (Iterator iter = fListeners.iterator(); iter.hasNext();) { - ITextCanvasModelListener listener = (ITextCanvasModelListener) iter.next(); - listener.dimensionsChanged(width,height); - } - - } - protected void fireTerminalDataChanged() { - for (Iterator iter = fListeners.iterator(); iter.hasNext();) { - ITextCanvasModelListener listener = (ITextCanvasModelListener) iter.next(); - listener.terminalDataChanged(); - } - - } - - public ITerminalTextDataReadOnly getTerminalText() { - return fSnapshot; - } - protected ITerminalTextDataSnapshot getSnapshot() { - return fSnapshot; - } - protected void updateSnapshot() { - if(!fInUpdate && fSnapshot.isOutOfDate()) { - fInUpdate=true; - try { - fSnapshot.updateSnapshot(false); - if(fSnapshot.hasTerminalChanged()) - fireTerminalDataChanged(); - // TODO why does hasDimensionsChanged not work?????? - // if(fSnapshot.hasDimensionsChanged()) - // fireDimensionsChanged(); - if(fLines!=fSnapshot.getHeight() || fCols!=fSnapshot.getWidth()) { - fireDimensionsChanged(fSnapshot.getWidth(),fSnapshot.getHeight()); - fLines=fSnapshot.getHeight(); - fCols=fSnapshot.getWidth(); - } - int y=fSnapshot.getFirstChangedLine(); - // has any line changed? - if(y=getSnapshot().getHeight()) { - cursorLine=getSnapshot().getHeight()-1; - cursorColumn=getSnapshot().getWidth()-1; - } - // has the cursor moved? - if(fCursorLine!=cursorLine || fCursorColumn!=cursorColumn) { - // hide the old cursor! - fShowCursor=false; - // clean the previous cursor - // bug 206363: paint also the char to the left and right of the cursor - see also below - int col=fCursorColumn; - int width=2; - if(col>0) { - col--; - width++; - } - fireCellRangeChanged(col, fCursorLine, width, 1); - // the cursor is shown when it moves! - fShowCursor=true; - fCursorTime=System.currentTimeMillis(); - fCursorLine=cursorLine; - fCursorColumn=cursorColumn; - // and draw the new cursor - fireCellRangeChanged(fCursorColumn, fCursorLine, 1, 1); - } else { - long t=System.currentTimeMillis(); - // TODO make the cursor blink time customisable - if(t-fCursorTime>500) { - fShowCursor=!fShowCursor; - fCursorTime=t; - // on some windows machines, there is some left - // over when updating the cursor . - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=206363 - int col=fCursorColumn; - int width=2; - if(col>0) { - col--; - width++; - } - fireCellRangeChanged(col, fCursorLine, width, 1); - } - } - } - public void setVisibleRectangle(int startLine, int startCol, int height, int width) { - fSnapshot.setInterestWindow(Math.max(0,startLine), Math.max(1,height)); - update(); - } - protected void showCursor(boolean show) { - fShowCursor=true; - } - public void setCursorEnabled(boolean visible) { - fCursorTime=System.currentTimeMillis(); - fShowCursor=visible; - fCursorIsEnabled=visible; - fireCellRangeChanged(fCursorColumn, fCursorLine, 1, 1); - } - public boolean isCursorEnabled() { - return fCursorIsEnabled; - } - - public Point getSelectionEnd() { - if(fSelectionStartLine<0) - return null; - else - return new Point(fSelectionEndColumn, fSeletionEndLine); - } - - public Point getSelectionStart() { - if (fSelectionStartLine < 0) - return null; - else - return new Point(fSelectionStartCoumn,fSelectionStartLine); - } - public Point getSelectionAnchor() { - if(fSelectionStartLine<0) - return null; - return new Point(fSelectionAnchor.x,fSelectionAnchor.y); - } - public void setSelectionAnchor(Point anchor) { - fSelectionAnchor.x=anchor.x; - fSelectionAnchor.y=anchor.y; - } - - public void setSelection(int startLine, int endLine, int startColumn, int endColumn) { -// System.err.println(startLine+","+endLine+","+startColumn+","+endColumn); - doSetSelection(startLine, endLine, startColumn, endColumn); - fCurrentSelection=extractSelectedText(); - } - private void doSetSelection(int startLine, int endLine, int startColumn, int endColumn) { - assert(startLine<0 || startLine<=endLine); - if(startLine>=0) { - if(fSelectionSnapshot==null) { - fSelectionSnapshot=fSnapshot.getTerminalTextData().makeSnapshot(); - fSelectionSnapshot.updateSnapshot(true); - } - } else if(fSelectionSnapshot!=null) { - fSelectionSnapshot.detach(); - fSelectionSnapshot=null; - } - int oldStart=fSelectionStartLine; - int oldEnd=fSeletionEndLine; - fSelectionStartLine = startLine; - fSeletionEndLine = endLine; - fSelectionStartCoumn = startColumn; - fSelectionEndColumn = endColumn; - if(fSelectionSnapshot!=null) { - fSelectionSnapshot.setInterestWindow(0, fSelectionSnapshot.getHeight()); - } - int changedStart; - int changedEnd; - if(oldStart<0) { - changedStart=fSelectionStartLine; - changedEnd=fSeletionEndLine; - } else if(fSelectionStartLine<0) { - changedStart=oldStart; - changedEnd=oldEnd; - } else { - changedStart=Math.min(oldStart, fSelectionStartLine); - changedEnd=Math.max(oldEnd, fSeletionEndLine); - } - if(changedStart>=0) { - fireCellRangeChanged(0, changedStart, fSnapshot.getWidth(), changedEnd-changedStart+1); - } - } - - public boolean hasLineSelection(int line) { - if (fSelectionStartLine < 0) - return false; - else - return line >= fSelectionStartLine && line <= fSeletionEndLine; - } - - public String getSelectedText() { - return fCurrentSelection; - } - /** - * Calculates the currently selected text - * @return the currently selected text - */ - private String extractSelectedText() { - if(fSelectionStartLine<0 || fSelectionStartCoumn<0 || fSelectionSnapshot==null) - return ""; //$NON-NLS-1$ - StringBuffer buffer=new StringBuffer(); - for (int line = fSelectionStartLine; line <= fSeletionEndLine; line++) { - String text; - char[] chars=fSelectionSnapshot.getChars(line); - if(chars!=null) { - text=new String(chars); - if(line==fSeletionEndLine && fSelectionEndColumn >= 0) - text=text.substring(0, Math.min(fSelectionEndColumn+1,text.length())); - if(line==fSelectionStartLine) - text=text.substring(Math.min(fSelectionStartCoumn,text.length())); - // get rid of the empty space at the end of the lines - // text=text.replaceAll("\000+$",""); //$NON-NLS-1$//$NON-NLS-2$ - // - int i = text.length() - 1; - while (i >= 0 && text.charAt(i) == '\000') { - i--; - } - text = text.substring(0, i + 1); - // - // null means space - text=text.replace('\000', ' '); - } else { - text=""; //$NON-NLS-1$ - } - buffer.append(text); - if(line < fSeletionEndLine && !fSelectionSnapshot.isWrappedLine(line)) - buffer.append('\n'); - } - return buffer.toString(); - } - private void updateSelection() { - if (fSelectionSnapshot != null && fSelectionSnapshot.isOutOfDate()) { - fSelectionSnapshot.updateSnapshot(true); - // has the selection moved? - if (fSelectionSnapshot != null && fSelectionStartLine >= 0 && fSelectionSnapshot.getScrollWindowSize() > 0) { - int start = fSelectionStartLine + fSelectionSnapshot.getScrollWindowShift(); - int end = fSeletionEndLine + fSelectionSnapshot.getScrollWindowShift(); - if (start < 0) - if (end >= 0) - start = 0; - else - start = -1; - doSetSelection(start, end, fSelectionStartCoumn, fSelectionEndColumn); - } - // check if the content of the selection has changed. If the content has - // changed, clear the selection - if (fCurrentSelection.length()>0 && fSelectionSnapshot != null - && fSelectionSnapshot.getFirstChangedLine() <= fSeletionEndLine - && fSelectionSnapshot.getLastChangedLine() >= fSelectionStartLine) { - // has the selected text changed? - if (!fCurrentSelection.equals(extractSelectedText())) { - setSelection(-1, -1, -1, -1); - } - } - // update the observed window... - if (fSelectionSnapshot != null) - // todo make -1 to work! - fSelectionSnapshot.setInterestWindow(0, fSelectionSnapshot.getHeight()); - } - } - -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/GridCanvas.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/GridCanvas.java deleted file mode 100644 index 7995087fa1d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/GridCanvas.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [294468] Fix scroller and text line rendering - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.ScrollBar; - -/** - * A Grid based Canvas. The canvas has rows and columns. - * CellPainting is done with the abstract method drawCell - */ -abstract public class GridCanvas extends VirtualCanvas { - /** width of a cell */ - private int fCellWidth; - /** height of a cell */ - private int fCellHeight; - - public GridCanvas(Composite parent, int style) { - super(parent, style); - addListener(SWT.MouseWheel, new Listener() { - public void handleEvent(Event event) { - if(getVerticalBar().isVisible()) { - int delta=-fCellHeight; - if(event.count<0) - delta=-delta; - scrollYDelta(delta); - } - event.doit=false; - } - }); - - } - - /** template method paint. - * iterates over all cells in the clipping rectangle and paints them. - */ - protected void paint(GC gc) { - Rectangle clipping=gc.getClipping(); - if(clipping.width==0 || clipping.height==0) - return; - Rectangle clientArea= getScreenRectInVirtualSpace(); - // Beginning coordinates - int xOffset=clientArea.x; - int yOffset=clientArea.y; - int colFirst=virtualXToCell(xOffset+clipping.x); - if(colFirst>getCols()) - colFirst=getCols(); - else if (colFirst < 0) { - colFirst = 0; - } - int rowFirst=virtualYToCell(yOffset+clipping.y); - // End coordinates - int colLast=virtualXToCell(xOffset+clipping.x+clipping.width+fCellWidth); - if(colLast>getCols()) - colLast=getCols(); - int rowLast=virtualYToCell(yOffset+clipping.y+clipping.height+fCellHeight); - if(rowLast>getRows()) - rowLast=getRows(); - // System.out.println(rowFirst+"->"+rowLast+" "+System.currentTimeMillis()); - // draw the cells - for(int row=rowFirst;row<=rowLast;row++) { - int cx=colFirst*fCellWidth-xOffset; - int cy=row*fCellHeight-yOffset; - drawLine(gc,row,cx,cy,colFirst,colLast); - } - paintUnoccupiedSpace(gc,clipping); - } - /** - * @param gc - * @param row the line to draw - * @param x coordinate on screen - * @param y coordinate on screen - * @param colFirst first column to draw - * @param colLast last column to draw - */ - abstract void drawLine(GC gc, int row, int x, int y, int colFirst, int colLast); - - abstract protected int getRows(); - abstract protected int getCols(); - - protected void setCellWidth(int cellWidth) { - fCellWidth = cellWidth; - getHorizontalBar().setIncrement(fCellWidth); - } - - public int getCellWidth() { - return fCellWidth; - } - - protected void setCellHeight(int cellHeight) { - fCellHeight = cellHeight; - getVerticalBar().setIncrement(fCellHeight); - } - - public int getCellHeight() { - return fCellHeight; - } - - int virtualXToCell(int x) { - return x/fCellWidth; - } - - int virtualYToCell(int y) { - return y/fCellHeight; - } - - protected Point screenPointToCell(int x, int y) { - x=screenXtoVirtual(x)/fCellWidth; - y=screenYtoVirtual(y)/fCellHeight; - return new Point(x,y); - } - - Point screenPointToCell(Point point) { - return screenPointToCell(point.x,point.y); - } - - protected Point cellToOriginOnScreen(int x, int y) { - x=virtualXtoScreen(fCellWidth*x); - y=virtualYtoScreen(fCellHeight*y); - return new Point(x,y); - } - - Point cellToOriginOnScreen(Point cell) { - return cellToOriginOnScreen(cell.x,cell.y); - } - - Rectangle getCellScreenRect(Point cell) { - return getCellScreenRect(cell.x,cell.y); - } - - Rectangle getCellScreenRect(int x, int y) { - x=fCellWidth*virtualXtoScreen(x); - y=fCellHeight*virtualYtoScreen(y); - return new Rectangle(x,y,fCellWidth,fCellHeight); - } - - protected Rectangle getCellVirtualRect(Point cell) { - return getCellVirtualRect(cell.x,cell.y); - } - - Rectangle getCellVirtualRect(int x, int y) { - x=fCellWidth*x; - y=fCellHeight*y; - return new Rectangle(x,y,fCellWidth,fCellHeight); - } - protected void viewRectangleChanged(int x, int y, int width, int height) { - int cellX=virtualXToCell(x); - int cellY=virtualYToCell(y); - // End coordinates - int xE=virtualXToCell(x+width); -// if(xE>getCols()) -// xE=getCols(); - int yE=virtualYToCell(y+height); -// if(yE>getRows()) -// yE=getRows(); - visibleCellRectangleChanged(cellX,cellY,xE-cellX,yE-cellY); - } - - /** - * Called when the viewed part has changed. - * Override when you need this information.... - * Is only called if the values change (well, almost) - * @param x origin of visible cells - * @param y origin of visible cells - * @param width number of cells visible in x direction - * @param height number of cells visible in y direction - */ - protected void visibleCellRectangleChanged(int x, int y, int width, int height) { - } - - protected void setVirtualExtend(int width, int height) { - int cellHeight = getCellHeight(); - if (cellHeight > 0) { - height -= height % cellHeight; - } - super.setVirtualExtend(width, height); - } - - protected void setVirtualOrigin(int x, int y) { - int cellHeight = getCellHeight(); - if (cellHeight > 0) { - int remainder = y % cellHeight; - if (remainder < 0) { - y -= (cellHeight + remainder); - } else { - y -= remainder; - } - } - super.setVirtualOrigin(x, y); - } - - protected void scrollY(ScrollBar vBar) { - int vSelection = vBar.getSelection (); - Rectangle bounds = getVirtualBounds(); - int y = -vSelection; - int cellHeight = getCellHeight(); - if (cellHeight > 0) { - int remainder = y % cellHeight; - if (remainder < 0) { - y -= (cellHeight + remainder); - } else { - y -= remainder; - } - } - int deltaY = y - bounds.y; - if(deltaY!=0) { - scrollSmart(0,deltaY); - setVirtualOrigin(bounds.x, bounds.y += deltaY); - } - if (-bounds.y + getRows() * getCellHeight() >= bounds.height) { - // scrolled to bottom - need to redraw bottom area - Rectangle clientRect = getClientArea(); - redraw(0, clientRect.height - fCellHeight, clientRect.width, fCellHeight, false); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ILinelRenderer.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ILinelRenderer.java deleted file mode 100644 index bb81848555b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ILinelRenderer.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [294468] Fix scroller and text line rendering - * Martin Oberhuber (Wind River) - [265352][api] Allow setting fonts programmatically - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; - -/** - * - */ -public interface ILinelRenderer { - int getCellWidth(); - int getCellHeight(); - void drawLine(ITextCanvasModel model, GC gc, int line, int x, int y, int colFirst, int colLast); - /** - * Update for a font change from the global JFace Registry. - */ - void onFontChange(); - /** - * Set a new font - * @param fontName Jface name of the new font - * @since 3.2 - */ - void updateFont(String fontName); - void setInvertedColors(boolean invert); - Color getDefaultBackgroundColor(); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModel.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModel.java deleted file mode 100644 index 4d843b461c3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModel.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import org.eclipse.swt.graphics.Point; -import org.eclipse.tm.terminal.model.ITerminalTextDataReadOnly; - -public interface ITextCanvasModel { - void addCellCanvasModelListener(ITextCanvasModelListener listener); - void removeCellCanvasModelListener(ITextCanvasModelListener listener); - - ITerminalTextDataReadOnly getTerminalText(); - /** - * This is is - * @param startLine - * @param startCol - * @param height - * @param width - */ - void setVisibleRectangle(int startLine, int startCol, int height, int width); - - /** - * @return true when the cursor is shown (used for blinking cursors) - */ - boolean isCursorOn(); - /** - * Show/Hide the cursor. - * @param visible - */ - void setCursorEnabled(boolean visible); - - /** - * @return true if the cursor is shown. - */ - boolean isCursorEnabled(); - - /** - * @return the line of the cursor - */ - int getCursorLine(); - /** - * @return the column of the cursor - */ - int getCursorColumn(); - - /** - * @return the start of the selection or null if nothing is selected - * {@link Point#x} is the column and {@link Point#y} is the line. - */ - Point getSelectionStart(); - /** - * @return the end of the selection or null if nothing is selected - * {@link Point#x} is the column and {@link Point#y} is the line. - */ - Point getSelectionEnd(); - - Point getSelectionAnchor(); - - void setSelectionAnchor(Point anchor); - /** - * Sets the selection. A negative startLine clears the selection. - * @param startLine - * @param endLine - * @param startColumn - * @param endColumn - */ - void setSelection(int startLine, int endLine, int startColumn, int endColumn); - - /** - * @param line - * @return true if line is part of the selection - */ - boolean hasLineSelection(int line); - - String getSelectedText(); -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModelListener.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModelListener.java deleted file mode 100644 index 5b498874e35..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/ITextCanvasModelListener.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -/** - */ -public interface ITextCanvasModelListener { - void rangeChanged(int col, int line, int width, int height); - void dimensionsChanged(int cols, int rows); - /** - * Called when any text change happened. Used to scroll to the - * end of text in auto scroll mode. This does not get fired - * when the window of interest has changed! - */ - void terminalDataChanged(); -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStream.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStream.java deleted file mode 100644 index f0e11324a2d..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PipedInputStream.java +++ /dev/null @@ -1,312 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1996, 2011 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Douglas Lea (Addison Wesley) - [cq:1552] BoundedBufferWithStateTracking adapted to BoundedByteBuffer - * Martin Oberhuber (Wind River) - the waitForAvailable method - * Martin Oberhuber (Wind River) - [208166] Avoid unnecessary arraycopy in BoundedByteBuffer - * Pawel Piech (Wind River) - [333613] "Job found still running" after shutdown - *******************************************************************************/ - -package org.eclipse.tm.internal.terminal.textcanvas; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * The main purpose of this class is to start a runnable in the - * display thread when data is available and to pretend no data - * is available after a given amount of time the runnable is running. - * - */ -public class PipedInputStream extends InputStream { - /** - * The output stream used by the terminal backend to write to the terminal - */ - protected final OutputStream fOutputStream; - /** - * A blocking byte queue. - */ - private final BoundedByteBuffer fQueue; - - /** - * A byte bounded buffer used to synchronize the input and the output stream. - *

            - * Adapted from BoundedBufferWithStateTracking - * http://gee.cs.oswego.edu/dl/cpj/allcode.java - * http://gee.cs.oswego.edu/dl/cpj/ - *

            - * BoundedBufferWithStateTracking is part of the examples for the book - * Concurrent Programming in Java: Design Principles and Patterns by - * Doug Lea (ISBN 0-201-31009-0). Second edition published by - * Addison-Wesley, November 1999. The code is - * Copyright(c) Douglas Lea 1996, 1999 and released to the public domain - * and may be used for any purposes whatsoever. - *

            - * For some reasons a solution based on - * PipedOutputStream/PipedIntputStream - * does work *very* slowly: - * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4404700 - *

            - * - */ - private class BoundedByteBuffer { - protected final byte[] fBuffer; // the elements - protected int fPutPos = 0; // circular indices - protected int fTakePos = 0; - protected int fUsedSlots = 0; // the count - private boolean fClosed; - public BoundedByteBuffer(int capacity) throws IllegalArgumentException { - // make sure we don't deadlock on too small capacity - if (capacity <= 0) - throw new IllegalArgumentException(); - fBuffer = new byte[capacity]; - } - /** - * @return the bytes available for {@link #read()} - * Must be called with a lock on this! - */ - public int available() { - return fUsedSlots; - } - /** - * Writes a single byte to the buffer. Blocks if the buffer is full. - * @param b byte to write to the buffer - * @throws InterruptedException when the thread is interrupted while waiting - * for the buffer to become ready - * Must be called with a lock on this! - */ - public void write(byte b) throws InterruptedException { - while (fUsedSlots == fBuffer.length) - // wait until not full - wait(); - - fBuffer[fPutPos] = b; - fPutPos = (fPutPos + 1) % fBuffer.length; // cyclically increment - - if (fUsedSlots++ == 0) // signal if was empty - notifyAll(); - } - public int getFreeSlots() { - return fBuffer.length - fUsedSlots; - } - public void write(byte[] b, int off, int len) throws InterruptedException { - assert len<=getFreeSlots(); - while (fUsedSlots == fBuffer.length) - // wait until not full - wait(); - int n = Math.min(len, fBuffer.length - fPutPos); - System.arraycopy(b, off, fBuffer, fPutPos, n); - if (fPutPos + len > fBuffer.length) - System.arraycopy(b, off + n, fBuffer, 0, len - n); - fPutPos = (fPutPos + len) % fBuffer.length; // cyclically increment - boolean wasEmpty = fUsedSlots == 0; - fUsedSlots += len; - if (wasEmpty) // signal if was empty - notifyAll(); - } - /** - * Read a single byte. Blocks until a byte is available. - * @return a byte from the buffer - * @throws InterruptedException when the thread is interrupted while waiting - * for the buffer to become ready - * Must be called with a lock on this! - */ - public int read() throws InterruptedException { - while (fUsedSlots == 0) { - if(fClosed) - return -1; - // wait until not empty - wait(); - } - byte b = fBuffer[fTakePos]; - fTakePos = (fTakePos + 1) % fBuffer.length; - - if (fUsedSlots-- == fBuffer.length) // signal if was full - notifyAll(); - return b; - } - public int read(byte[] cbuf, int off, int len) throws InterruptedException { - assert len<=available(); - while (fUsedSlots == 0) { - if(fClosed) - return 0; - // wait until not empty - wait(); - } - int n = Math.min(len, fBuffer.length - fTakePos); - System.arraycopy(fBuffer, fTakePos, cbuf, off, n); - if (fTakePos + len > n) - System.arraycopy(fBuffer, 0, cbuf, off + n, len - n); - fTakePos = (fTakePos + len) % fBuffer.length; - boolean wasFull = fUsedSlots == fBuffer.length; - fUsedSlots -= len; - if(wasFull) - notifyAll(); - - return len; - } - public void close() { - fClosed=true; - notifyAll(); - } - public boolean isClosed() { - return fClosed; - } - } - - /** - * An output stream that calls {@link PipedInputStream#textAvailable} - * every time data is written to the stream. The data is written to - * {@link PipedInputStream#fQueue}. - * - */ - class PipedOutputStream extends OutputStream { - public void write(byte[] b, int off, int len) throws IOException { - try { - synchronized (fQueue) { - if(fQueue.isClosed()) - throw new IOException("Stream is closed!"); //$NON-NLS-1$ - int written=0; - while(writtenPipedInputStream is the same as closing the output stream. - * The stream will allow reading data that's still in the pipe after which it will - * throw an IOException. - */ - public void close() throws IOException { - synchronized(fQueue) { - fQueue.close(); - } - } - - public int read(byte[] cbuf, int off, int len) throws IOException { - int n=0; - if(len==0) - return 0; - // read as much as we can using a single synchronized statement - try { - synchronized (fQueue) { - // if nothing available, block and read one byte - if (fQueue.available() == 0) { - // block now until at least one byte is available - int c = fQueue.read(); - // are we at the end of stream - if (c == -1) - return -1; - cbuf[off] = (byte) c; - n++; - } - // is there more data available? - if (n < len && fQueue.available() > 0) { - // read at most available() - int nn = Math.min(fQueue.available(), len - n); - // are we at the end of the stream? - if (nn == 0 && fQueue.isClosed()) { - // if no byte was read, return -1 to indicate end of stream - // else return the bytes we read up to now - if (n == 0) - n = -1; - return n; - } - fQueue.read(cbuf, off + n, nn); - n += nn; - } - - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - return n; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PollingTextCanvasModel.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PollingTextCanvasModel.java deleted file mode 100644 index b54fdf643f8..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/PollingTextCanvasModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Anton Leherbauer (Wind River) - [420928] Terminal widget leaks memory - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; -import org.eclipse.swt.widgets.Display; -import org.eclipse.tm.terminal.model.ITerminalTextDataSnapshot; - -/** - * @author Michael.Scharf@scharf-software.com - * - */ -public class PollingTextCanvasModel extends AbstractTextCanvasModel { - private static final int DEFAULT_POLL_INTERVAL = 50; - int fPollInterval = -1; - - /** - * - */ - public PollingTextCanvasModel(ITerminalTextDataSnapshot snapshot) { - super(snapshot); - startPolling(); - } - public void setUpdateInterval(int t) { - fPollInterval = t; - } - public void stopPolling() { - // timerExec only dispatches if the delay is >=0 - fPollInterval = -1; - } - public void startPolling() { - if (fPollInterval < 0) { - fPollInterval = DEFAULT_POLL_INTERVAL; - Display.getDefault().timerExec(fPollInterval, new Runnable(){ - public void run() { - update(); - Display.getDefault().timerExec(fPollInterval, this); - } - }); - } - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/StyleMap.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/StyleMap.java deleted file mode 100644 index 5da29be45fa..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/StyleMap.java +++ /dev/null @@ -1,276 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Michael Scharf (Wind River) - [205260] Terminal does not take the font from the preferences - * Michael Scharf (Wind River) - [209746] There are cases where some colors not displayed correctly - * Michael Scharf (Wind River) - [206328] Terminal does not draw correctly with proportional fonts - * Martin Oberhuber (Wind River) - [247700] Terminal uses ugly fonts in JEE package - * Martin Oberhuber (Wind River) - [335358] Fix Terminal color definition - * Martin Oberhuber (Wind River) - [265352][api] Allow setting fonts programmatically - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; -import org.eclipse.tm.internal.terminal.preferences.ITerminalConstants; -import org.eclipse.tm.terminal.model.Style; -import org.eclipse.tm.terminal.model.StyleColor; - -public class StyleMap { - private static final String BLACK = "black"; //$NON-NLS-1$ - private static final String WHITE = "white"; //$NON-NLS-1$ - private static final String WHITE_FOREGROUND = "white_foreground"; //$NON-NLS-1$ - private static final String GRAY = "gray"; //$NON-NLS-1$ - private static final String MAGENTA = "magenta"; //$NON-NLS-1$ - private static final String CYAN = "cyan"; //$NON-NLS-1$ - private static final String YELLOW = "yellow"; //$NON-NLS-1$ - private static final String BLUE = "blue"; //$NON-NLS-1$ - private static final String GREEN = "green"; //$NON-NLS-1$ - private static final String RED = "red"; //$NON-NLS-1$ - - private static final String PREFIX = "org.eclipse.tm.internal."; //$NON-NLS-1$ - String fFontName=ITerminalConstants.FONT_DEFINITION; - Map fColorMapForeground=new HashMap(); - Map fColorMapBackground=new HashMap(); - Map fColorMapIntense=new HashMap(); - Map fFontMap=new HashMap(); - private Point fCharSize; - private final Style fDefaultStyle; - private boolean fInvertColors; - private boolean fProportional; - private final int[] fOffsets=new int[256]; - StyleMap() { - initColors(); - fDefaultStyle=Style.getStyle(StyleColor.getStyleColor(BLACK),StyleColor.getStyleColor(WHITE)); - updateFont(); - } - private void initColors() { - initForegroundColors(); - initBackgroundColors(); - initIntenseColors(); - } - private void initForegroundColors() { - if(fInvertColors) { - setColor(fColorMapForeground, WHITE, 0, 0, 0); - setColor(fColorMapForeground, WHITE_FOREGROUND, 50, 50, 50); - setColor(fColorMapForeground, BLACK, 229, 229, 229); - } else { - setColor(fColorMapForeground, WHITE, 255, 255, 255); - setColor(fColorMapForeground, WHITE_FOREGROUND, 229, 229, 229); - setColor(fColorMapForeground, BLACK, 50, 50, 50); - } - setColor(fColorMapForeground, RED, 205, 0, 0); - setColor(fColorMapForeground, GREEN, 0, 205, 0); - setColor(fColorMapForeground, BLUE, 0, 0, 238); - setColor(fColorMapForeground, YELLOW, 205, 205, 0); - setColor(fColorMapForeground, CYAN, 0, 205, 205); - setColor(fColorMapForeground, MAGENTA, 205, 0, 205); - setColor(fColorMapForeground, GRAY, 229, 229, 229); - } - - private void initBackgroundColors() { - if(fInvertColors) { - setColor(fColorMapBackground, WHITE, 0, 0, 0); - setColor(fColorMapBackground, WHITE_FOREGROUND, 50, 50, 50); // only used when colors are inverse - setColor(fColorMapBackground, BLACK, 255, 255, 255); - } else { - setColor(fColorMapBackground, WHITE, 255, 255, 255); - setColor(fColorMapBackground, WHITE_FOREGROUND, 229, 229, 229); - setColor(fColorMapBackground, BLACK, 0, 0, 0); - } - setColor(fColorMapBackground, RED, 205, 0, 0); - setColor(fColorMapBackground, GREEN, 0, 205, 0); - setColor(fColorMapBackground, BLUE, 0, 0, 238); - setColor(fColorMapBackground, YELLOW, 205, 205, 0); - setColor(fColorMapBackground, CYAN, 0, 205, 205); - setColor(fColorMapBackground, MAGENTA, 205, 0, 205); - setColor(fColorMapBackground, GRAY, 229, 229, 229); - } - - private void initIntenseColors() { - if(fInvertColors) { - setColor(fColorMapIntense, WHITE, 127, 127, 127); - setColor(fColorMapIntense, WHITE_FOREGROUND, 0, 0, 0); // only used when colors are inverse - setColor(fColorMapIntense, BLACK, 255, 255, 255); - } else { - setColor(fColorMapIntense, WHITE, 255, 255, 255); - setColor(fColorMapIntense, WHITE_FOREGROUND, 255, 255, 255); - setColor(fColorMapIntense, BLACK, 0, 0, 0); - } - setColor(fColorMapIntense, RED, 255, 0, 0); - setColor(fColorMapIntense, GREEN, 0, 255, 0); - setColor(fColorMapIntense, BLUE, 92, 92, 255); - setColor(fColorMapIntense, YELLOW, 255, 255, 0); - setColor(fColorMapIntense, CYAN, 0, 255, 255); - setColor(fColorMapIntense, MAGENTA, 255, 0, 255); - setColor(fColorMapIntense, GRAY, 255, 255, 255); - } - - private void setColor(Map colorMap, String name, int r, int g, int b) { - String colorName=PREFIX+r+"-"+g+"-"+b; //$NON-NLS-1$//$NON-NLS-2$ - Color color=JFaceResources.getColorRegistry().get(colorName); - if(color==null) { - JFaceResources.getColorRegistry().put(colorName, new RGB(r,g,b)); - color=JFaceResources.getColorRegistry().get(colorName); - } - colorMap.put(StyleColor.getStyleColor(name), color); - colorMap.put(StyleColor.getStyleColor(name.toUpperCase()), color); - } - - public Color getForegrondColor(Style style) { - style = defaultIfNull(style); - Map map = style.isBold() ? fColorMapIntense : fColorMapForeground; - //Map map = fColorMapForeground; - if(style.isReverse()) - return getColor(map ,style.getBackground()); - else - return getColor(map ,style.getForground()); - } - public Color getBackgroundColor(Style style) { - style = defaultIfNull(style); - if(style.isReverse()) - return getColor(fColorMapBackground,style.getForground()); - else - return getColor(fColorMapBackground,style.getBackground()); - } - Color getColor(Map map,StyleColor color) { - Color c=(Color) map.get(color); - if(c==null) { - c=Display.getCurrent().getSystemColor(SWT.COLOR_GRAY); - } - return c; - } - private Style defaultIfNull(Style style) { - if(style==null) - style=fDefaultStyle; - return style; - } - public void setInvertedColors(boolean invert) { - if(invert==fInvertColors) - return; - fInvertColors=invert; - initColors(); - } -// static Font getBoldFont(Font font) { -// FontData fontDatas[] = font.getFontData(); -// FontData data = fontDatas[0]; -// return new Font(Display.getCurrent(), data.getName(), data.getHeight(), data.getStyle()|SWT.BOLD); -// } - - public Font getFont(Style style) { - style = defaultIfNull(style); - if(style.isBold()) { - return JFaceResources.getFontRegistry().getBold(fFontName); - } else if(style.isUnderline()) { - return JFaceResources.getFontRegistry().getItalic(fFontName); - - } - return JFaceResources.getFontRegistry().get(fFontName); - } - - public Font getFont() { - return JFaceResources.getFontRegistry().get(fFontName); - - } - public int getFontWidth() { - return fCharSize.x; - } - public int getFontHeight() { - return fCharSize.y; - } - public void updateFont() { - updateFont(ITerminalConstants.FONT_DEFINITION); - } - /** - * Update the StyleMap for a new font name. - * The font name must be a valid name in the Jface font registry. - * @param fontName Jface name of the new font to use. - * @since 3.2 - */ - public void updateFont(String fontName) { - Display display=Display.getCurrent(); - GC gc = new GC (display); - if (JFaceResources.getFontRegistry().hasValueFor(fontName)) { - fFontName = fontName; - } else { - //fall back to "basic jface text font" - fFontName = "org.eclipse.jface.textfont"; //$NON-NLS-1$ - } - gc.setFont(getFont()); - fCharSize = gc.textExtent ("W"); //$NON-NLS-1$ - fProportional=false; - - for (char c = ' '; c <= '~'; c++) { - // consider only the first 128 chars for deciding if a font - // is proportional - if(measureChar(gc, c, true)) - fProportional=true; - } - // TODO should we also consider the upper 128 chars?? - for (char c = ' '+128; c <= '~'+128; c++) { - measureChar(gc, c,false); - } - if(fProportional) { - fCharSize.x-=2; //works better on small fonts - } - for (int i = 0; i < fOffsets.length; i++) { - fOffsets[i]=(fCharSize.x-fOffsets[i])/2; - } - if(!fProportional) { - //measure font in boldface, too, and if wider then treat like proportional - gc.setFont(getFont(fDefaultStyle.setBold(true))); - Point charSizeBold = gc.textExtent("W"); //$NON-NLS-1$ - if (fCharSize.x != charSizeBold.x) { - fProportional=true; - } - } - gc.dispose (); - } - /** - * @param gc - * @param c - * @param updateMax - * @return true if the the font is proportional - */ - private boolean measureChar(GC gc, char c, boolean updateMax) { - boolean proportional=false; - Point ext=gc.textExtent(String.valueOf(c)); - if(ext.x>0 && ext.y>0 && (fCharSize.x!=ext.x || fCharSize.y!=ext.y)) { - proportional=true; - if(updateMax) { - fCharSize.x=Math.max(fCharSize.x, ext.x); - fCharSize.y=Math.max(fCharSize.y, ext.y); - } - } - fOffsets[c]=ext.x; - return proportional; - } - public boolean isFontProportional() { - return fProportional; - } - /** - * Return the offset in pixels required to center a given character - * @param c the character to measure - * @return the offset in x direction to center this character - */ - public int getCharOffset(char c) { - if(c>=fOffsets.length) - return 0; - return fOffsets[c]; - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/TextCanvas.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/TextCanvas.java deleted file mode 100644 index 27012b85b1f..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/TextCanvas.java +++ /dev/null @@ -1,424 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Michael Scharf (Wind River) - [240098] The cursor should not blink when the terminal is disconnected - * Uwe Stieber (Wind River) - [281328] The very first few characters might be missing in the terminal control if opened and connected programmatically - * Martin Oberhuber (Wind River) - [294327] After logging in, the remote prompt is hidden - * Anton Leherbauer (Wind River) - [294468] Fix scroller and text line rendering - * Uwe Stieber (Wind River) - [205486] Fix ScrollLock always moving to line 1 - * Anton Leherbauer (Wind River) - [219589] Copy an entire line selection - * Anton Leherbauer (Wind River) - [196465] Resizing Terminal changes Scroller location - * Anton Leherbauer (Wind River) - [324608] Terminal has strange scrolling behaviour - * Martin Oberhuber (Wind River) - [265352][api] Allow setting fonts programmatically - * Anton Leherbauer (Wind River) - [434749] UnhandledEventLoopException when copying to clipboard while the selection is empty - *******************************************************************************/ -package org.eclipse.tm.internal.terminal.textcanvas; - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; - -/** - * A cell oriented Canvas. Maintains a list of "cells". - * It can either be vertically or horizontally scrolled. - * The CellRenderer is responsible for painting the cell. - */ -public class TextCanvas extends GridCanvas { - protected final ITextCanvasModel fCellCanvasModel; - /** Renders the cells */ - private final ILinelRenderer fCellRenderer; - private boolean fScrollLock; - private Point fDraggingStart; - private Point fDraggingEnd; - private boolean fHasSelection; - private ResizeListener fResizeListener; - - // The minSize is meant to determine the minimum size of the backing store - // (grid) into which remote data is rendered. If the viewport is smaller - // than that minimum size, the backing store size remains at the minSize, - // and a scrollbar is shown instead. In reality, this has the following - // issues or effects today: - // (a) Bug 281328: For very early data coming in before the widget is - // realized, the minSize determines into what initial grid that is - // rendered. See also @link{#addResizeHandler(ResizeListener)}. - // (b) Bug 294468: Since we have redraw and size computation problems - // with horizontal scrollers, for now the minColumns must be small - // enough to avoid a horizontal scroller appearing in most cases. - // (b) Bug 294327: since we have problems with the vertical scroller - // showing the correct location, minLines must be small enough - // to avoid a vertical scroller or new data may be rendered off-screen. - // As a compromise, we have been working with a 20x4 since the Terminal - // inception, though many users would want a 80x24 minSize and backing - // store. Pros and cons of the small minsize: - // + consistent "remote size==viewport size", vi works as expected - // - dumb terminals which expect 80x24 render garbled on small viewport. - // If bug 294468 were resolved, an 80 wide minSize would be preferrable - // since it allows switching the terminal viewport small/large as needed, - // without destroying the backing store. For a complete solution, - // Bug 196462 tracks the request for a user-defined fixed-widow-size-mode. - private int fMinColumns=80; - private int fMinLines=4; - private boolean fCursorEnabled; - private boolean fResizing; - - /** - * Create a new CellCanvas with the given SWT style bits. - * (SWT.H_SCROLL and SWT.V_SCROLL are automatically added). - */ - public TextCanvas(Composite parent, ITextCanvasModel model, int style,ILinelRenderer cellRenderer) { - super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL); - fCellRenderer=cellRenderer; - setCellWidth(fCellRenderer.getCellWidth()); - setCellHeight(fCellRenderer.getCellHeight()); - fCellCanvasModel=model; - fCellCanvasModel.addCellCanvasModelListener(new ITextCanvasModelListener(){ - public void rangeChanged(int col, int line, int width, int height) { - if(isDisposed()) return; - repaintRange(col,line,width,height); - } - public void dimensionsChanged(int cols, int rows) { - if(isDisposed()) return; - calculateGrid(); - } - public void terminalDataChanged() { - if(isDisposed()) return; - - // scroll to end (unless scroll lock is active) - if (!fResizing) { - calculateGrid(); - scrollToEnd(); - } - } - }); - // let the cursor blink if the text canvas gets the focus... - addFocusListener(new FocusListener(){ - public void focusGained(FocusEvent e) { - fCellCanvasModel.setCursorEnabled(fCursorEnabled); - } - public void focusLost(FocusEvent e) { - fCellCanvasModel.setCursorEnabled(false); - }}); - addMouseListener(new MouseListener(){ - public void mouseDoubleClick(MouseEvent e) { - } - public void mouseDown(MouseEvent e) { - if(e.button==1) { // left button - fDraggingStart=screenPointToCell(e.x, e.y); - fHasSelection=false; - if((e.stateMask&SWT.SHIFT)!=0) { - Point anchor=fCellCanvasModel.getSelectionAnchor(); - if(anchor!=null) - fDraggingStart=anchor; - } else { - fCellCanvasModel.setSelectionAnchor(fDraggingStart); - } - fDraggingEnd=null; - } - } - public void mouseUp(MouseEvent e) { - if(e.button==1) { // left button - updateHasSelection(e); - if(fHasSelection) - setSelection(screenPointToCell(e.x, e.y)); - else - fCellCanvasModel.setSelection(-1,-1,-1,-1); - fDraggingStart=null; - } - } - }); - addMouseMoveListener(new MouseMoveListener() { - - public void mouseMove(MouseEvent e) { - if (fDraggingStart != null) { - updateHasSelection(e); - setSelection(screenPointToCell(e.x, e.y)); - } - } - }); - serVerticalBarVisible(true); - setHorizontalBarVisible(false); - } - - /** - * The user has to drag the mouse to at least one character to make a selection. - * Once this is done, even a one char selection is OK. - * - * @param e - */ - private void updateHasSelection(MouseEvent e) { - if(fDraggingStart!=null) { - Point p=screenPointToCell(e.x, e.y); - if(fDraggingStart.x!=p.x||fDraggingStart.y!=p.y) - fHasSelection=true; - } - } - - void setSelection(Point p) { - if (fDraggingStart !=null && !p.equals(fDraggingEnd)) { - fDraggingEnd = p; - if (compare(p, fDraggingStart) < 0) { - // bug 219589 - make sure selection start coordinates are non-negative - int startColumn = Math.max(0, p.x); - int startRow = Math.max(p.y, 0); - fCellCanvasModel.setSelection(startRow, fDraggingStart.y, startColumn, fDraggingStart.x); - } else { - fCellCanvasModel.setSelection(fDraggingStart.y, p.y, fDraggingStart.x, p.x); - - } - } - } - - int compare(Point p1, Point p2) { - if (p1.equals(p2)) - return 0; - if (p1.y == p2.y) { - if (p1.x > p2.x) - return 1; - else - return -1; - } - if (p1.y > p2.y) { - return 1; - } else { - return -1; - } - } - public ILinelRenderer getCellRenderer() { - return fCellRenderer; - } - - public int getMinColumns() { - return fMinColumns; - } - - public void setMinColumns(int minColumns) { - fMinColumns = minColumns; - } - - public int getMinLines() { - return fMinLines; - } - - public void setMinLines(int minLines) { - fMinLines = minLines; - } - - protected void onResize(boolean init) { - if(fResizeListener!=null) { - Rectangle bonds=getClientArea(); - int cellHeight = getCellHeight(); - int cellWidth = getCellWidth(); - int lines=bonds.height/cellHeight; - int columns=bonds.width/cellWidth; - // when the view is minimised, its size is set to 0 - // we don't sent this to the terminal! - if((lines>0 && columns>0) || init) { - if(columns=fMinColumns && isHorizontalBarVisble()) { - setHorizontalBarVisible(false); - bonds=getClientArea(); - lines=bonds.height/cellHeight; - columns=bonds.width/cellWidth; - } - if(lines 0) { - y = 0; - } - Rectangle v=getViewRectangle(); - if(v.y!=-y) { - setVirtualOrigin(v.x,y); - } - // make sure the scroll area is correct: - scrollY(getVerticalBar()); - scrollX(getHorizontalBar()); - } - } - /** - * - * @return true if the cursor should be shown on output.... - */ - public boolean isScrollLock() { - return fScrollLock; - } - /** - * If set then if the size changes - */ - public void setScrollLock(boolean scrollLock) { - fScrollLock=scrollLock; - } - protected void repaintRange(int col, int line, int width, int height) { - Point origin=cellToOriginOnScreen(col,line); - Rectangle r=new Rectangle(origin.x,origin.y,width*getCellWidth(),height*getCellHeight()); - repaint(r); - } - protected void drawLine(GC gc, int line, int x, int y, int colFirst, int colLast) { - fCellRenderer.drawLine(fCellCanvasModel, gc,line,x,y,colFirst, colLast); - } - protected Color getTerminalBackgroundColor() { - return fCellRenderer.getDefaultBackgroundColor(); - } - protected void visibleCellRectangleChanged(int x, int y, int width, int height) { - fCellCanvasModel.setVisibleRectangle(y,x,height,width); - update(); - } - protected int getCols() { - return fCellCanvasModel.getTerminalText().getWidth(); - } - protected int getRows() { - return fCellCanvasModel.getTerminalText().getHeight(); - } - public String getSelectionText() { - // TODO -- create a hasSelectionMethod! - return fCellCanvasModel.getSelectedText(); - } - public void copy() { - String selectionText = getSelectionText(); - if (selectionText != null && selectionText.length() > 0) { - Clipboard clipboard = new Clipboard(getDisplay()); - clipboard.setContents(new Object[] { selectionText }, new Transfer[] { TextTransfer.getInstance() }); - clipboard.dispose(); - } - } - public void selectAll() { - fCellCanvasModel.setSelection(0, fCellCanvasModel.getTerminalText().getHeight(), 0, fCellCanvasModel.getTerminalText().getWidth()); - fCellCanvasModel.setSelectionAnchor(new Point(0,0)); - } - public boolean isEmpty() { - return false; - } - /** - * Gets notified when the visible size of the terminal changes. - * This should update the model! - * - */ - public interface ResizeListener { - void sizeChanged(int lines, int columns); - } - /** - * @param listener this listener gets notified, when the size of - * the widget changed. It should change the dimensions of the underlying - * terminaldata - */ - public void addResizeHandler(ResizeListener listener) { - if(fResizeListener!=null) - throw new IllegalArgumentException("There can be at most one listener at the moment!"); //$NON-NLS-1$ - fResizeListener=listener; - - // Bug 281328: [terminal] The very first few characters might be missing in - // the terminal control if opened and connected programmatically - // - // In case the terminal had not been visible yet or is too small (less than one - // line visible), the terminal should have a minimum size to avoid RuntimeExceptions. - Rectangle bonds=getClientArea(); - if (bonds.height=getTerminalText().getHeight() || colFirst>=getTerminalText().getWidth() || colFirst-colLast==0) { - fillBackground(gc, x, y, getCellWidth()*(colLast-colFirst), getCellHeight()); - } else { - colLast=Math.min(colLast, getTerminalText().getWidth()); - LineSegment[] segments=getTerminalText().getLineSegments(line, colFirst, colLast-colFirst); - for (int i = 0; i < segments.length; i++) { - LineSegment segment=segments[i]; - Style style=segment.getStyle(); - setupGC(gc, style); - String text=segment.getText(); - drawText(gc, x, y, colFirst, segment.getColumn(), text); - drawCursor(model, gc, line, x, y, colFirst); - } - if(fModel.hasLineSelection(line)) { - gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT)); - gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION)); - Point start=model.getSelectionStart(); - Point end=model.getSelectionEnd(); - char[] chars=model.getTerminalText().getChars(line); - if(chars==null) - return; - int offset=0; - if(start.y==line) - offset=start.x; - offset=Math.max(offset, colFirst); - int len; - if(end.y==line) - len=end.x-offset+1; - else - len=chars.length-offset+1; - len=Math.min(len,chars.length-offset); - if(len>0) { - String text=new String(chars,offset,len); - drawText(gc, x, y, colFirst, offset, text); - } - } - } - } - - private void fillBackground(GC gc, int x, int y, int width, int height) { - Color bg=gc.getBackground(); - gc.setBackground(getDefaultBackgroundColor()); - gc.fillRectangle (x,y,width,height); - gc.setBackground(bg); - - } - - public Color getDefaultBackgroundColor() { - // null == default style - return fStyleMap.getBackgroundColor(null); - } - - private void drawCursor(ITextCanvasModel model, GC gc, int row, int x, int y, int colFirst) { - if(!model.isCursorOn()) - return; - int cursorLine=model.getCursorLine(); - - if(row==cursorLine) { - int cursorColumn=model.getCursorColumn(); - if(cursorColumnCanvas showing a virtual object. - * Virtual: the extent of the total canvas. - * Screen: the visible client area in the screen. - */ -public abstract class VirtualCanvas extends Canvas { - - private final Rectangle fVirtualBounds = new Rectangle(0,0,0,0); - private Rectangle fClientArea; - /** - * prevent infinite loop in {@link #updateScrollbars()} - */ - private boolean fInUpdateScrollbars; - private static boolean fInUpdateScrollbarsLogged; - - public VirtualCanvas(Composite parent, int style) { - super(parent, style|SWT.NO_BACKGROUND|SWT.NO_REDRAW_RESIZE); - fClientArea=getClientArea(); - addListener(SWT.Paint, new Listener() { - public void handleEvent(Event event) { - paint(event.gc); - } - }); - addListener(SWT.Resize, new Listener() { - public void handleEvent(Event event) { - fClientArea=getClientArea(); - onResize(); - } - }); - getVerticalBar().addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - scrollY((ScrollBar)e.widget); - - } - - }); - getHorizontalBar().addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - scrollX((ScrollBar)e.widget); - - } - }); - } - protected void onResize() { - updateViewRectangle(); - } - protected void scrollX(ScrollBar hBar) { - int hSelection = hBar.getSelection (); - int destX = -hSelection - fVirtualBounds.x; - fVirtualBounds.x = -hSelection; - scrollSmart(destX, 0); - updateViewRectangle(); - } - protected void scrollXDelta(int delta) { - getHorizontalBar().setSelection(-fVirtualBounds.x+delta); - scrollX(getHorizontalBar()); - } - - protected void scrollY(ScrollBar vBar) { - int vSelection = vBar.getSelection (); - int destY = -vSelection - fVirtualBounds.y; - if(destY!=0) { - fVirtualBounds.y = -vSelection; - scrollSmart(0,destY); - updateViewRectangle(); - } - - } - protected void scrollYDelta(int delta) { - getVerticalBar().setSelection(-fVirtualBounds.y+delta); - scrollY(getVerticalBar()); - } - - - protected void scrollSmart(int deltaX, int deltaY) { - if (deltaX != 0 || deltaY != 0) { - Rectangle rect = getBounds(); - scroll (deltaX, deltaY, 0, 0, rect.width, rect.height, false); - } - } - - /** - * @param rect in virtual space - */ - protected void revealRect(Rectangle rect) { - Rectangle visibleRect=getScreenRectInVirtualSpace(); - // scroll the X part - int deltaX=0; - if(rect.x0||marginHeight>0){ - Color bg=getBackground(); - gc.setBackground(getTerminalBackgroundColor()); - if (marginWidth > 0) { - gc.fillRectangle (width, clipping.y, marginWidth, clipping.height); - } - if (marginHeight > 0) { - gc.fillRectangle (clipping.x, height, clipping.width, marginHeight); - } - gc.setBackground(bg); - } - } - /** - * @private - */ - protected boolean inClipping(Rectangle clipping, Rectangle r) { - // TODO check if this is OK in all cases (the <=!) - // - if(r.x+r.width<=clipping.x) - return false; - if(clipping.x+clipping.width<=r.x) - return false; - if(r.y+r.height<=clipping.y) - return false; - if(clipping.y+clipping.height<=r.y) - return false; - - return true; - } - /** - * @return the screen rect in virtual space (starting with (0,0)) - * of the visible screen. (x,y>=0) - */ - protected Rectangle getScreenRectInVirtualSpace() { - Rectangle r= new Rectangle(fClientArea.x-fVirtualBounds.x,fClientArea.y-fVirtualBounds.y,fClientArea.width,fClientArea.height); - return r; - } - /** - * @return the rect in virtual space (starting with (0,0)) - * of the visible screen. (x,y>=0) - */ - protected Rectangle getRectInVirtualSpace(Rectangle r) { - return new Rectangle(r.x-fVirtualBounds.x,r.y-fVirtualBounds.y,r.width,r.height); - } - - /** - * Sets the extent of the virtual display area - * @param width width of the display area - * @param height height of the display area - */ - protected void setVirtualExtend(int width, int height) { - fVirtualBounds.width=width; - fVirtualBounds.height=height; - updateScrollbars(); - updateViewRectangle(); - } - /** - * sets the scrolling origin. Also sets the scrollbars. - * Does NOT redraw! - * Use negative values (move the virtual origin to the top left - * to see something in the screen (which is located at (0,0)) - * @param x - * @param y - */ - protected void setVirtualOrigin(int x, int y) { - if (fVirtualBounds.x != x || fVirtualBounds.y != y) { - fVirtualBounds.x=x; - fVirtualBounds.y=y; - getHorizontalBar().setSelection(-x); - getVerticalBar().setSelection(-y); - updateViewRectangle(); - } - } - protected Rectangle getVirtualBounds() { - return cloneRectangle(fVirtualBounds); - } - /** - * @param x - * @return the virtual coordinate in screen space - */ - protected int virtualXtoScreen(int x) { - return x+fVirtualBounds.x; - } - protected int virtualYtoScreen(int y) { - return y+fVirtualBounds.y; - } - protected int screenXtoVirtual(int x) { - return x-fVirtualBounds.x; - } - protected int screenYtoVirtual(int y) { - return y-fVirtualBounds.y; - } - /** called when the viewed part is changing */ - private final Rectangle fViewRectangle=new Rectangle(0,0,0,0); - protected void updateViewRectangle() { - if( - fViewRectangle.x==-fVirtualBounds.x - && fViewRectangle.y==-fVirtualBounds.y - && fViewRectangle.width==fClientArea.width - && fViewRectangle.height==fClientArea.height - ) - return; - fViewRectangle.x=-fVirtualBounds.x; - fViewRectangle.y=-fVirtualBounds.y; - fViewRectangle.width=fClientArea.width; - fViewRectangle.height=fClientArea.height; - viewRectangleChanged(fViewRectangle.x,fViewRectangle.y,fViewRectangle.width,fViewRectangle.height); - } - protected Rectangle getViewRectangle() { - return cloneRectangle(fViewRectangle); - } - private Rectangle cloneRectangle(Rectangle r) { - return new Rectangle(r.x,r.y,r.width,r.height); - } - /** - * Called when the viewed part has changed. - * Override when you need this information.... - * Is only called if the values change! - * @param x visible in virtual space - * @param y visible in virtual space - * @param width - * @param height - */ - protected void viewRectangleChanged(int x, int y, int width, int height) { - } - /** - * @private - */ - private void updateScrollbars() { - // don't get into infinite loops.... - if(!fInUpdateScrollbars) { - fInUpdateScrollbars=true; - try { - doUpdateScrollbar(); - } finally { - fInUpdateScrollbars=false; - } - } else { - if(!fInUpdateScrollbarsLogged) { - fInUpdateScrollbarsLogged=true; - TerminalPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, - TerminalPlugin.PLUGIN_ID, IStatus.OK, "Unexpected Recursion in terminal", //$NON-NLS-1$ - new RuntimeException())); - } - } - } - private void doUpdateScrollbar() { - Rectangle clientArea= getClientArea(); - ScrollBar horizontal= getHorizontalBar(); - // even if setVisible was called on the scrollbar, isVisible - // returns false if its parent is not visible. - if(!isVisible() || horizontal.isVisible()) { - horizontal.setPageIncrement(clientArea.width - horizontal.getIncrement()); - int max= fVirtualBounds.width; - horizontal.setMaximum(max); - horizontal.setThumb(clientArea.width); - } - ScrollBar vertical= getVerticalBar(); - // even if setVisible was called on the scrollbar, isVisible - // returns false if its parent is not visible. - if(!isVisible() || vertical.isVisible()) { - vertical.setPageIncrement(clientArea.height - vertical.getIncrement()); - int max= fVirtualBounds.height; - vertical.setMaximum(max); - vertical.setThumb(clientArea.height); - } - } - protected boolean isVertialBarVisible() { - return getVerticalBar().isVisible(); - } - protected void serVerticalBarVisible(boolean showVScrollBar) { - ScrollBar vertical= getVerticalBar(); - vertical.setVisible(showVScrollBar); - vertical.setSelection(0); - } - protected boolean isHorizontalBarVisble() { - return getHorizontalBar().isVisible(); - } - protected void setHorizontalBarVisible(boolean showHScrollBar) { - ScrollBar horizontal= getHorizontalBar(); - horizontal.setVisible(showHScrollBar); - horizontal.setSelection(0); - } -} - diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java deleted file mode 100644 index da4881338da..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -/** - * A writable matrix of characters and {@link Style}. This is intended to be the - * low level representation of the text of a Terminal. Higher layers are - * responsible to fill the text and styles into this representation. - *

            - * Note: Implementations of this interface has to be thread safe. - *

            - * - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ITerminalTextData extends ITerminalTextDataReadOnly { - - /** - * Sets the dimensions of the data. If the dimensions are smaller than the current - * dimensions, the lines will be chopped. If the dimensions are bigger, then - * the new elements will be filled with 0 chars and null Style. - * @param height - * @param width - */ - void setDimensions(int height, int width); - - void setMaxHeight(int height); - int getMaxHeight(); - - /** - * Set a single character and the associated {@link Style}. - * @param line line must be >=0 and < height - * @param column column must be >=0 and < width - * @param c the new character at this position - * @param style the style or null - */ - void setChar(int line, int column, char c, Style style); - - /** - * Set an array of characters showing in the same {@link Style}. - * @param line line must be >=0 and < height - * @param column column must be >=0 and < width - * @param chars the new characters at this position - * @param style the style or null - */ - void setChars(int line, int column, char[] chars, Style style); - - /** - * Set a subrange of an array of characters showing in the same {@link Style}. - * @param line line must be >=0 and < height - * @param column column must be >=0 and < width - * @param chars the new characters at this position - * @param start the start index in the chars array - * @param len the number of characters to insert. Characters beyond width are not inserted. - * @param style the style or null - */ - void setChars(int line, int column, char[] chars, int start, int len, Style style); - - - /** - * Cleans the entire line. - * @param line - */ - void cleanLine(int line); - - /** - * Shifts some lines up or down. The "empty" space is filled with '\000' chars - * and null {@link Style} - *

            To illustrate shift, here is some sample data: - *

            -	 * 0 aaaa
            -	 * 1 bbbb
            -	 * 2 cccc
            -	 * 3 dddd
            -	 * 4 eeee
            -	 * 
            - * - * Shift a region of 3 lines up by one line shift(1,3,-1) - *
            -	 * 0 aaaa
            -	 * 1 cccc
            -	 * 2 dddd
            -	 * 3
            -	 * 4 eeee
            -	 * 
            - * - * - * Shift a region of 3 lines down by one line shift(1,3,1) - *
            -	 * 0 aaaa
            -	 * 1
            -	 * 2 bbbb
            -	 * 3 cccc
            -	 * 4 eeee
            -	 * 
            - * @param startLine the start line of the shift - * @param size the number of lines to shift - * @param shift how much scrolling is done. New scrolled area is filled with '\000'. - * Negative number means scroll down, positive scroll up (see example above). - */ - void scroll(int startLine, int size, int shift); - - /**Adds a new line to the terminal. If maxHeigth is reached, the entire terminal - * will be scrolled. Else a line will be added. - */ - void addLine(); - /** - * Copies the entire source into this and changes the size accordingly - * @param source - */ - void copy(ITerminalTextData source); - /** - * Copy a sourceLine from source to this at destLine. - * @param source - * @param sourceLine - * @param destLine - */ - void copyLine(ITerminalTextData source,int sourceLine, int destLine); - /** - * Copy length lines from source starting at sourceLine into this starting at - * destLine. - * @param source - * @param sourceStartLine - * @param destStartLine - * @param length - */ - void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length); - - void setCursorLine(int line); - void setCursorColumn(int column); - - /** - * Makes this line a wrapped line which logically continues on next line. - * - * @param line - * @since 3.3 - */ - void setWrappedLine(int line); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java deleted file mode 100644 index 876ac102bc9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend - * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -/** - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ITerminalTextDataReadOnly { - - /** - * @return the width of the terminal - */ - int getWidth(); - - /** - * @return the height of the terminal - */ - int getHeight(); - - /** - * @param line be >=0 and < height - * @param startCol must be >=0 and < width - * @param numberOfCols must be > 0 - * @return a the line segments of the specified range - */ - LineSegment[] getLineSegments(int line, int startCol, int numberOfCols); - - /** - * @param line must be >=0 and < height - * @param column must be >=0 and < width - * @return the character at column,line - */ - char getChar(int line, int column); - - /** - * @param line must be >=0 and < height - * @param column must be >=0 and < width - * @return style at column,line or null - */ - Style getStyle(int line, int column); - - /** - * Creates a new instance of {@link ITerminalTextDataSnapshot} that - * can be used to track changes. Make sure to call {@link ITerminalTextDataSnapshot#detach()} - * if you don't need the snapshots anymore. - *

            Note: A new snapshot is empty and needs a call to {@link ITerminalTextDataSnapshot#updateSnapshot(boolean)} to - * get its initial values. You might want to setup the snapshot to your needs by calling - * {@link ITerminalTextDataSnapshot#setInterestWindow(int, int)}. - *

            - * @return a new instance of {@link ITerminalTextDataSnapshot} that "listens" to changes of - * this. - */ - public ITerminalTextDataSnapshot makeSnapshot(); - - char[] getChars(int line); - Style[] getStyles(int line); - - /** - * @return the line in which the cursor is at the moment - */ - int getCursorLine(); - /** - * @return the column at which the cursor is at the moment - */ - int getCursorColumn(); - - /** - * @param line - * @return true if this line got wrapped, ie. logically continues on next line - * @since 3.3 - */ - boolean isWrappedLine(int line); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java deleted file mode 100644 index 3b544c11825..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java +++ /dev/null @@ -1,226 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -/** - * This class maintains a snapshot of an instance of {@link ITerminalTextData}. - * While the {@link ITerminalTextData} continues changing, the snapshot remains - * unchanged until the next snapshot is taken by calling - * {@link #updateSnapshot(boolean)}. This is important, because the - * {@link ITerminalTextData} might get modified by another thread. Suppose you - * would want to draw the content of the {@link ITerminalTextData} using the - * following loop: - * - *
            - * for (int line = 0; line < term.getHeight(); line++)
            - * 	for (int column = 0; column < term.getWidth(); column++)
            - * 		drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line));
            - * 
            - * - * This might fail because the background thread could change the dimensions of - * the {@link ITerminalTextData} while you iterate the loop. One solution would - * be to put a synchronized(term){} statement around the code. This - * has two problems: 1. you would have to know about the internals of the - * synchronisation of {@link ITerminalTextData}. 2. The other thread that - * changes {@link ITerminalTextData} is blocked while the potentially slow - * drawing is done. - *

            - * Solution: Take a snapshot of the terminal and use the snapshot to draw - * the content. There is no danger that the data structure get changed while you - * draw. There are also methods to find out what has changed to minimize the - * number of lines that get redrawn. - *

            - * - *

            - * Drawing optimization: To optimize redrawing of changed lines, this - * class keeps track of lines that have changed since the previous snapshot. - *

            - * - *
            - * // iterate over the potentially changed lines
            - * for (int line = snap.getFirstChangedLine(); line <= snap.getLastChangedLine(); line++)
            - * 	// redraw only if the line has changed
            - * 	if (snap.hasLineChanged(line))
            - * 		for (int column = 0; column < snap.getWidth(); column++)
            - * 			drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
            - * 
            - * - *

            - * Scroll optimization: Often new lines are appended at the bottom of the - * terminal and the rest of the lines are scrolled up. In this case all lines - * would be marked as changed. To optimize for this case, - * {@link #updateSnapshot(boolean)} can be called with true for the - * detectScrolling parameter. The object will keep track of - * scrolling. The UI must first handle the scrolling and then use the - * {@link #hasLineChanged(int)} method to determine scrolling: - * - *

            - * // scroll the visible region of the UI <b>before</b> drawing the changed lines.
            - * doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift());
            - * // iterate over the potentially changed lines
            - * for (int line = snap.getFirstChangedLine(); line <= snap.getFirstChangedLine(); line++)
            - * 	// redraw only if the line has changed
            - * 	if (snap.hasLineChanged(line))
            - * 		for (int column = 0; column < snap.getWidth(); column++)
            - * 			drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
            - * 
            - * - *

            - *

            - * Threading Note: This class is not thread safe! All methods have to be - * called by the a same thread, that created the instance by calling - * {@link ITerminalTextDataReadOnly#makeSnapshot()}. - *

            - * - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { - /** - * This listener gets called when the current snapshot - * is out of date. Calling {@link ITerminalTextDataSnapshot#updateSnapshot(boolean)} - * will have an effect. Once the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} method is called, - * it will not be called until {@link ITerminalTextDataSnapshot#updateSnapshot(boolean)} - * is called and a new snapshot needs to be updated again. - *

            - * A typical terminal view would not update the snapshot immediately - * after the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} has been called. It would introduce a - * delay to update the UI (and the snapshot} 10 or 20 times per second. - * - *

            Make sure you don't spend too much time in this method. - */ - interface SnapshotOutOfDateListener { - /** - * Gets called when the snapshot is out of date. To get the snapshot up to date, - * call {@link ITerminalTextDataSnapshot#updateSnapshot(boolean)}. - * @param snapshot The snapshot that is out of date - */ - void snapshotOutOfDate(ITerminalTextDataSnapshot snapshot); - } - void addListener(SnapshotOutOfDateListener listener); - void removeListener(SnapshotOutOfDateListener listener); - - /** - * Ends the listening to the {@link ITerminalTextData}. After this - * has been called no new snapshot data is collected. - */ - void detach(); - /** - * @return true if the data has changed since the previous snapshot. - */ - boolean isOutOfDate(); - - /** - * The window of interest is the region the snapshot should track. - * Changes outside this region are ignored. The change takes effect after - * an update! - * @param startLine -1 means track the end of the data - * @param size number of lines to track. A size of -1 means track all. - */ - void setInterestWindow(int startLine, int size); - int getInterestWindowStartLine(); - int getInterestWindowSize(); - - /** - * Create a new snapshot of the {@link ITerminalTextData}. It will efficiently - * copy the data of the {@link ITerminalTextData} into an internal representation. - * The snapshot also keeps track of the changes since the previous snapshot. - *

            With the methods {@link #getFirstChangedLine()}, {@link #getLastChangedLine()} and - * {@link #hasLineChanged(int)} - * you can find out what has changed in the current snapshot since the previous snapshot. - * @param detectScrolling if true the snapshot tries to identify scroll - * changes since the last snapshot. In this case the information about scrolling - * can be retrieved using the following methods: - * {@link #getScrollWindowStartLine()}, {@link #getScrollWindowSize()} and {@link #getScrollWindowShift()} - *
            Note: The method {@link #hasLineChanged(int)} returns changes after the - * scrolling has been applied. - */ - void updateSnapshot(boolean detectScrolling); - - /** - * @return The first line changed in this snapshot compared - * to the previous snapshot. - * - *

            Note: If no line has changed, this - * returns {@link Integer#MAX_VALUE} - * - *

            Note: if {@link #updateSnapshot(boolean)} has been called with true, - * then this does not include lines that only have been scrolled. This is the - * first line that has changed after the scroll has been applied. - */ - int getFirstChangedLine(); - - /** - * @return The last line changed in this snapshot compared - * to the previous snapshot. If the height has changed since the - * last update of the snapshot, then the returned value is within - * the new dimensions. - * - *

            Note: If no line has changed, this returns -1 - * - *

            Note: if {@link #updateSnapshot(boolean)} has been called with true, - * then this does not include lines that only have been scrolled. This is the - * last line that has changed after the scroll has been applied. - * - *

            A typical for loop using this method would look like this (note the <= in the for loop): - *

            -	 * for(int line=snap.{@link #getFirstChangedLine()}; line <= snap.getLastChangedLine(); line++)
            -	 *    if(snap.{@link #hasLineChanged(int) hasLineChanged(line)})
            -	 *       doSomething(line);
            -	 * 
            - */ - int getLastChangedLine(); - - /** - * @param line - * @return true if the line has changed since the previous snapshot - */ - boolean hasLineChanged(int line); - - boolean hasDimensionsChanged(); - - /** - * @return true if the terminal has changed (and not just the - * window of interest) - */ - boolean hasTerminalChanged(); - /** - * If {@link #updateSnapshot(boolean)} was called with true, then this method - * returns the top of the scroll region. - * @return The first line scrolled in this snapshot compared - * to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)}. - */ - int getScrollWindowStartLine(); - - /** - * If {@link #updateSnapshot(boolean)} was called with true, then this method - * returns the size of the scroll region. - * @return The number of lines scrolled in this snapshot compared - * to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)} - * If nothing has changed, 0 is returned. - */ - int getScrollWindowSize(); - - /** - * If {@link #updateSnapshot(boolean)} was called with true, then this method - * returns number of lines moved by the scroll region. - * @return The the scroll shift of this snapshot compared - * to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)} - */ - int getScrollWindowShift(); - - /** - * @return The {@link ITerminalTextData} on that this instance is observing. - */ - ITerminalTextData getTerminalTextData(); - -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/LineSegment.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/LineSegment.java deleted file mode 100644 index d5f8f1970be..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/LineSegment.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - - -public class LineSegment { - private final String fText; - private final int fCol; - private final Style fStyle; - public LineSegment(int col, String text, Style style) { - fCol = col; - fText = text; - fStyle = style; - } - public Style getStyle() { - return fStyle; - } - public String getText() { - return fText; - } - public int getColumn() { - return fCol; - } - public String toString() { - return "LineSegment("+fCol+", \""+fText+"\","+fStyle+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - } -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/Style.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/Style.java deleted file mode 100644 index 8786af1c7d3..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/Style.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author scharf - * Flyweight - * Threadsafe. - * - */ -// TODO add an Object for user data, use weak map to keep track of styles with associated -// user data -public class Style { - private final StyleColor fForground; - private final StyleColor fBackground; - private final boolean fBold; - private final boolean fBlink; - private final boolean fUnderline; - private final boolean fReverse; - private final static Map fgStyles=new HashMap(); - private Style(StyleColor forground, StyleColor background, boolean bold, boolean blink, boolean underline, boolean reverse) { - fForground = forground; - fBackground = background; - fBold = bold; - fBlink = blink; - fUnderline = underline; - fReverse = reverse; - } - public static Style getStyle(StyleColor forground, StyleColor background, boolean bold, boolean blink, boolean underline, boolean reverse) { - Style style = new Style(forground,background, bold, blink,underline,reverse); - Style cached; - synchronized (fgStyles) { - cached=(Style) fgStyles.get(style); - if(cached==null) { - cached=style; - fgStyles.put(cached, cached); - } - } - return cached; - } - public static Style getStyle(String forground, String background) { - return getStyle(StyleColor.getStyleColor(forground), StyleColor.getStyleColor(background),false,false,false,false); - } - public static Style getStyle(StyleColor forground, StyleColor background) { - return getStyle(forground, background,false,false,false,false); - } - public Style setForground(StyleColor forground) { - return getStyle(forground,fBackground,fBold,fBlink,fUnderline,fReverse); - } - public Style setBackground(StyleColor background) { - return getStyle(fForground,background,fBold,fBlink,fUnderline,fReverse); - } - public Style setForground(String colorName) { - return getStyle(StyleColor.getStyleColor(colorName),fBackground,fBold,fBlink,fUnderline,fReverse); - } - public Style setBackground(String colorName) { - return getStyle(fForground,StyleColor.getStyleColor(colorName),fBold,fBlink,fUnderline,fReverse); - } - public Style setBold(boolean bold) { - return getStyle(fForground,fBackground,bold,fBlink,fUnderline,fReverse); - } - public Style setBlink(boolean blink) { - return getStyle(fForground,fBackground,fBold,blink,fUnderline,fReverse); - } - public Style setUnderline(boolean underline) { - return getStyle(fForground,fBackground,fBold,fBlink,underline,fReverse); - } - public Style setReverse(boolean reverse) { - return getStyle(fForground,fBackground,fBold,fBlink,fUnderline,reverse); - } - public StyleColor getBackground() { - return fBackground; - } - public boolean isBlink() { - return fBlink; - } - public boolean isBold() { - return fBold; - } - public StyleColor getForground() { - return fForground; - } - public boolean isReverse() { - return fReverse; - } - public boolean isUnderline() { - return fUnderline; - } - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fBackground == null) ? 0 : fBackground.hashCode()); - result = prime * result + (fBlink ? 1231 : 1237); - result = prime * result + (fBold ? 1231 : 1237); - result = prime * result + ((fForground == null) ? 0 : fForground.hashCode()); - result = prime * result + (fReverse ? 1231 : 1237); - result = prime * result + (fUnderline ? 1231 : 1237); - return result; - } - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final Style other = (Style) obj; - // background == is the same as equals - if (fBackground != other.fBackground) - return false; - if (fBlink != other.fBlink) - return false; - if (fBold != other.fBold) - return false; - if (fForground != other.fForground) - return false; - if (fReverse != other.fReverse) - return false; - if (fUnderline != other.fUnderline) - return false; - return true; - } - public String toString() { - StringBuffer result=new StringBuffer(); - result.append("Style(foreground="); //$NON-NLS-1$ - result.append(fForground); - result.append(", background="); //$NON-NLS-1$ - result.append(fBackground); - if(fBlink) - result.append(", blink"); //$NON-NLS-1$ - if(fBold) - result.append(", bold"); //$NON-NLS-1$ - if(fBlink) - result.append(", blink"); //$NON-NLS-1$ - if(fReverse) - result.append(", reverse"); //$NON-NLS-1$ - if(fUnderline) - result.append(", underline"); //$NON-NLS-1$ - result.append(")"); //$NON-NLS-1$ - return result.toString(); - } - -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/StyleColor.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/StyleColor.java deleted file mode 100644 index 8fa7e63439b..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/StyleColor.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import java.util.HashMap; -import java.util.Map; - -/** - * - * Flyweight - * Threadsafe. - */ -public class StyleColor { - private final static Map fgStyleColors=new HashMap(); - final String fName; - - /** - * @param name the name of the color. It is up to the UI to associate a - * named color with a visual representation - * @return a StyleColor - */ - public static StyleColor getStyleColor(String name) { - StyleColor result; - synchronized (fgStyleColors) { - result=(StyleColor) fgStyleColors.get(name); - if(result==null) { - result=new StyleColor(name); - fgStyleColors.put(name, result); - } - } - return result; - } - // nobody except the factory method is allowed to instantiate this class! - private StyleColor(String name) { - fName = name; - } - - public String getName() { - return fName; - } - - public String toString() { - return fName; - } - // no need to override equals and hashCode, because Object uses object identity -} \ No newline at end of file diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/TerminalTextDataFactory.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/TerminalTextDataFactory.java deleted file mode 100644 index e237adbbfd9..00000000000 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/TerminalTextDataFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Michael Scharf (Wind River) - initial API and implementation - *******************************************************************************/ -package org.eclipse.tm.terminal.model; - -import org.eclipse.tm.internal.terminal.model.SynchronizedTerminalTextData; -import org.eclipse.tm.internal.terminal.model.TerminalTextData; - -public class TerminalTextDataFactory { - static public ITerminalTextData makeTerminalTextData() { - return new SynchronizedTerminalTextData(new TerminalTextData()); - } -} diff --git a/terminal/plugins/org.eclipse.tm.terminal/tm32.png b/terminal/plugins/org.eclipse.tm.terminal/tm32.png deleted file mode 100644 index 3077b1220dd688632a42e347f90c90cb319835f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1q%}g3C{W4d;kClbxA})R9M5U zmtBlqRTam7``mNyow+m9DJ}i5)G6{^3K#>^Vu&CQ#25t%2}(?iH8BDb9!z*JrVsFh z@e3LvhL{Kv6&e(ZZ)if17NZ?PrfJJZm6}reF`b#tow*<9p1t>4%ZGFBbV`tz;J(?} z=bU@*`LFd~|FzcM4#3Q6z#z~l*8!jkB!B_|=m8nf1v2NH=VQkB=5YtO@*N3KF-ROF zR(zp=q-K_upd-L=IU7KIi2->D+y*M8(dwLw{{q61)R6vooD^;e)x0^M!1A=!8p;O?QUo+WFjz`#zY=vf#Y$%xB%% zJ;odRgoJJe&JtltX`T zEF?+dmT&vkw(+f7w|;Hy+O<~zOixcAyzTbe9!Ob?5%rS()xhPzC1$oPbo@~4g~4Dj zB?%`x#%v}SkT^#_;LbU4Wpr_4E~$TC{bk>|?9!oUckFoZhSjTAZ(6FAX0v$)sHGoL zYOU17a^NE897!d?YALOXkP}L@5(h)Ae{Yy6h69Rga3co}&V2XLM_=f!TGf4g-MV#a z@4ox)yS(?^?c2Bi*3?2$yb&#@2YR9F8=>Qgc_4_ADTJWJpol0UhKLn^R72DX15^tm zObbQ;=U~^a*BVbfwRcOq-EITy+`04D?;ksM+MtsHvCQ)vm~Wq27z>%dsya|b(hA*Z z%+L4e<$*kp^m;;`3o#1b3nGfCp(Qw`B^w49uB-;C_02cm{H3c7A3prrFP?bfRWqA2 zvxT(pHPFpwJB`+f=2t7#3VALxNeDsdWuXvS*OT=;Suc?F0(ohGl;Em@s(=-QI%hbH z#5o>(@Ec6e%s1}8|AF77sm)?G2ekSIWI+4OzfON$RU0bGR4dX0M3i1Hl65_;R!+N} z)9vK+a>4sR6eUJQC1M&elf^Lf^>XX2H?U>PCboV1VX|!5*5Tpq4-A`k&~av#KJw#V zhBd3s!?_}^l%>U)VdvDj;x0{7PEF16_PZ@{?=jOC-FJp0^>EHvAQ2qHqOHS~pn zf&6J86s6US8A&*tSE-7SM8!owq*x=EfT|!t`AoN<*9SqwBhe!gPzwwV4KX@8LbX<< zu0ms|!N!dj@Zt*-s3;NzGrb=86`*OK+H|1C;PN_1Bt}7_fEN%UjfGKZ6bMSCUI7cl z*h4~(7;{uSCIuU^1suzqtP8BB4bDHW}f21TQy zLD3kIP^2AEa6V%78jvl5OY9-yiQ)-i1=FWz2|g#ORA{$5?B0E-02k?t)11R5_DvK9 zNE9l|ps~CHk|4p5Xt)TKsH8!mWW{?y>WYdGVy~pXm=|tX#Z5O}&5p-+vVPq#BO`SV z95_aEu8oRfl!Z!_iG34BzrBVKaaBl1D_Art(I6Tc4T%m36)aY8(WnO_srLvW5Pjjf zYGBjG_0;MKKmFP7$$J?GXPc-hq7hRm%X2@y&gNBm-R5x@V?aeoD~_b%u$o~8Dv*eh z27~C(2q6HqoY*ZjAb~AgE+hJ!S6-PQ?`6agFf&91Q$8&PR-*Ff}mVXurq3_k5WrpZpVZb4|R@i6Nk>MPE<>XNxhnb9$cb zS~S3nszjmYd(_+#n0}8h_J3t(EAHE|%NyCd?Ec9~g7?G_5GhjZ9I;UrFsEhzHq30- z)YP7%XG7o^@WC@QJjCeeC}xKD#fGlBdiET2|hKocmGlYQs>;TL}6xnhPg9mFgr_m;vBf5BMuG@@bW)i<}Z~=YAb7~ zT2Wfd_N&<9UH}ZN54x!QSEr_4fB3_yN-=AM5LmNj4Qtn~#mwk*Isgn04bzHk{ylw+ zS6+UN=bm|vOTTwLkfRtPvGf`Y0W;JThZP??D>?_;K1$XpiK~U+IXyj1mSq?ad_YXt zqx(5He}tL#JoQ8KI0xS6{VmRiC@-ikB;0300e$GBJU<%(gBXQov$^Q`d~2R(_P>Cx zti$>NFo+TXhlt=@ike|oHWz1Q=JZzu>}lYksj1hGeq3UwII<8u8^*@iFt&jtar|)S zBOKlJHXCoe27hH0r;hViuI8j3r7<`}({e_J2K{|^-SoG~ci&_0=vP=1jFsVksT6ne96s zxS3BlQZrpR@4Qie^3P3q7gA}LOLR}O4_8I@@@gLG4Gxh^{y7T}5002ovPDHLkV1l5)GaLW_ diff --git a/terminal/readme.txt b/terminal/readme.txt deleted file mode 100644 index 3f318523fc8..00000000000 --- a/terminal/readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -The "terminal" folder holds the TM Terminal Component. -Its core depends on Eclipse RCP only and can be adapted to eRCP. -All these Git modules should be named "org.eclipse.tm.terminal.*". -See http://www.eclipse.org/tm/