Over a million developers have joined DZone.

Interview: Steve Clarke from TJI Java IDE

DZone 's Guide to

Interview: Steve Clarke from TJI Java IDE

· Java Zone ·
Free Resource
Celebrating its tenth birthday this year, TJI Java IDE, by Kinabaloo Software, is an IDE for Java SE developers, particularly those who are new to Java. Steve Clarke, who created it and continues working on it, is interviewed below.

Firstly, tell us a bit about yourself?

Interested in electronics from an early age, I studied that at university where we did some programming (Fortran) on punched cards (the last year to do so) and also learned some assembly language. I realised that the computer would be at the center of technological advance more so than electronics, but it wasn't until some years later that I took my MSc in Software Development at Coventry University in the UK, after some years dabbling in Basic and Pascal.

By then (the late 90s), the computer had become commonplace not only at work but in the home too—and Java was creating a stir as more or less the first truly Object Oriented language, with a leaning to the increasingly popular internet. Initially, the OO paradigm and event-driven architecture was sometimes made to seem unnecessarily complex and strange, but only perhaps to tutors steeped in procedural programming. Actually, OO design is a natural way of modeling a system.

When the time to carry out a project arrived, I decided to do something using Swing, which had just appeared and was not yet even a core package. Having used text editors and the command prompt in classes, I decided to design an IDE. After university, I implemented more of the design until it was a useful program. I think TJI, as the IDE became known, was about the first to use a tabbed arrangement of editors rather than internal frames as in the earlier versions of Sun's Forte IDE. On the machines of the day, Forte was rather slow so I was encouraged to continue.

I became a consultant specialising in the front-end at various companies including IBM WebServices where I designed and implemented an applet-servlet-JDBC reporting system for their online learning courses. Interestingly, only some of the developers there used IBM's own Visual Age (that would later become part of Eclipse); some used JBuilder and some plain text editors. I stopped using VisualAge when my latest source code was lost in its 'Object Repository' and returned to using TJI.

What is TJI ?

TJI is an entry-level Java IDE that is ideal for beginners, for those wanting to 'upgrade' from using the command line, and for the education sector (there is multi-user functionality built in). Plus, anybody else whose focus is on Standard Edition Java (rather than Enterprise Java) and who likes the look and feel of this IDE.

(More screenshots here.)

While an IDE aims to increase productivity, I also wanted to emphasise usability and the aim has been to make using TJI possible straight from the box, without need for recourse to a manual (although there is one). This involves deciding what to include, how features are arranged and labelled, and lots of context-sensitive popup menus and tooltips. This ease of use is designed to allow developers to focus productively on their tasks, hardly aware of the tool being used.

TJI is written entirely in Java and runs surprisingly fast. It starts and is ready in under two seconds. Many modules are not loaded into memory unless called upon, and also open fast. There are obviously some advantages in an IDE written in Java that is for Java—there can be a greater understanding of the source code and Java objects.

While a few people may still debate the negative impact of an IDE on the programmer (overhead, dependence and, particularly, use of code generation beyond simple shortcuts), certainly some things are inarguably useful—syntax coloring and indicating the location of compile-time and run-time exceptions in the source code, for example. It was this type of feature that TJI most focused on, although other features have been added over time. Certainly I wanted to keep the learning curve as short and flat as possible.

I frequently review the IDE not only for usability, but also robustness and performance—and positively welcome feedback from users.

Why is it called "TJI"?

Well, originally it did mean "The Java IDE", the idea was to call it simply what it is, but perhaps it sounded a bit pompous. So the name changed to just "TJI", which has a nice sound to it.

What are the basic features?

TJI is project based. One can create a new project from customisable sets of templates for various project types. One can open multiple projects. There is automatic HTML format project documentation that includes JavaDoc comments.

TJI automatically adds required import statements if not yet existing. TJI can automatically add accessor methods when adding a field. TJI has syntax checking (optional because it can be considered distracting), code completion, word completion (already used words) and custom substitutions (such as 'sop' for 'System.out.println'). There are also shortcuts for various control statements such as 'if ( ) { } else { }' which can be invoked by a typed key or selected from a menu.

