[tcljava-dev] TCL/Java and integration into a gui based shell
Brought to you by:
mdejong
From: David L. Smith-U. <da...@ig...> - 2001-04-20 08:51:02
|
Hi all, I'm starting on a project to create a hybrid GUI/command line shell and I'm currently planning to integrate TCL/Java as the command language. The project will be released under an Open Source license. The basic idea I'm working from is that the command line is the most efficient way of issuing commands to the computer but a graphical display is the most efficient way of displaying the results back to the user. My goal is to create an interface where once you have your hands on the keyboard you don't need to shift to the mouse unless you are doing something where the mouse would give a significant benefit; also, once you are using the mouse you do not have to shift back to the keyboard until there's a real benefit. The ideas are fairly half-baked at the moment, but some of the things I'm working towards are: Command history in a separate window Ability to index output with command history (select the command, and then have the output of that command displayed also) XML output of commands with pipeline processing done via XML/XSL/Java/Tcl, output in XML could be piped through XSL to create HTML or into a Java bean. (How many times have you written scripts that dissect the output of ps or ls? Why don't we just tag the output properly?) Cross platform compatibility. I want to be able to run the same shell on Windows, Linux, Solaris, Mac OS, whatever and have a basic command set that I can rely on. At the moment, I have a very rudimentary version of this hacked together and over the next month or so I hope to get some more features in. Currently I'm trying to reconcile scripts/programs that ask for more input or use curses with my original (half-baked) enter command - execute - view results - enter next command model. I've run into some problems getting the Tcl/Java code integrated into a GUI environment. I've been able to hack together fixes but I don't have a deep understanding of the Tcl/Java code yet so I'd like to discuss what I'm seeing as deficiencies and see if others agree or if there are some points I'm just missing. I'm currently working with jacl1.2.6 - is this the right code to be working with? 1) The structure of public/private classes and methods. For example, ConsoleEvent is a private class to tcl.lang. This forced me to either make it public or put my command executive into tcl.lang so that it could issue ConsoleEvents ala Shell.java. Does anyone have an understanding of the public/non-public class structure and what classes/methods need to be protected from other code (like plug-ins) and which may have wound up non-public by accident? 2) TclEvents do not have a mechanism for polling or notification - there is a sync() method which will block execution but no way to ask "is it done yet" or to be notified when it is done (I think) 3) TclIO appears to be half finished. One of the problems that I found was that TclIO always returned a Channel that was attached to System.out for stdout. It also bypasses the interpreter's channel table when asked for stdin/out/err which makes it impossible to substitute a different channel for any of those three. Also, the Channel interface and classes are not public so once again you have to add things to the tcl.lang package to add new types of Channels. In my version, I've changed the way TclIO works with Channels. Stdin, stdout and stderr are named channels in the interpreter's Channel table and can be retrieved by their name. I've also added a ByteArrayOutputChannel class. Comments and suggestions? Thanks! Dave David L. Smith-Uchida Head Geek iGeek, Inc. Japan voice/fax: +81-3-5701-0955 US voice/fax: +1-877-384-7509 da...@ig... http://www.igeekinc.com |