RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Product Review: SlickEdit v11  : Page 2

SlickEdit's latest version is indeed slick, supporting advanced editing capabilities for multiple file types, but it lacks a few features offered in other editing environments.

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:

  • LoanAppDetails.html
  • LoanAppDetailsServlet.java
  • LoanAppDetailsDAO.java
  • LoanAppDetails.java
  • loanapp.jsp
  • loanapp.js
  • web.xml
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:\dev\projects\JdbcApp) 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.

Editing HTML and JavaScript Files
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.

I wrote a simple JavaScript method to validate the user-entered input data before retrieving the loan application details. I liked SlickEdit's keyword color-coding, which makes it easy to work with JavaScript functions.

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:\dev\java\jdk1.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.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date