Download XML Editor 11.2 User Manual
Transcript
Author Developer Guide
/**
* Performs the operation.
*/
public void doOperation(
AuthorAccess authorAccess,
ArgumentsMap arguments)
throws IllegalArgumentException,
AuthorOperationException {
JFrame oxygenFrame = (JFrame) authorAccess.getParentFrame();
String href = displayURLDialog(oxygenFrame);
if (href.length() != 0) {
// Creates the image XML fragment.
String imageFragment =
"<image xmlns='http://www.oxygenxml.com/sample/documentation' href='"
+ href + "'/>";
// Inserts this fragment at the caret position.
int caretPosition = authorAccess.getCaretOffset();
authorAccess.insertXMLFragment(imageFragment, caretPosition);
}
}
/**
* Has no arguments.
*
* @return null.
*/
public ArgumentDescriptor[] getArguments() {
return null;
}
/**
* @return A description of the operation.
*/
public String getDescription() {
return "Inserts an image element. Asks the user for a URL reference.";
}
The complete source code of this operation is found in the Example Files Listings, the Java Files section.
Important
Make sure you always specify the namespace of the inserted fragments.
3.
Package the compiled class into a jar file. An example of an ANT script that packages the classes directory
content into a jar archive named sdf.jar is listed below:
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="dist">
<target name="dist">
308
Related documents
XML Editor 10.3 User Manual for Eclipse
Oxygen XML Author 12.2
XML Editor 10.3 User Manual
XML Author 10.3 User Manual
XML Author 11.2 User Manual for Eclipse
XML Author 10.3 User Manual for Eclipse
Oxygen XML Author Eclipse Plugin 15.2
XML Editor 11.2 User Manual for Eclipse
XML Author 11.2 User Manual
Oxygen XML Editor 16.1
Oxygen XML Developer Eclipse Plugin 16.1
XML Editor User Manual