Debugging a Plugin Using the Eclipse Workbench
To debug problems in the code of the plugin without having to re-bundle the Java classes of the plugin in a JAR library, follow these steps:
- Download and install Oxygen XML Developer plugin.
- Set up the oXygen SDK following this set of instructions.
- Create an Eclipse Java Project (for example,
MyPluginProject
) from one of the sample plugins (the Workspace Access plugin, for example). - In the
MyPluginProject
folder, create a folder calledmyPlugin
. In this new folder copy theplugin.xml
from the sample plugin. Modify the addedplugin.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 . Then inspect the value of the Default output folder text box.Example: If the compiled output folder is
classes
, then the you need to add in theplugin.xml
the following library reference:<library name="../classes"/>
- Copy the
plugin.dtd
from the[OXYGEN_INSTALL_DIR]/plugins
folder in the rootMyPluginProject
folder. - In the
MyPluginProject
build path add external JAR references to all the JAR libraries in the[OXYGEN_INSTALL_DIR]/lib
folder. Now yourMyPluginProject
should compile successfully. - 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 -Xmx1024m -XX:MaxPermSize=384m -Dcom.oxygenxml.editor.plugins.dir=D:\projects\MyPluginProject
Note
If you need to configure the plugin for , set thecom.oxygenxml.app.descriptor
toro.sync.exml.AuthorFrameDescriptor
orro.sync.exml.DeveloperFrameDescriptor
, respectively. - Add a break point in the source of one of your Java classes.
- Debug the created configuration. When the code reaches your breakpoint, the debug perspective should take over.