11. drag-source
Prev | Chapter 5. Content objects | Next

## 11. drag-source

drag-source(`key`, `value`, ..., `key`, `value`)

Inserts a button in generated content which can be used to execute a command (see Chapter 6, Commands written in the Java™ programming language in XMLmind XML Editor - Commands). Identical to command-button except that:

- A `drag-source` cannot be used to popup a menu.

- The user cannot click on a `drag-source`. He/she needs to drag the mouse over it to trigger the command. This command must return a string.

Example:

    section[id] > title:after {
        display: inline;
        content: drag-source(icon, icon(right-link),
                             command, "dragHref");
    }

where command `dragHref` is:

      <command name="dragHref">
        <macro xmlns:hrefu="java:com.xmlmind.xmleditapp.dita.HrefUtil">
          <sequence>
            <command name="selectNode" parameter="parent section" />
            <get expression="hrefu:get-href($selectedElement)" />
          </sequence>
        </macro>
      </command>

Prev | Up | Next
10. delete-button | Home | 12. drop-site