26. drag
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 26. drag

No parameter.

This command is intended to be bound to a mouse input. It is generally used by the macro-command which is bound to the `drag appEvent` in XMLmind XML Editor - Configuration and Deployment. See example.

If the mouse is clicked anywhere inside the node or text selection, this command returns a string representation of the selection. Otherwise this command first selects the element clicked upon and then returns a string representation of the newly selected element.

The returned string may be quickly described as follows:

- It the text selection consists only in plain text, this command returns this plain text.

- If the node selection consists only in a single element, this command returns an XML representation of this element. This XML representation always starts with `<?xml version="1.0"?>`.

- Otherwise, this command returns an XML representation of the node range in the format of the clipboard (that is, starting with `<?xml version="1.0"?>` and using a `<ns:clipboard xmlns:ns="http://www.xmlmind.com/xmleditor/namespace/clipboard">` wrapper element).

See also ensureSelectionAt.

Prev | Up | Next
25. diffSupport | Home | 27. drop