 
 ;;;  Table
 
-(defrecord table-control [widget control hooks model])
+(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)
 

                                                ActionEvent/CTRL_MASK false),

        hooks           (:hooks (make-hookable)),
        widget          (table-control. pane table hooks model),
        change-listener (proxy [TableModelListener] []
                          (tableChanged [event]
                            (with-swing-threads*

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

(defn-typecheck get-index-row ::table-control
  "Returns the row in the view that corresponds
  to the specified table model index."
  [otable index]
  (let [p (:row-permutator otable)]
    ((second p) 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]
  (let [p (:row-permutator otable)]
    (first p)))

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