TJI provides a basic level of support for 'round trip' UML modeling (class diagram):

It also provides support for JSP and servlet programming with its in-built web server (and internal or external web browser) and JSP engine and database programming with its inbuilt DBMS and JDBC driver. The main purpose of this in-built support is to facilitate the learning of these technologies. Although the supported features are limited, useful applications can be constructed using them. One can always use TJI with an external webserver and database such as those from Apache.

TJI also provides support for JSP and servlet programming with its in-built web server (and internal or external web browser) and JSP engine. It also supports database programming with its in-built DBMS and JDBC driver. The main purpose of this in-built support is to facilitate the learning of these technologies. Although the supported features are limited, useful applications can be constructed using them. One can also use TJI with an external webserver and database such as those from Apache.

TJI offers refactoring support for base directory, package, class/interface and method. TJI also offers automatic 'tracing':

This is not the usual redirection of system output to a file; TJI shows all method entries and exits, values of fields when declared or set, and parameter values. Time spent in each method is also shown. If the program crashes, the exception details and stack trace are appended. In this way, TJI's tracing offers an alternative way of debugging. TJI allows you to halt a program that is in an infinite loop.

TJI automatically maintains a rolling 10 backups of project source files which can be viewed and restored.

How did the project come about?

TJI begain life in 1998, so it is celebrating its tenth birthday this year. TJI has been developed on and off over that period.

