                             to-root
                             value
                             vertical-panel
-                            ]]))
+                            ]])
+  (:require seesaw.mig))
 
 
 (defn on-btn-save-connection-cancel

        conn-str (get conn-data "jdbc-conn-str")
        conn-desc (get conn-data "desc")
        label-texts ["Name"
                "Driver JAR file (optional)"
                "Driver Class"
                "JDBC Connection String"
                "Description (optional)"]
        labels (map #(label :text % :border 2 :preferred-size [100 :by 0]) label-texts)
        default-field-options {:preferred-size [0 :by 400]}
        fields [
                (text :id :name :text conn-name :preferred-size [400 :by 0])
                (text :id :jar :text conn-jar)
                (text :id :class :text conn-class)
                (text :id :jdbc-conn-str :text conn-str)
                (text :id :desc :text conn-desc)
                ]
        buttons [
                 (button :id :cancel :text "Cancel" :listen [:action on-btn-save-connection-cancel])
                 (button :id :test :text "Test" :listen [:action (partial on-btn-test-connection test-conn!)])
                 (button :id :ok :text "Ok" :listen [:action (partial on-btn-save-connection-ok conn-list-frame save! conn-data)])
                 ]
        form-items (interleave labels fields)]
    (assert (= (count labels) (count fields)))
    (println "create-edit-connection-frame")
    (->
      (custom-dialog
          :title "SQLS: Add connection"
          :content (vertical-panel :border 4
                                   :items [
                                           (grid-panel :columns 2
                                                       :items form-items)
                                           (horizontal-panel :id :buttons
                                                             :items buttons)]))
      pack!)))


      (show-test-success! (to-root e))
      (show-test-failure! (to-root e) (:desc result)))))


(defn create-edit-connection-frame
  "Create add-or-edit connection dialog.

