diff --git a/src/clj_ns_browser/browser.clj b/src/clj_ns_browser/browser.clj index a2a764b..cb0301d 100644 --- a/src/clj_ns_browser/browser.clj +++ b/src/clj_ns_browser/browser.clj @@ -601,7 +601,27 @@ (config! (id :ns-lb) :selection-mode :multi-interval) ;; experimental... (config! (id :vars-lb) :model []) (config! (id :ns-entries-lbl) :text "0") - (config! (id :doc-lb) :model doc-lb-value-list) + (config! (id :doc-lb) + :model doc-lb-value-list + :drag-enabled? true + :drop-mode :insert + :transfer-handler + (seesaw.dnd/default-transfer-handler + :import [seesaw.dnd/string-flavor + (fn [{:keys [target data drop? drop-location] :as m}] + ;; Ignore anything dropped onto the list that is + ;; not in the original set of list elements. + (if (and drop? + (:insert? drop-location) + (:index drop-location) + (doc-lb-value-set data)) + (let [new-order (list-with-elem-at-index + @doc-lb-cur-order data + (:index drop-location))] + (reset! doc-lb-cur-order new-order) + (config! target :model new-order))))] + :export {:actions (constantly :copy) + :start (fn [c] [seesaw.dnd/string-flavor (selection c)])})) (config! (id :edit-btn) :enabled? false) (config! (id :browse-btn) :enabled? false) (config! (id :clojuredocs-online-rb) :selected? true)