With Eclipse and NetBeans (derived from Sun's Forte) becoming free it seemed like the end of the line for TJI at first, but I continued to prefer it and realised that it still had its place. As IDEs generally become ever more complex, the gap between those IDEs and simply using the command line widens, creating a larger niche for TJI.

I added the 'round-trip' UML class diagram view and multi-user functionality to appeal to universities and colleges. I also added a set of Java tutorials within the program and made accompanying project source files available online.

Then I developed the 'Java Guru' API assistant module which I realised made a good spin-off product that would be useful alongside any IDE or editor. The Java Guru provides fast and flexible access to the Java API.

This featured in 'Swing Sightings' on Sun's website in 2005. Java Guru will retrieve the API documentation from online if it is not existing on the host computer. The Java Guru can also find example code use from respected online sources.

Recently, I developed the postcard designer applets at www.jungletop.com using TJI.

This spring I updated TJI for Java 1.6. The main changes concerned the compiler and syntax checker—I could now use the new javax.tools package. I decided to no longer support Java versions below 1.6 because each involved use of undocumented classes and methods in accessing the compiler and it was becoming tricky to support them all.

This year is TJI's 10th birthday. Can you go through the main developments, year by year?

Starting with the core - project organisation, compilation and program run systems in 1998, the system was expanded with syntax coloring and automatic JavaDoc-style project documentation in 1999. Framework projects, based on modifiable templates, and a multi-stage source file backup system were added in 2000.

In 2001, project import and export functionality was added, together with editing features such as drag and drop, brace pair highlights, search in project, undo and redo, split view, and automatic tab formatting.

The first 'Java Guru' API help system was created by 2002. The Java Guru was initially based only on reflection but with the twist of a sortable table for methods. Incorporation of the HTML API documentation extended its usefulness and this module was released in a standalone version around 2004.

With an eye to the education sector, many Java and OOD tutorials were added, with companion projects in 2003. This was followed in 2004 by the UML View - a class diagram with popup dialogs to show the fields and methods and which allows the adding, removing or editing of elements. The code and UML views are automatically synchronised.

In 2004, two GUI Builders were included. One uses absolute positioning of components on a JPanel and the other employs layout managers and allows nesting of containers. Also, intelligent refactoring of base directory, package, class and method.

In 2005, the internal web server and JDBC database features were added to aid the learning of these important technologies. The support is somewhat limited but allows the development of real applications using servlets, JSP and SQL.

In 2006, live syntax checking was added together with code completion of various kinds. Also, multi-level code folding, with 'keep existing folds open' by clicking with the right muse button. In 2007, TJI's own style of tracing was added; this very useful feature works as a debugger as well as profiler.

During 2008 TJI was updated for Java 1.6. A number of changes have also been made throughout to improve further the ease of use and overall design.

What are some of your favorite features?

  • One big feature is the 'Java Guru' API help tool that presents a sortable table of methods for any class. This is based on reflection so it works without the Java API documenttion being present. One can search for a class without knowing the full package name and search for a method, in which case all matching methods (or the first 100 in some cases) are shown to choose from. The class/interface or method name can be typed in, selected from a menu or Java Guru will take its cue from the text at the current editor caret position.

    If the HTML API documentation is available, the relevant description is extracted from it and shown for any selected package, class/interface or method. Clicking on a hyperlink will update the Java Guru system. One can also view 'Uses of a Class or Interface' - subclasses / implementing classes, and methods that take that class/interface as a parameter or return it. Although first relaesed as part of TJI in 2003 and improved in 2005, as far as I know it is still rather unique. Java Guru is available as a standalone system that can work alongside any IDE or editor; it will take its cue from what is on the system clipboard.

  • One small feature that I find very useful and not yet copied (again, as far as I know) is being able to type a space as a tab at the start of lines (the spacebar is far easier to reach when typing). Also, a multiple-entry clipboard has been a part of TJI from the beginning and is still not in all IDEs despite its usefulness.

  • One recent change is interesting. This offers the option of a black background for the editors. This might sound like just a style thing, something cool for hard-core geeks who might miss the terminal window. But in fact this presents less stress on the eye muscles and the text itself is considerably more vivid. So much so that I immediately noticed a small error in our syntax coloring system (now fixed) that I hadn't noticed in years! I think that although it will not be to everyone's taste it might even offer a measurable productivity boost.

  • The auto-layout of the UML class diagram presented an interesting problem. My appraoch was to put the main class in the center and then use a simple form of evolutionary algorithm based on natural selection. Classes are placed at random available places and a score for total distance of all connections calculated, with a big penalty for crossed connections. After a number of iterations, the best 'solutions' were modified in a couple of ways, again at random, to create the next trial set. Once a target score was met or the number of interations passes a particular value, the solution is presented. It works well.

What future developments can we expect TJI to undergo?

The GUI designers could be improved, perhaps with some new Layout Managers, and I might look again at debugging and support for Java Beans among others.

One thing that consistently interests me is to move away from source files as such and allow the programmer to focus on classes, their fields and methods, such that one only ever edits methods and not whole source files (class and interface definitions and fields would be entered by dialog). If I remember correctly, IBMs Visual Age was a pioneer of this approach and I think it is a good one. It is something I would like to explore further, without going so far as a CASE tool. For now, code folding helps somewhat in this regard.

PlugIn modules that add functionality to the IDE can be developed using a simple API. This enables existing plugins to be customised, improved or extended - and new functionality added by you or others as a plugin development community builds around TJI.

Plugins can optionally have their own GUI panel. As an example, the Custom Shortcuts that allows the user to define say 'sop' as short for 'System.out.println' is actually a plugin that adds an item to the Edit menu. When you type 'sop' followed by a space this is changed into 'System.out.println'. This plugin is so useful that it is bundled with TJI - on first run, the plugin jar is deployed to the modules folder. 'Comment / Uncomment' and 'Enclose Selected Text within a selectable 'block type' - for example, if () {...}' is also provided by this bundled plugin.

The public plugin API is described on the website and includes example source code and suggestions for plugins. Basically, a plugin needs to implement interface TJIModule. This defines the nature of the plugin and declares methods start() stop() and changeOccurred(changeID), plus a few other methods such as getAuthor(); in effect, it allows TJI to speak to the plugin. The start(IDE) method is called when TJI is ready and passes a reference to itself to the plugin (TJI implements interface TJI which defines what the plugin can see and do with the IDE). The start() method returns whether the plugin requires its own GUI panel.

The second larger interface (TJI) makes available the core IDE features to the plugin. So, for example, a plugin can find out what projects are loaded, the currently in-focus one, etc. call certain functions, such as to create a new project, and make use of certain resources such as the file browser.

Any final thoughts to share?

TJI Java IDE and the standalone Java Guru are free to try and are covered by the same license, which costs USD $39 for a single user, with multi-user licenses available. Go here to download it!



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}