 (ns org.dada.swt.gui
     (:import
+     (java.io Serializable)
      (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" (.getSelection table)))))

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

    (.setHeaderVisible table true)
    (.setLayoutData table (GridData. (SWT/FILL) (SWT/FILL) true true))
    
    ;; add data
    (doall		   ;TODO - use a fn that implies a side-effect
     (map
      (fn [datum]
	  (let [#^TableItem item (TableItem. table (SWT/NONE))]
	    (.setText item 0 (str datum))
	    ))
      data))
    
    (doall (map	#(.pack %) columns))
     
