                      (make-button "Paste" 
                        (get-ui-icon "OptionPane.informationIcon")
                        [set-handler (fn [] (paste-from-clipboard table))] ) ])
-         e-ctx (make-editable-context)
-         widget (context-editor-widget root table toolbar e-ctx) ]
+         ectx (ref (make-editable-context))
+         e-ctx @ectx
+         widget (context-editor-widget root table toolbar ectx) ]
     (.. root getContentPane 
       (add (get-widget toolbar) BorderLayout/LINE_START))
     (.. root getContentPane
       (add (get-widget table)))
     (apply-exprs widget setup)
+    (dosync-wait (commute (:widgets e-ctx) add widget))
     (add-widget e-ctx widget)
     widget))
+
+(inherit-multimethod get-ectx ::context-editor-widget
+  "Returns the editable-context that is currently associated with the
+   context-editor-widget.
+
+  Parameters:
+    widget  _context-editor-widget")
+
+(defmethod get-ectx ::context-editor-widget
+  [widget] @(:e-ctx widget))
+
+(inherit-multimethod set-ectx ::context-editor-widget
+  "Sets the editable-context that is currently associated with the
+   context-editor-widget to the second parameter.
+
+  Parameters:
+    widget  _context-editor-widget
+    e-ctx   _new editable-context")
+
+(defmethod set-ectx ::context-editor-widget
+  [widget e-ctx] (dosync-wait (ref-set (:e-ctx widget) e-ctx)))
+
 
 (inherit-multimethod get-table ::context-editor-widget
   "Returns the table-control that is associated with the context-editor-widget.

         obj (objects ctx)
         inc (incidence ctx)
         get-cross (fn [obj att] (if (contains? inc [obj att]) "X" " "))
         table (get-table editor)]   

    (set-hook table "cell-value" (fn [_ _ x] x))
    (set-column-count table (+ 1 (count att)))
    (set-row-count table (+ 1 (count obj)))

    (doseq [a att o obj] (set-value-at-index table (obj-rows o) (att-cols a)
                           (get-cross o a)))
    (set-value-at-index table 0 0 "⇊objects⇊")
    (set-hook table "cell-value" 
      (fn [r c s] (ectx-cell-value-hook e-ctx editor r c s)))))

                   


