               (into (sorted-map)
                     (map #(vector % (get-config group %))
                          (presets group))))))
-
-(def groups (atom nil))
 
 (defn update-groups []
   (reset! groups (seq (core getAvailableConfigGroups)))

    (getColumnName [column] (property-name (nth (properties @group-data) column)))
    (getColumnCount [] (count (properties @group-data)))
    (getRowCount [] (count (keys @group-data)))
    (isCellEditable [_ _] true)
    (getValueAt [row column] (get (nth (vals @group-data) row)
                                  (nth (properties @group-data) column)))
    (setValueAt [val row column]
      (let [old-val (.getValueAt this row column)]
        (core renameConfig (get-selected-group) old-val val)
        (update-group-data)))))

(defn link-table-row-selection [table-src table-dest]
  (let [model (proxy [DefaultListSelectionModel] [])]
    (.setListSelectionModel table-src model)
    (.setListSelectionModel table-dest model)))
  

(defn show []
  (let [f (JFrame. "Micro-Manager Configuration Preset Editor")
        cp (.getContentPane f)
        groups-table (JTable.)
        presets-table (JTable.)
        preset-names-table (JTable.)
        groups-sp (scroll-pane groups-table)
        presets-sp (scroll-pane presets-table)
        ]
