Tweaking TN5250j
A quick and easy guide to modifying open-source projects
For many years, I’ve been using the free, open source TN5250j emulator to facilitate my communication with the IBM i command line interface. Some of the reasons I like it so much are it runs on all platforms I work with (i.e., Mac, Linux, Windows), it’s easy to download and install, and it can be modified to suit my needs if I so desire.
The last point of modifying TN5250j is why I’m writing this article, because I realized others might want to tweak the code base to address their own needs. The need (or rather, want) I had was a copy/paste snafu that was driving me nuts—specifically, when you copy characters off the TN5250j screen and paste them into an e-mail or other text-stream editor, it adds an additional new-line after the end of the character string and I always end up having to backspace to remove it. A small annoyance, yes, but I thought, “Heck, if it’s open source then, in theory, I should be able to make it exactly how I want it.”
This article documents the steps necessary to make a change to TN5250j by using the Eclipse IDE, Subclipse for obtaining the code from the SourceForge.net Subversion repository, and the Java programming language to alter the actual code within TN5250j. The steps are documented to the point of being able to complete the entire task without any foreknowledge of the aforementioned technologies, so no excuses for those of you who think it’d take to much time out of your day to learn something new. I’m a firm believer that learning a new programming language like Java can greatly benefit your RPG coding practices and give you new ideas for how to better your approaches to meeting business needs.
As with most of my article writing as of late, the following series of events are completely documented via video tutorial. Please let me know if you prefer the video approach or if the traditional way of putting every minute detail in text form is better.
The Setup
First things first, we need to download the Eclipse IDE, which includes a Java source code editor and also provides mechanisms to install the Subclipse plugin. Select the one named “Eclipse IDE for Java Developers.” Any of the ones supporting Java would work; we selected this one based on download size. Installing and running Eclipse is as simple as unzipping it to your desktop and double-clicking on the eclipse.exe file.
Next, we need to install the Subclipse plugin, which will let us communicate with the Subversion repository on SourceForge.net. Subversion is a version control tool that many software developers use to keep track of source code. SourceForge.net is where the authors of TN5250j have decided to host their project and source code.
Once Subclipse is installed, we need to go in search of the URL that points at the Subversion source code repository for TN5250j. We’ll enter that URL into a new Subversion repository within Eclipse. That allows us to peruse the repository structure and subsequently issue the “check out” action against the main project folder. Checking out just means we’ll be downloading the source code into our local Eclipse environment so we can view and modify the code.
Advertisement
Search our new 2012 Buyer's Guide.
Advertisement
Maximize your IT investment with monthly information from THE source...IBM Systems Magazine EXTRA eNewsletter. SUBSCRIBE NOW.
View past IBMi EXTRAs here
Related Articles
Web Exclusive | Rational enables development in multiplatform environments
Web Exclusive | Stretching the native Droid APIs for IBM i
E-Newsletter | Could cloud computing save you money?