lickEdit’s latest editor (version 11) provides new features such as code templates, comment auto-generation, Regex evaluator etc. This article provides an overview of how SlickEdit’s features function in the context of building a J2EE application. The test application contained several different file types, including Java, JSP, XML, and HTML, so I could thoroughly explore SlickEdit’s various editing features.
To perform this review, I first defined a list of features and functionality that I think are desirable in a code editor. I then created a new project to develop a Web application using SlickEdit’s “New Project” and “New File” creation options. I modified the various source and configuration files in the project using SlickEdit’s code editing and refactoring features. I then deployed the application in a Tomcat servlet container, to test SlickEdit’s debugging features. Finally, I’ve provided a summary section listing SlickEdit’s features and comparing them with other editors and IDEs so you can see how SlickEdit stacks up against its code-editor competition.
|What You Need
|SlickEdit editor, Tomcat 5.5 servlet container, JDK 1.5, Apache Derby Database Server
Installation and Configuration
SlickEdit is easy to install and configure. The installation process is straightforward and the default settings are sufficiently well-thought-out to get you started without problems. I installed SlickEdit on a Windows 2000 machine. The install program automatically starts when you insert the CD in the drive, but you can also double-click the setup.exe file in the “Windows” directory of the install CD to start the installation. I usually install all the software programs in a tools directory, so I elected to install the tool to C:dev oolsSlickEdit (the default directory is C:Program FilesSlickEdit). I accepted the defaults for all other options during the installation process.
Table 1 shows the software and hardware specifications of the PC I used to test SlickEdit features.
Table 1. Test PC Specifications: The table shows the software and hardware specifications of the PC used for testing.
|Windows 2000 Professional Edition
|1.5 (SlickEdit supports JDK versions from 1.2 all the way upto 5.0)
|SlickEdit Install Directory
|Java Project Directory
SlickEdit supports several different platforms and operating systems, and has the system requirements shown in Table 2.
Table 2. SlickEdit System Requirements: The table shows supported OS’s and the system requirements for the Windows version of SlickEdit.
|Windows, Linux, UNIX, Mac OS X
|170 MB (for Windows)
|256 MB recommended
|$299 for new licenses ($139 for upgrades)
After the installation is complete, double-click on the vs.exe file (located in the win folder created under the SlickEdit main install directory) to launch the editor. Figure 1 shows the main window of SlickEdit after it’s has been launched.
|Figure 1. SlickEdit’s Main Window: Here’s how the editor looks when you first launch it after installation.
When you launch SlickEdit for the first time, you will need to configure the settings for the different types of source files (such as Java, JSP, XML etc) you plan to edit. You do this by setting the auto tagging for run-time class libraries on “Automatic Tagging for Run-time Libraries” dialog. SlickEdit uses the tagging information to provide Auto Function Help, Auto ListMembers, and Class Browsing?thus saving time you would otherwise spend searching for code in your source files. To create tag files, enter the base directory for your package(s) as well as the destination of the tag file.
Tutorials and Documentation
I ran the Java tutorials that come with the SlickEdit installation. They are simple and intuitive and easy to build, deploy, and test. Also, SlickEdit has the standard Windows help where you can search for any help items or select them from the contents tab. The help module was very helpful to me in setting up the classpath for the test Web application. I will explain later how to set up the classpath setting for Java project.
The latest version of SlickEdit provides features such as code templates, comment auto-generation, enhanced search-and-replace functionality, a Regex evaluator, built-in code refactoring capabilities, etc. I tried out most of these features while working with Java classes, HTML scripts, and XML configuration files.
Desirable Editing Features
I am a big fan of Agile software development concepts based on test-driven development (TDD) and continuous integration coding practices. So, iterative development, debugging, and code refactoring are very important to me when I have to choose a software development tool. I would like the tool to support features such as automatically importing run-time libraries and OO programming features, and it should aid in maintaining existing code by providing search-and-replace and refactoring features.
Among the list of the features I look for in a typical code editor are:
- Code Templates to create new project and source files
- Code refactoring
- Continuous Integration (meaning the editor works with a build tool like Ant)
- Debugging (both local and remote)
- Built-in integration with a software configuration management (SCM) or source control tool
- Context sensitive help/code completion
- An auto/organize imports feature
- The ability to search for a resource file?without specifying whether it’s a Java class file, or a JSP script, or a configuration file
- The ability to highlight syntax errors (preferably in red text) which provides a good visual indication of errors that developers can fix before compiling the source files
Working with SlickEdit
I built a test Web application called JDBCApp to test the editing features of SlickEdit and see how it helps programmers achieve the above-mentioned objectives. This simple Java application has some JDBC code that runs a SQL query. The application includes several file types, including Java, XML, SQL, properties, HTML, JSP etc., as shown in the following file list:
The test project is a loan-processing application that includes a startup HTML form where users enter a Loan ID for which they want to get loan details. When they submit the form, the HTML page calls a servlet running in a Tomcat servlet container that in turn calls a DAO object that accesses the back-end database to retrieve the loan details. These details include the borrower’s name, the loan amount, the loan expiration date, and so forth, which the application displays via a JSP page.
Creating a New Project
To create a new project select the “File –> New Project” menu, and then select “Java-Empty Project”. Enter the name (JdbcApp) and location (c:devprojectsJdbcApp) for the new project. This will create the workspace (JdbcApp.vpw) and project (JdbcApp.vpj) files required for the Java application.
Version Control Setup
After creating the new workspace you can associate the workspace with a source control system (such as PVCS or CVS). To do this, right click on the workspace node in the Projects window and select Version Control –> Setup options. SlickEdit supports several different source control systems (SCMs) such as ClearCase, CVS, PVCS, Subversion, etc. I used a local Subversion repository to store the files in the Java project. SlickEdit’s integration with Subversion (or any other SCM tool) lets you check-out, modify, and check-in files from the repository, run difference reports for files modified on the local machine against the source files in source control system, and merge local code changes with the repository.
SlickEdit provides context-sensitive help when creating or modifying HTML files, which makes the task of adding HTML elements very easy. You don’t need to be an HTML syntax expert. You can open HTML Web pages in a Web browser from within the editor, which saves time and increases Web designers’ productivity.
Editing Java Classes
SlickEdit provides various templates for creating different types of Java classes such as Java AWT applet, Java servlet, JSP, entity and session EJB classes, and JUnit Test Fixture?pretty much all the Java classes you need in a typical project. But if that’s not enough, you can also add any custom templates that you need in your projects.
I created two Java classes in the test project: an HTTP servlet and a data access (DAO) class. SlickEdit provides several Java code-editing and refactoring features such as context-sensitive help, auto/organize imports, and resource search capabilities that are useful when modifying Java source code. I would like to see the product be able to highlight syntax errors as you are editing the code (the Eclipse IDE has this feature and I find it very useful to see syntax errors immediately instead of waiting until the class is compiled).
When creating a new Java class the editor automatically creates the required directories for the specified package?you don’t have to specify the package and class names. This feature adds to SlickEdit’s productivity, because you don’t have to manually create new directories for each new Java package.
It would be nice if the tool had an option to auto-generate getter and setter methods for the attributes defined in a Java class.
JDK Compiler and Classpath Settings
One thing to note is that you need to set the classpath in the project so SlickEdit knows which directories to look in to find third-party run-time libraries (such as java.servlet.HttpServlet or org.apache.derby.jdbc.EmbeddedDriver). Here’s how to set the classpath to compile the Java files and build the Web application.
First, right click on the project node and select “Java Options.” Then set the compiler options such as the JDK installation directory (on my local environment this directory is c:devjavajdk1.5.0_06) and settings like nowarn, verbose, and source and target (both 5.0) compliance levels.
Next, click on the Classpath tab and add the required JAR files to the classpath list. Add the .jar files for Java classes that are not in the JDK src.zip file (for example javax.servlet.HttpServlet) to get the auto-complete and auto-import features to work correctly.
SlickEdit uses the concept of Tag Files to provide options for setting the run-time libraries. To use it, open the Tag Files dialog (click Tools –> Tag Files menu options) and highlight the java.vtg file under the “Java” Tag Files node, and then add all the files that you have specified in the classpath. This is an additional step that’s not required when using other IDEs such as Eclipse, where the editor automatically looks in all the JAR files specified in the classpath when performing auto-import or auto-completion of class names. But it works; after you modify the tag file, SlickEdit automatically imports any Java class that you will be using in your code.
I like the “Organize Imports” option, which is similar to an option in the Eclipse IDE?it automatically imports the fully-qualified names for all the classes used in the current class so you don’t need to import each and every Java class referred to in code.
SlickEdit comes with a powerful debugger that you can use to run Java applications in debug mode and step through the code. I used the debugger feature to connect to the Tomcat server hosting the Web application. To do this, start Tomcat with remote debug enabled and connect to the Tomcat JVM from SlickEdit using the following procedure:
|Figure 2. Debug Configuration Window: To debug, specify the server name and the remote debug port number.
- Stop Tomcat, and then modify Tomcat’s startup script catalina.bat (located in the bin directory under the Tomcat main directory) adding the following JVM arguments to enable remote debugging when you restart Tomcat.
- After Tomcat is running, click the Debug menu option in SlickEdit and select Attach Debugger?> Attach to Java Virtual Machine. (Note: SlickEdit also has the capability of remotely debugging a .NET program).
-Xdebug -Xrunjdwp:server=y, transport=dt_socket,address=4143,suspend=n --ea
Figure 2 shows the configuration window where you specify the server name and remote debug port number.
When you’ve configured the debugger, you can set break points in the source code and debug the program. By using the SlickEdit debugger Java programmers can both look at their code in run-time mode as well as refactor it. Figure 3 shows a screenshot of the debugger window with a breakpoint set in the servlet class.
|Figure 3. Debugger Window at Breakpoint: Here’s what the debugger window looks like after setting a breakpoint in the servlet class.
To get back to source mode (where you can view the project hierarchy pane, select a source file, and modify the source) from debug mode, select View?> Toolbars?> and click on the Projects name. This brings up the Projects toolbar where you can modify any of the source files.
In addition to the features already discussed, SlickEdit offers several other interesting features that can add value to your editing experience.
Code Templates. Code Templates let you define and instantiate frequently used code files. When you create a new file, SlickEdit displays a list of file types. As shipped, SlickEdit provides templates for several different types, including Java, JSP, HTML, C Shell, C#, Cobol, PHP, Python, Ruby etc.
Macros. I used the Macro function in SlickEdit to parse a tab delimited text file and select only the columns I needed to copy into an Excel spreadsheet. This feature saves a lot time and frustration if you have to parse any text files. You can write all the parsing logic using a scripting language such as Perl but SlickEdit provides most of those functions with its Macro feature.
Regex Evaluator. I didn’t test this feature extensively, but it will be useful if you use regular expressions (Regex). Using Regex Evaluator, you can dynamically create regular expressions and validate them before actually using the expressions in your code.
FTP. The FTP feature in SlickEdit is very helpful if you need to transfer files to a remote computer on the network or on the Internet. I was able to copy the Web application WAR file from my local machine to a Dev server on my network without having to open a separate FTP client or transfer the files from a command line.
File Differencing (DIFFzilla). You can compare two files using SlickEdit’s File Difference feature. Select the Tools?> File Difference menu option to open the DIFFZilla window, which lets you select two versions of the same file or two different files to compare (see Figure 4). Additionally, you have the option to compare multiple files in a directory. You can select typical file-compare options such as ignoring trailing spaces, not comparing new line characters etc.
I usually run the Beyond Compare file comparison tool, but I found DIFFZilla to be very intuitive in showing the differences in the files. In addition to displaying the file differences the SlickEdit File Diff tool also lets you merge code from two files to the other and save the files individually. You can see how visually intuitive the file difference window is and how easy it is to merge the file changes.
|Figure 4. Comparing Files: The figure shows two versions of the test servlet class being compared.
SlickEdit integrates with two of the popular IDEs through its Eclipse Plugin and SlickEdit Tools for Microsoft Visual Studio 2005 to help increase the productivity of Java and Microsoft developers respectively. I haven’t tried these tools but they should enhance the developer productivity whether he/she is working on a Java project (using Eclipse) or a .NET project (using Visual Studio). The plug-in tools do not come with SlickEdit, but they are available as separate products.
SlickEdit’s technical support is excellent. I submitted a list of questions regarding the project configuration and within minutes I received a case number for my e-mail request. The support group followed up with an e-mail containing responses to my questions. The responses were exactly what I was looking for and I was able to resolve the project setup issues and move forward with the application development.
Overall, I really liked SlickEdit tool for its Java code editing and refactoring features. Its integration with a source control system was a big plus for me. I was able to create, modify and edit several different file types required in a typical Web application without having to switch between different IDEs or text editors. With its “Code Quick, Think Slick” motto, SlickEdit provides a developer-friendly code editor suitable for creating, manipulating, and transferring multiple source file types for both enterprise application development and deployment.
One cool thing about SlickEdit is that it provides several code templates you can use to add new features to your workspace. You can also add your own templates (much like custom plug-ins in Eclipse) to enhance the feature set and customize the product for your own needs.
This tool also provides a very good interface to write and execute JUnit test scripts from within the editor which will be a great help for those who follow TDD-based application development.