How to Extend JDeveloper without writing code
By John 'JB' Brock on Oct 11, 2010
JDeveloper has a great feature called External Tools, that allows a person to make the IDE interact with an external application.
A really good example of this was written a few years ago by Shay Shmeltzer to show how to connect to a Source Code Management (SCM) tool that JDeveloper didn't support natively at the time. You can find that blog post here.
The External Tools feature has a built in function that tells the tool to go out and look on your computer for the following programs, if you click on the the "Find Tools" button.
This may be enough for a lot of people, but let's go ahead and walk through the process of setting up the integration of one of your own applications.
Clicking on the "New" button will bring up the wizard below. You can select between an external program or an Apache Ant build file that you would like to integrate with.
The Apache Ant integration allows you to provide an existing Ant build file as the target program, and then add arguments to be used when it's run.
We're going to focus on the External Program settings here, but the settings are the same for the Ant process.
On this page of the wizard you can select the executable file for the program that you want to integrate.
You will also set the arguments that you want to pass to the program.
This is really the heart of integrating the application into the IDE. The arguments text field is kind of a free form entry field where you can enter anything that you like. The "Insert" button will display a dialog that shows a large list of predefined macros for common arguments that you may need.
In the example shown in the two screenshots above, I used a simple application called Editplus that allows me to pass in an argument of " -d " to set the working Directory, and the argument of " -n " to load a new file into the application at startup.
I know, using an editor as an external application for an editor isn't practical, but it was something that used some command line arguments that were easy to show. :-)
Once you have the application selected and the arguments set you are given the option to set the name for the menu, set the ToolTip text if you like, and select an icon for the menu.
Next you decide where you want the menu items to show up in the IDE.
These options are all pretty self explanatory. The second to last option is nice if you are sending a file off to do some kind of analysis or something like that, then you would like the modified file to be reloaded back into the IDE with the updates, once the external application is done with it.
The final step in the wizard is to decided when you would like this external application to be shown in the IDE.
For most external applications, you will only want to show the menu or toolbar item when a file, that is part of your project, is selected or the file is already opened in the IDE's editor.
To be even more specific, you can select to only show the menu when the file is of a specific type. Like a .java or .xml file, etc.
That covers the basics of setting up an External Application. As usual, please feel free to post any questions or personal experiences in the comments. It would be great to hear from others that have already integrated some external programs. Tell us which ones you've worked with and how they've worked out.