S. Harris wrote:
> We are running v4.x of XML Mind Editor, and we have a custom F-key
> command implemented in customize.xxe (that disables our metadata element
> and all its children) that we would like to automate whenever a new
> document is opened:
> <binding>
> <keyPressed code="F6"/>
> <command name="toggleMetadata"/>
> </binding>
> <command name="toggleMetadata">
> <macro undoable="true">
> <sequence>
> <command name="selectNode" parameter="ancestorOrSelf[implicitNode]
> {XXXX}resource"/>
> <command name="selectNode" parameter="child[implicitNode]
> {XXXX}metadata"/>
> <command name="setReadOnly" parameter="self[implicitNode] true"/>
> </sequence>
> </macro>
> </command>
> We are using XXE.OpenDocument in our JavaScript wrapper code that calls
> the XML Mind Editor as an applet:
> JavaScript call:
> var xxe = document.XXE;
> xxe.openDocument(xmlhttp.responseText, uriValue, false);
> DOS batch file:
> ..\..\bin\deploywebstart -codebase "" -applet editor1 –index
> Is there a way that this can be accomplished?

Yes, but this requires writing some Java code.

* If this behavior is specific to a given document type, you'll have to 
implement a ValidateHook. Your ValidateHook would do in Java the same 
thing as your macro when the reason passed to checkingDocument is 
Reason.OPEN

See http://www.xmlmind.com/xmleditor/_distrib/doc/dev/validatehook.html

See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/validatehook/ValidateHook.html

See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/validatehook/Reason.html

See also 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/validatehook/ValidateHookBase.html

A ValidateHook is declared as follows: 
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/validateHook.html

* If this behavior is not specific to a given document type (or if you 
simply prefer to do it this way because this is somewhat cleaner), 
you'll have to implement an OpenedDocumentHook. Your OpenedDocumentHook 
would do in Java the same thing as your macro in its openingDocument method.

See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHook.html

See also 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHookBase.html

See also http://www.xmlmind.com/xmleditor/_distrib/doc/dev/gui.html

An OpenDocumentHook is  declared as follows: 
http://www.xmlmind.com/xmleditor/_distrib/doc/gui/openedDocumentHook.html

Everything described above works exactly the same whatever the method 
used to deploy XMLmind XML Editor (applet, desktop app, Java Web Start).
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to