Wednesday, June 16, 2010

External tools in JDeveloper

With External tools, you can easily perform tasks based on external programs.
One of the 'default' external tools is 'Explore Directory'

To enable the standard tools, simply click the Tools menu and select external tools.
JDev offers to search for popular tools. It'll offer tools like expore directory, notepad (yeah, right...) Word etc.

Specifically, the tool Explore Directory is interesting since the structure of the project in JDev is not always the structure on disk.

You can also define your own external tools, based on Apache Ant or an external program.
Simply specify the program to execute, the arguments how the tools should be integrated and when the tool must be available.

Calling custom Javascript.

Sometimes, you just NEED to call a custom Javascript function...
If so, you can do the following:

Of course you save the Javascript function in a seperate file.
Include that file using:
<trh:script source="../skins/script/accessibility.js">

For this, include the following namespace to your jsp:root tag:

Place a commandToolbarButton (or some other component) on the page:
<af:commandtoolbarbutton partialsubmit="true" text="A" id="pt_cl6">
<af:clientlistener method="changeFontSize" type="action">

Assuming there is a function called changeFontSize, this will be executed when you click the button.