Hello,

I've written a custom (Java) command for XXE. This command changes the
readOnly property of the parent of the selected element temporarily,
deletes the selected element, and changes the parent property back.

this is the execute implementation:

protected Object doExecute(DocumentView docView,
                               String parameter, int x, int y) {
        Document doc = docView.getDocument();
        Element parent = toDelete.getParentElement();
        doc.beginEdit();
        parent.putProperty(RO_PROP, Boolean.FALSE);
        parent.removeChild(toDelete);
        parent.putProperty(RO_PROP, Boolean.TRUE);
        doc.endEdit();
        docView.describeUndo("Remove Section");
        toDelete = null;
        return null;
    }


What am I doing wrong? Why is the undo button disabled after running
the above command? (The document is marked dirty and the command does
remove the element in question)

Thanks in advance for your help.

-- 
Fabián Mandelbaum
IS Engineer
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to