Developer Guide for jEdit
Contents
- Pre-requisites
- Setting up the Office Scripting plugin
- Using the Office Scripting plugin
- Options
- Step by step actions
- Troubleshooting
Pre-requisites
- The plugin only runs in jEdit 4.0.3 (available from jedit.org)
- You MUST have the following plugins installed: AntFarm, Console
(see below for instructions on installing them) - If you wish to have code completion when writing Office scripts you also need to install the SpeedJava plugin
Setting up the Office Scripting plugin
See the Installation Guide for instructions on installing the Office Scripting plugin.Setting up the http proxy
- Browse to Utilities/Global Options...
- Browse in the Global Options dialog box to the Proxy Servers.
- Check "Use HTTP proxy Servers" and set all information needed for jEdit to access the web.
- Click on OK.
Installing required plugins
- Browse to Plugins/Plugin Manager...
- Click on Install Plugins (If you get erors then your Proxy is not well setup)
- Then you get a list of plugins.
- The plugins needed by the Office Scripting plugin are AntFarm and Console.
- So just select them if you cant find them on the list then you have them already installed.
- Click on install
- Click on OK if needed then Close.
- Exit jEdit.
Setting up the Office Scripting plugin for jEdit
If you did not install the Office Scripting plugin according to the instructions in the Installation Guide you need to do so first.
- Browse to Utilities/Global Options...
- Select Plugins/Office Scripting
- Select which Office version you want to work with
- You must click OK to verify your choice even if there is only one Office version listed.
- Select Plugins/AntFarm/Build Options
- Select Run Ant Targets in the same JVM.
Recommended layout for the jEdit window
- Browse to Utilities/Global Options...
- Select Docking
- Activity Log docking position: bottom
- Ant Farm docking position: right
- Console docking position: bottom
- Error List docking position: bottom
- File System Browser docking position: left
- Scripting Framework docking position: right
- Click on OK.
Using the Office Scripting plugin
Popup Menu actions
The Scripting plugin provides a dockable window listing your scripts. A number of actions are available in this window:
On the ROOT (All Parcels node)
- Open... : This will open a file chooser dialog box. You can select an .sxp file, directory or Office Document.
- New... : This will prompt you for a parcel name and then create by default everything needed for a scripting parcel
- Parcel Wizard...: Kind of the same than Parcel Template except you choose the java files you want to include in the parcel.
On a Script Parcel
If the parcel is a directory (created from parcel template or parcel wizard):
- Add Directory: This will prompt you for a Directory Name and it will create it under the selected Node.
- Add File: This will prompt you with a file chooser dialog box and you can select the files you want to add to the selected node.
- Rename: This prompt you for the new name and rename the parcel.
- Remove: This will remove the parcel.
- Generate Build.xml: This menu is only displayed if no build.xml file exists in the Parcel directory. To avail the options below you need to generate this build.xml file.
- Reload Parcel: This will reload the Parcel if the content on disk changed.
- Edit Build File: This will open the build.xml file that you can edit. This file is generated automatically when using wizard or parcel template.
- Ant Targets: The Ants targets will automatically be displayed and by selecting them you will run the Ant command (requires AntFarms).
- ScriptCompile: Default Ant target to compile the full parcel.
- ScriptClean: Deafult Ant target to clean all compilation output files.
- Build SXP: This will compile and create the .sxp Parcel file.
- Configure Parcel...: This will display the available methods name in the Parcel and you can select which methods can be available in OpenOffice.org.
If the parcel selected is contained in an Office Document the actions available are:
- Remove: This will remove the parcel from the document
On a File/Directory
Some typical menu items are available on file and directory Items:
- Add Directory: Only on directory. This will add a directory under the selected directory.
- Add File: Only on directory. This will prompt you with a file chooser and add the selected files in the selected directory.
- Rename: this will rename physically the selected entry.
- Remove: this will remove physically the selected entry.
On a Script Parcel (.sxp) file
The following actions are available on Script Parcel files:
- Deploy to
- Office Versions: this will deploy the Parcel to an installed version of OpenOffice.org. If you have OpenOffice.org running, you need to use the Tools/Refresh User Scripts (Java) menu item in OpenOffice.org for the script to appear in the Assign Script dialog in Office.
- Office Document: this will deploy the Parcel to an Office Document.
- Remove SXP: will remove physically the .sxp file generated by the build command.
Menu actions
Menu actions available are:
- New...
- Add...
- Parcel Wizard...
Options
You may configure some options in Utilities/Global Options/Plugin Options/Scripting Most of them are self-explanatory, but some need further explanation:
- OpenOffice.org Directory: Locations of all OpenOffice.org installations. You need to select one.
- Show tooltips in tree: Show tooltips in the tree of Parcels in the Office Scripting window
- Warn before removing File from Parcel: Will display a confirmation box before removing a file.
- Warn before removing Directory from Parcel: Will display a confirmation box before removing a directory.
- Include source code: This will include the source code in the Script Parcel (.sxp) file.
Step by step actions
How to create a Parcel using the New... menu.
By clicking on the first button or by right clicking on the "All Parcels" tree item and selecting New... a dialog box is displayed asking the name of the parcel you want to create. After you have input the name is this dialog, another dialog box is displayed requesting the destination path where that parcel should be created.Clicking on OK will create the full tree structure for the parcel if no problem were encountered.
How to create a Parcel using the Wizard... menu.
By clicking on the third button or by right clicking on the "All Parcels" tree item and selecting Parcel Wizard... a dialog box is displayed. You need to enter the Parcel Name, the destination path where the parcel will be created and select the java files you wish to include in the parcel.Clicking on OK will create the full tree structure for the parcel if no problem is encountered.
How to open a Parcel using the Open... menu.
By clicking on the second button or by right clicking on the "All Parcels" tree item and selecting Open..., a file chooser dialog box will be displayed you can select a directory parcel, and .sxp file representing a Parcel or an Office Document.A directory parcel should look like this:
Parcel Name - Contents - Java files - DirectoriesA .sxp file should look like this:
Parcel Name - Contents - Java files - Directories - .sxp File outputAn Office Document look like this:
Office Document - Contents - ParcelsHow to Compile a Parcel using the ScriptCompile menu.
This action is only available on a Directory parcel for the moment. The ScriptCompile menu item is only available if a build.xml file is available in the parcel.By clicking on this menu item the parcel will be compiled and errors will be shown in the ErrorList Plugin.
How to Build a Parcel using the Build SXP menu
This action is only available on a Directory parcel for the moment. By clicking on this item, the parcel will be rebuilt and a dialog box will be displayed showing the available methods in the parcel. This dialog box enables you to select methods that you want to export as scripts in Office.For each method you can assign a Logical Name to use as a script name in OpenOffice.org. Clicking on OK will create the .sxp File.
Troubleshooting
If you reinstall the Scripting Framework you will need to update any build files that were generated for old scripts that you wrote to reflect the path to the new framework under your <Office Installation>/user/uno_packages directory for those scripts to build.
The Choose Methods to Export as Scripts dialog only displays methods which are defined within class files, it will not display methods in class files which are within jar files in the Parcel Recipe.
If you get the message "Could not generate Ant build. No Office Directory set in the Options", you need to do the following:
- Select the Utilities/Global Options menu item
- Go to the Plugin Options/Office Scripting section
- Select one of the Office installations from the list and click OK.
Last Modified: Fri Nov 29 14:19:53 GMT 2002