Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 165177

Summary: [terminal] split the plugin into the terminal view and connection contributions
Product: [Tools] Target Management Reporter: Michael Scharf <eclipse>
Component: TerminalAssignee: Michael Scharf <eclipse>
Status: CLOSED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, javier.montalvoorus, mark.melvin, martin.gutschelhofer, nobody, norbert.ploett, sridhars
Version: unspecified   
Target Milestone: 1.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Scharf CLA 2006-11-20 11:54:31 EST
Currently, the terminal view is one plugin that contains a terminal widget, a view, a dialog to setup connections, and an implementation of a serial and a telnet connection. All this functionality is very interdependent and lives in one package. I started to extract the functionality into separate packages. I also introduced interfaces between the different subsystems (widget, view, connection setup and connection). The goal is to make a terminal widget that can be used in different contexts. The connections should be provided by the new ITerminalConnection interface. The plan is to provide connections for telnet, ssh and serial. Because there are licence problems with different serial implementations (e.g. the sun javacomm http://java.sun.com/products/javacomm/), it will be possible to ship those connections in speparate plugins.

The TerminalWidget would need an ITerminalConnection. A terminal connection basically provides an InputStream and an OutputStream plus a few methods to get notified on changes of the terminal size and methods for lifecycle eventss. The terminalWidget is a SWT/JFace control.

When this basic refactoring is done, the next step is to split the terminal into separate plugins. Here we have to find a good split that the terminal can be used in different contexts (RSE, Debugging, stand alone). Therefore I think the basic terminal plugin(s) should not provide a terminal view. Instead, on top of this basic functionality, a stand-alone terminal view can be implemented. But it is also possible to implement other views/editors/dialogs that use the TerminalView and ITerminalConnection. E.g. RSE could use the terminalWidget to implement a terminal that is tied to a subsystem. For device debugging, the terminal widget could be used to connect via serial line to the target. 

Because the terminal widget provides a basic ansi (vt102) terminal emulation, it should be possible to build a command line editing tool on top using something like a java implementation of the readline utility (e.g. http://sourceforge.net/projects/jline/). That could be used to implement something like the current RSE shell on top of the terminal widget....
Comment 1 Martin Oberhuber CLA 2006-11-21 05:43:24 EST
Here's a starting point for discussing a possible split of plug-ins:

* The Terminal Core Plugin, which contains the vt102 emulation and the SWT
  widget, should have minimal dependencies. Ideally, it should be able to run
  in an RCP application, see http://wiki.eclipse.org/index.php/RCP_FAQ#What_is_included_in_the_Rich_Client_Platform.3F 

* In order to avoid an explosion in the number of plugins, when the standalone
  Terminal View can live with RCP dependencies only, I could imaging having it
  in the core terminal plugin as well. If it needs more dependencies, I'd vote
  for putting it in a separate plugin. Capabilities could be used to hide the 
  Terminal view when an application doesn't want to see it.

* The terminal core plugin should also contain the basic interfaces for 
  contribution terminal connectors, like the serial, telnet, ssh, rse or
  debugconsole ones. Each of those should live in its own plugin.

With this suggestion, we could have the following plugins:

org.eclipse.tm.terminal         --  core vt102 emu, swt widget
org.eclipse.tm.terminal.view    --  stand-alone terminal view using the widget
org.eclipse.tm.terminal.serial  --  serial connector
org.eclipse.tm.terminal.rse     --  rse connector

Comment 2 Michael Scharf CLA 2006-11-30 22:32:46 EST
I checked a first version of the new plugin structure in. It's not finished but seems to work. 

org.eclipse.tm.terminal         --  core vt102 emu, swt widget
org.eclipse.tm.terminal.view    --  stand-alone terminal view using the widget
org.eclipse.tm.terminal.serial  --  serial connector


The serial plugin does not compile unless you have installed the java comm library into your jre lib/ext directory (http://java.sun.com/products/javacomm/).

I created 3 plugins and 3 feature plugins.

I created a (temporary) update site: http://www.scharf.gr/eclipse/org.eclipse.tm.terminal-update
To run the serial terminal you have to have the java comm library installed.

I increased the number of classes and interfaces during the restructuring (there were a few big classes with many inner classes), but the total lines of code (without comments and empty lines) decreased by 15%. It's now about 4500 lines. I hope to decrease the size in the future (my goal is to reduce another 15%)....
Comment 3 Martin Oberhuber CLA 2006-12-06 14:27:10 EST
A first cut of the terminal is now checked in. It's currently available out of CVS only, best use the Project Set from
http://www.eclipse.org/dsdp/tm/development/cvs_setup.php

For the Serial plugin, see the readme.txt in the plugin
Comment 4 Michael Scharf CLA 2006-12-11 17:24:49 EST
I consider this task done....
Comment 5 Martin Oberhuber CLA 2006-12-15 20:29:03 EST
Verified with M20061215-0955.
Closing.
Comment 6 Martin Oberhuber CLA 2006-12-15 20:34:44 EST
Verified with M20061215-0955.
Closing.