   (.setRowSorter table (TableRowSorter. m)))
 
 (defn set-filter [table text]
-  (let [sorter (.getRowSorter table)]
-      (do (.setRowFilter sorter (RowFilter/regexFilter text (int-array 0))))))
+  (let [sorter (.getRowSorter table)
+        column-indices
+          (int-array (map #(.getModelIndex %)
+               (enumeration-seq (.. table getColumnModel getColumns))))]
+      (do (.setRowFilter sorter (RowFilter/regexFilter text column-indices)))))
 
 (defn connect-search [search-field table]
   (let [d (.getDocument search-field)

                     "Please add a location to scan for files")]
    (add-location (.getAbsolutePath loc))))

(defn create-settings-window []
  (let [labeled-table
          (fn [label-text parent]
            (let [label (JLabel. label-text)
                  table (proxy [JTable] [0 1] (isCellEditable [_ _] false))
                  panel (JPanel.)
                  scroll-pane (JScrollPane. panel)]
              (.setBorder table (BorderFactory/createLineBorder (Color/GRAY)))
              (doto panel (.add label) (.add table)
                          (.setLayout (SpringLayout.)))
              (constrain-to-parent label :n 0 :w 0 :n 20 :e 0
                                   table :n 20 :w 0 :s 0 :e 0)
              (.add parent scroll-pane)
              (gen-map table panel)))
        split-pane (JSplitPane. JSplitPane/HORIZONTAL_SPLIT true)
        locations (labeled-table "Locations" split-pane)
        add-location-button
          (create-icon-button (get-icon "plus.png") user-add-location)
        remove-location-button
          (create-icon-button (get-icon "minus.png") remove-locations)
        columns (labeled-table "Columns" split-pane)
        main-panel (JPanel.)
        frame (JFrame. "Micro-Manager Data Set Browser Settings")]
    (apply remove-borders (.getComponents split-pane))


(def headings (atom nil))

(def tags [
  "ChColors" "ChContrastMax" "ChContrastMin" "ChNames" "Channels" "Comment"
  "ComputerName" "Date" "Depth" "Directory" "FrameComments" "Frames" "GridColumn"
  "GridRow" "Height" "IJType" "Interval_ms" "KeepShutterOpenChannels"
  "KeepShutterOpenSlices" "Location" "MetadataVersion" "MicroManagerVersion"
  "Name" "Path" "PixelAspect" "PixelSize_um" "PixelType" "PositionIndex"
  "Positions" "Prefix" "Slices" "SlicesFirst" "Source" "Time" "TimeFirst"
  "UUID" "UserName" "Width" "z-step_um"
   ])

(defn get-icon [name]
  (SwingResourceManager/getIcon
    org.micromanager.MMStudioMainFrame (str "icons/" name)))
