I found a solution, but it has a little side effect - I can't find a way to get notification when user released the mouse button, therefore a file(s) with data from the tree must be created during initialization of dragstart event in a temp directory, which will be moved to the dropped to folder when user released mouse button.
Example:
//event listener must be added to <treechildren> element
document.getElementById("myTreeChildren").addEventListener("dragstart", treeDragStart, true);
function treeDragStart(e)
{
var nsIFile = FileUtils.getFile("TmpD", ["myfilename.txt"], true),
fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream),
content = "this is an example text";
// flags: PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE
fos.init(nsIFile, 0x04 | 0x08 | 0x20, 0600, 0);
written = fos.write(content, content.length);
if (fos instanceof Ci.nsISafeOutputStream)
fos.finish();
else
fos.close();
e.dataTransfer.effectAllowed = "move";
e.dataTransfer.mozSetDataAt("application/x-moz-file", nsIFile, 0);
}//treeDragStart()
Does somebody know if there is a way get notification when drop occur from outside of the application?