     (.setText column text)
     column))
 
-(defn begin []
+(defn begin [metadata data]
   (let [#^Display display (Display.)
 	#^Shell shell (Shell. display)
 	flags (reduce bit-or [(SWT/MULTI) (SWT/BORDER) (SWT/FULL_SELECTION)])
 	#^Table table (Table. shell flags)
-	;; plug in metadata here...
-	titles [" ", "C", "!", "Description", "Resource", "In Folder", "Location"]
+	
+	;; add metadata
+	titles (map str (.getAttributeKeys metadata))
 	columns (doall (map #(make-column table %) titles))]
     
     (.setLayout shell (GridLayout.))

(ns org.dada.swt.gui
    (:import
     (org.eclipse.swt SWT)
     (org.eclipse.swt.widgets Display Shell Table TableColumn TableItem Listener)
     (org.eclipse.swt.layout GridData GridLayout)

    (.addListener
     table
     (SWT/DefaultSelection)
     (proxy [Listener] [] (handleEvent [evt] (println "DefaultSelection" (map #(.getText %) (.getSelection table))))))

    ;; insert item at index
    ;;	TableItem item = new TableItem (table, SWT.NONE, 1);
