          col-model (.getColumnModel control) ]
     (.moveColumn col-model old-view new-view)))
 
+(defn-typecheck-swing-threads* move-row ::table-control
+  "Moves the row at view index old-view to be viewed at view index
+   new-view."
+  [otable old-view new-view]
+  (let [p (:row-permutator otable)
+        row-count (get-row-count otable)]
+    (if (and (>= new-view 0)
+         (< new-view row-count)
+          (not= old-view new-view))
+      (if (< old-view new-view)
+        nil
+        nil
+        ))))
+
 (defn- table-change-hook
   [otable column first-row last-row type]
   (if (and (= 0 type)

(defn-typecheck get-row-index ::table-control
  "Returns the tables model index of the specified row in view."
  [otable row]
  row)

(defn-typecheck get-index-row ::table-control
  "Returns the row in the view that corresponds
  to the specified table model index."
  [otable index]
  index)

(defn-typecheck get-row-index-permutator ::table-control
  "Returns a function that will map the current view rows to
   the according index values."
  [otable]
  identity)

(defn-typecheck-swing get-column-index-permutator ::table-control
  "Returns a function that will map the current view


;;;  Table

(defrecord table-control [widget control hooks model row-permutator])
;; row-permutator is a two-element vector of functions, where the first-row
;; element transforms view-rows to index-rows and the second element is
;; the inverse function transforming index-rows to view-rows.
(derive ::table-control ::control)
(derive ::table-control :conexp.contrib.gui.util.hookable/hookable)

