problem to create selection plugin : UUIDGenerator
Posted: Wed Aug 09, 2006 1:33 pm
Hello
I would like to create a selection plugin for oXygen to insert at the cursor position an UUID in the canonical format. For that purposes I have adapted the oXygen sample plugin UpperCase.
As long as I am expanding the "context.getSelection()" string with an additional "normal" string content the plugin is working fine by calling it - the additional string is inserted to the cursor position. But if there is any call to the UUIDGenerator included/uncommented (see code below) the plugin compiles well (without any error), loads well in oXygen but does not work at all by calling it. The selection at the cursor position is neither replaced nor altered - just nothing happens - even no error message.
Unfortunately as I am just a java newbie so it is hard for me to find out why the call to the UUIDGenerator will disturb the proper function of the plugin. For any hint I would be very grateful.
Many thanks in advance,
André
I would like to create a selection plugin for oXygen to insert at the cursor position an UUID in the canonical format. For that purposes I have adapted the oXygen sample plugin UpperCase.
Code: Select all
file : UppercasePluginExtension.java
...
import ro.sync.exml.plugin.selection.SelectionPluginResultImpl;
import org.safehaus.uuid.UUID;
import org.safehaus.uuid.UUIDGenerator;
...
public SelectionPluginResult process(SelectionPluginContext context) {
String my UUID = "test";
// myUUID = UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
return new SelectionPluginResultImpl(context.getSelection()+myUUID) ;
// return new SelectionPluginResultImpl(context.getSelection().toUpperCase());
}
...
Code: Select all
file : UppercasePluginExtension.java
...
import ro.sync.exml.plugin.selection.SelectionPluginResultImpl;
import org.safehaus.uuid.UUID;
import org.safehaus.uuid.UUIDGenerator;
...
public SelectionPluginResult process(SelectionPluginContext context) {
String my UUID = "test";
myUUID = UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
return new SelectionPluginResultImpl(context.getSelection()+myUUID) ;
// return new SelectionPluginResultImpl(context.getSelection().toUpperCase());
}
...
Many thanks in advance,
André