     :author "Frank Mosebach"}
   (:require 
     [fm.simrunner.gui.core :as gui])  
-  (:import 
+  (:import
+    (java.io File)
     (java.awt Insets
               Dimension
               BorderLayout

  (doseq [input (inputs view)]
    (let [input-id (:id (meta input))
          value    (input-id values)]
      (set-value input value))))

(defn render [view model]
  (update-inputs view (:input-values model)))

    (filter (comp input-ids :id meta)
            (widget-seq view))))

(defmulti set-value {:private true} (fn [input value] 
                                      [(type input) (type value)]))

(defmethod set-value [:select-input Object] [input value]
  (-> input
      :contents
      :select-text
      :widget
      (.setText (str value))))

(defmethod set-value [:select-input File] [input value]
  (set-value input (.getAbsolutePath value)))

(defmethod set-value [:select-input nil] [input value]
  (set-value input ""))

(defmethod set-value [:text-input Object] [input value]
  (-> input
      :widget
      (.setText (str value))))

(defmethod set-value [:text-input nil] [input value]
  (set-value input ""))

(defmethod set-value [:checkbox-input Object] [input value]
  (-> input
      :widget
      (.setSelected (boolean value))))

(defmethod set-value [:checkbox-input nil] [input value]
  (set-value input false))

(defmethod set-value :default [input value]
  (println (format "set-value{%s value: %s}" (type input) value)))
