 (ns org.micromanager.browser.core
   (:import [javax.swing BorderFactory JButton JComboBox JFrame JLabel JOptionPane
                         JList JPanel JScrollPane JSplitPane SortOrder
-                        JTable JTextField RowFilter SpringLayout]
+                        JTable JTextField RowFilter RowSorter$SortKey SpringLayout]
            [javax.swing.table AbstractTableModel DefaultTableModel
                               TableColumn TableRowSorter]
            [javax.swing.event DocumentListener TableModelListener]

      (doseq [col display-columns]
        (doto (add-browser-column (:title col))
          (.setPreferredWidth (* total-width (:width col))))))
    (-> @settings-window :columns :table
                         .getModel .fireTableDataChanged)))


     :locations @current-locations
     :sorted-column
       (when-let [sort-key (->> table .getRowSorter .getSortKeys seq first)]
         {:order ({SortOrder/ASCENDING 0 SortOrder/DESCENDING 1 SortOrder/UNSORTED 2}
                   (.getSortOrder sort-key))
          :model-column (.getColumnName model (.getColumn sort-key))})}))

(defn apply-data-and-settings [collection-name settings]
  (clear-queues)
