Chapter 1. Introduction

Table of Contents

1. Compiling and running code samples
2. Creating your own extensions

The target audience of this document is experienced Java programmers wishing to extend XMLmind XML Editor (XXE for short) and/or to embed a custom XML editor based on XXE parts in their own application.

Important

XMLmind XML Editor code is not thread-safe. Most of it is not even reentrant.

1. Compiling and running code samples

All the code samples used to illustrate this document are found in the samples/ subdirectory.

Ant, a Java-based build tool (“in theory, it is kind of like make, without make's wrinkles” say its authors), is needed to build and run these code samples.

build_all.xml, the ant build file needed to compile and run code samples, has been tested with ant version 1.7.

Tip

In code samples included in this document, icons , , ... can be clicked upon to move from code to explanations and from explanations to code.

Tip

Error messages related to loading and invoking extension code are all printed on stderr. Therefore when you develop extension code on Windows, it is strongly recommended to run XXE using java rather than using javaw.

In order to do this:

  • If you start XXE using xxe.exe (that is, the icon in the XMLmind XML Editor start menu), open xxe.jstart in notepad, replace "jre\bin\javaw.exe" by "jre\bin\java.exe", save xxe.jstart using the UTF-8 encoding (should have been automatically detected by notepad).

  • f you start XXE using xxe.bat, open xxe.bat in notepad, replace "start javaw" by "start java", save xxe.bat.

2. Creating your own extensions

Rather than copying and modifying the above samples, we recommend instead using our project creation wizard. This wizard makes it easy creating Ant and/or Eclipse projects.

Figure 1.1. The Create Project wizard

The Create Project wizard

On Windows, this wizard is started by executing the following command:

C:\Program Files\XMLmind_XML_Editor\doc\dev> javaw -jar createproject.jar

Double-clicking on createproject.jar should work too. On Linux and on the Mac, open a terminal and execute the following command:

~/xxe-perso-3_6_2/doc/dev$ java -jar createproject.jar &

Java™ archive createproject.jar is found in the directory containing this guide.