Very
interesting article
Tutorial Details:
Power Java programming?free!
Power Java programming?free!
By: By Robert Swarr
Build an open source IDE with jEdit
ometimes the best things in life are free, like fresh air and sunshine, but not software. Until recently, a professional-grade IDE could have cost hundreds or even thousands of dollars. However, after Linux entered the marketplace, open source software proliferated and became competitive with commercial software. Today, open source development tools are as free as fresh air and sunshine, and just as plentiful.
For example, the jEdit programmer's editor is an open source utility with advanced editing features. Using jEdit plug-ins, you can integrate open source development tools such as CVS (Concurrent Versions System), Ant, and JUnit within jEdit's graphical user interface (GUI). This article shows you how to transform jEdit into an IDE comparable to proprietary software. In this article, I use the term open source software instead of free software. To set the record straight, " Sidebar 1: Open Source Software = Free Software " explains the similarities and differences between open source and free software.
IDE features
The first step in building an IDE is answering a simple question: what features should the IDE support? Many developers request features in the following list. These requirements may be the same for you:
Small, fast, intuitive, but powerful programming editor: it starts up and responds quickly; you can use it without spending hours reading documentation; and it has powerful features such as advanced search and replace
Source code beautification: configurable, programmatic formatting of Java source files to a consistent standard
Class browser: tree-structured view of the methods, data members, and inner classes in a Java source file and point-and-click navigation through the file
Project view: tree-structured view of a project's files and point-and-click navigation through the project
Version control: integration with CVS with a graphical interface
In-process compilation: compilation of a Java class in the current edit buffer
Unit-testing framework: integration with JUnit to run automated regression tests within the IDE
Build management: integration with Ant to run build scripts for a project within the IDE
Integrated debugger: when code behaves badly and you don't know why, having a debugger in your toolkit is a blessing
Integrated Javadoc generation and viewing with a graphical interface
You might want to add additional features to the above list based on your requirements.
Build the jEdit IDE
Once you've defined your requirements for an IDE, download and install the software. If you don't have a Java SDK, download one . The development tools need jar and executable files included in the SDK, but omitted from the JRE (Java Runtime Environment).
Installing jEdit is as simple as downloading and running an executable jar file. From the jEdit project homepage , select the Quick Start page and follow that page's directions. Read the installation instructions for your operating system on the download page. To run jEdit, use the Java application loader (javaw) in the SDK, not the JRE, since the development plug-ins will not work properly with the JRE.
Note: Due to strong corporate backing, NetBeans and Eclipse have received much more press coverage than jEdit. If you're wondering why someone would pick jEdit over NetBeans or Eclipse, see " Sidebar 2: jEdit Versus NetBeans and Eclipse ."
Downloading jEdit plug-ins is equally simple. Using the Plugin Manager, simply point and click?no analysis required. The Plugin Manager resolves dependencies and automatically downloads any jar files required by the plug-ins you select. The following is a list of the plug-ins that provide the features discussed earlier:
AntFarm: integrated graphical Ant build manager
JavaStyle: Java code beautifier and template Javadoc comment generator
JBrowse: class browsing of a Java source file
JCompiler: in-process compiler for Java files in the edit buffer
GruntspudPlugin: a graphical CVS client that supports most CVS commands and many connection methods, including local, pserver, and ext
JIndex: with a single key-press, shows Javadoc API HTML documentation for a highlighted word
JUnitPlugin: integrated graphical JUnit test runner
ProjectViewer: tree-structured view of related project files
Swat: integrated graphical interactive debugger
JDocPlugin: integrated graphical Javadoc generation
You might want to install additional plug-ins based on your requirements (the jEdit Website lists 80 plug-ins). Also, jEdit automatically downloads some plug-ins such as the Common Controls and Console plug-ins to resolve dependencies between plug-ins.
To install plug-ins, from the jEdit menu bar, select Plugins, then Plugin Manager. Next, click the Install Plugins button at the bottom left of the Plugin Manager dialog box. On the Install Plugins dialog box, check the boxes for the plug-ins you want to download (see Figure 1); check the box labeled Download Source Code; select the radio button labeled Install In User Plugin Directory; and click the Install button. The plug-ins should download in a few minutes (assuming a high-speed Internet connection). Restart jEdit and you're ready to start programming.
Figure 1. Install plug-ins
Configure and use the jEdit IDE
After installing jEdit and the plug-ins, configure your IDE using the Utilities command from the Global Options menu. Most plug-ins require little if any configuration. If you have any questions about configuring a plug-in, select the Help menu?interactive help is part of the plug-in architecture.
To improve ease of use, you'll want to "dock" frequently used plug-ins such as Gruntspud, ProjectViewer, JBrowse, AntFarm, and JUnit. Plug-ins can either float or dock on one of the four sides of the jEdit window. Docking a plug-in allows you to minimize it to the side of the edit window and launch it quickly by clicking on the plug-in's tab. To configure docking, select Utilities, Global Options, jEdit, Docking; set the docking position for these plug-ins to the location you prefer; and click the Apply button. Tabs for these plug-ins will appear on the jEdit window side that you picked (see Figure 4).
You'll also want to configure the Console plug-in to display a console toolbar for entering operating system commands within jEdit. To configure the console toolbar, select Utilities, Global Options, Plugins, Console, General, and check the Console Tool Bar box.
I next describe configuring and using several of the more important plug-ins: Gruntspud, ProjectViewer, AntFarm, and JUnit. The rest require little if any configuration, and using them is intuitive.
Gruntspud
Gruntspud is a CVS client, so knowledge of CVS is a prerequisite for using it. The following example uses a local CVS directory to create a working directory of the downloaded JDocPlugin source code in a directory named \javapkgs\src (I refer to the JDocPlugin project in this article's later sections).
First, select the Gruntspud connection dialog box from Global Options and configure a local connection. For my configuration, I used the name localCVS , for a local type and a repository path of C:\CVS. Click the Add button on the Add Connection dialog box and the OK button on the Global Options dialog box to store the configuration.
Next, import the JDocPlugin project into the local CVS repository. To import this project, select Plugins, then Gruntspud; click the All Tools icon on the toolbar's left-hand side (an image of a crossed wrench and screwdriver); and select Create, then Import to display the Import dialog box. On the Import dialog box, complete the General pane as shown in Figure 2; enter the version message on the Message pane; click the Rescan button on the Files pane; and then click the Import button.
Figure 2. Gruntspud Import dialog box
Finally, create a CVS working directory by checking out the JDocPlugin module from the CVS repository. Select Create, then Checkout to display the Checkout dialog box. Navigate to \javapkgs\src and set the current directory to the JDocPlugin directory's location. Select the General tab, type JDocPlugin for the module name and checkout name, and click the Checkout button. After the checkout executes, Gruntspud displays the CVS working copy's status. Click the Explorer tab in Gruntspud, select one of the Gruntspud files, then right click and select Status. Figure 3 shows the Gruntspud display of a CVS working directory.
Figure 3. CVS working directory
ProjectViewer
Use the ProjectViewer plug-in to view and edit the JDocPlugin source files. First, create a JDocPlugin project. Select the ProjectViewer tab, left click the All Projects folder and select Add Project. Type the project name JDocPlugin. Open the JDocPlugin root directory that you created in the CVS configuration ( /javapkgs/src ). Highlight the JDocPlugin directory and then click the Open button. Click OK and select Import All Files. jEdit will add the JDocPlugin source files to your project view. Now you can edit the project's files by double-clicking their icons. Open the jdoc directory and double-click the JDocPlugin.java file. Figure 4 shows the JDocPlugin project's ProjectViewer display.
Figure 4. ProjectViewer
AntFarm
For any project with more than a few Java files, you'll want to use Ant to build the application. To use Ant with the JDocPlugin project, you need to configure AntFarm to use JDocPlugin's build file. First, select Utilities, then Global Options to display the Global Options dialog box. On the Global Options dialog box, select AntFarm, then Build Options. Set the radio button labeled Run Ant Targets In The Same JVM and check the box labeled Load Build Files From The Project Viewer Plugin. Then click the OK button.
To run a build for the JDocPlugin, change the classpath in the build.xml file to match your environment. Select the ProjectViewer ta
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Very
interesting article
View Tutorial: Very
interesting article
Related
Tutorials:
Automating WWW
Exploration
Automating WWW
Exploration |
Results of
first-ever JVM server benchmark revealed - JavaWorld - December 1997
Results of
first-ever JVM server benchmark revealed - JavaWorld - December 1997 |
Java Tip 78: Recycle
broken objects in resource pools - JavaWorld
Java Tip 78: Recycle
broken objects in resource pools - JavaWorld |
An introduction to agents - JavaWorld June 1998
An introduction to agents - JavaWorld June 1998 |
C#: A language alternative or just J--?, Part 2 - JavaWorld December 2000
C#: A language alternative or just J--?, Part 2 - JavaWorld December 2000 |
Untangle your servlet code with reflection - JavaWorld December
2000
Untangle your servlet code with reflection - JavaWorld December
2000 |
Become a programming Picasso with JHotDraw -
JavaWorld
February 2001
Become a programming Picasso with JHotDraw -
JavaWorld
February 2001 |
Introduction
to the Java Mail API
Introduction
to the Java Mail API |
Untangle your servlet code with
reflection
Untangle your servlet code with
reflection |
Java security evolution
and concepts, Part 2
Java security evolution
and concepts, Part 2 |
How to build
an interpreter in Java, Part 1: The BASICs
(JavaWorld /
May 1997 / by Chuck McManis)
How to build
an interpreter in Java, Part 1: The BASICs
(JavaWorld /
May 1997 / by Chuck McManis) |
Big designs for
small devices
Big designs for
small devices |
Make the Java-Oracle9i
connection
Make the Java-Oracle9i
connection |
Very
interesting article
Very
interesting article |
Very
interesting
Very
interesting |
Very
interesting
Very
interesting |
Interesting
concept ...
Interesting
concept ... |
JSyntaxColor 1.2.7
JSyntaxColor 1.2.7
JSyntaxColor is a library for coloring in real time user text input.
|
Very interesting tutorial
Introducing the JavaMail API
The JavaMail API is an optional package (standard extension) for reading, composing, and sending electronic messages. You use the package to create Mail User Agent (MUA) type programs, similar to Eudora, Pine, and Microsoft O |
Java validation with dynamic proxies
Decouple validation processes from your business object implementations. |
|
|
|