Edit online

Debugging a Plugin Using the Eclipse Workbench

To use the Eclipse workbench to debug problems in the code of a plugin without having to re-bundle the plugin's Java classes in a JAR library, follow these steps:
  1. Download and install Oxygen XML Author.
  2. Set up the Oxygen SDK following this set of instructions.
  3. Create an Eclipse Java Project (for example, MyPluginProject) from one of the sample plugins (for example, the Workspace Access plugin).
  4. In the MyPluginProject folder, create a folder called myPlugin. In this new folder, copy the plugin.xml file from the sample plugin. Modify the added plugin.xml to add a library reference to the directory where Eclipse copies the compiled output. To find out where this directory is located, invoke the contextual menu of the project (in the Project view), and go to Build Path > Configure Build Path. Then inspect the value of the Default output folder text box.

    Example: If the compiled output folder is classes, then in the plugin.xml, you need to add the following library reference:
    <library name="../classes"/>
  5. Copy the plugin.dtd from the [OXYGEN_INSTALL_DIR]/plugins folder in the root MyPluginProject folder.
  6. In the MyPluginProject build path, add external JAR references to all the JAR libraries in the [OXYGEN_INSTALL_DIR]/lib folder. Now your MyPluginProject should compile successfully.
  7. In the Eclipse IDE, create a new Java Application configuration for debugging. Set the Main class box to ro.sync.exml.Oxygen. Click the Arguments tab and add the following code snippet in the VM arguments input box, making sure that the path to the plugins directory is the correct one:
    -Dcom.oxygenxml.app.descriptor=ro.sync.exml.EditorFrameDescriptor 
    -Dcom.oxygenxml.editor.plugins.dir=D:\projects\MyPluginProject
    Note: If you need to configure the plugin for Oxygen XML Author, set the com.oxygenxml.app.descriptor to ro.sync.exml.AuthorFrameDescriptor.

    In the Dependencies tab, you should only add dependencies to two JAR libraries: [OXYGEN_INSTALL_DIR]/lib/oxygen.jar and [OXYGEN_INSTALL_DIR]/lib/oxygen-basic-utilities.jar.