Overriding java superclass method in Clojure -


i'm doing javafx stuff, following tableview example. in original java author @overrides several of tablecell class methods he's deriving directly from, @overrides updateitem method 2 levels in class hierarchy , belongs cell class.

is there way in clojure? i'm doing proxy i'm okay using :gen-class if necessary. thought read somewhere can override immediate base class in clojure.

(defn make-editing-cell []   (let [textfield (atom nil)]     (proxy [tablecell] []       (startedit []         (proxy-super startedit)         (println "start editing"))        (canceledit []         (proxy-super canceledit)         (println "cancel editing"))        (updateitem [item empty]         ;(proxy-super updateitem  ) ;; causes runtime error no matching field found         (if empty           (do (println "empty!")               (doto                 (.settext nil)                 (.setgraphic nil)))           (do (println "not empty!")               (if (.isediting this)                 (do (println "editing")                     (if (not @textfield)                       (.settext @textfield (.tostring (.getitem this))))                     (doto                       (.setgraphic @textfield)                       (.setcontentdisplay contentdisplay/graphic_only)))                 (do (println "not editing")                     (println this)                     (println (.getitem this))                     (comment                       (doto                         (.settext (.tostring (.getitem this)))                         (.setcontentdisplay contentdisplay/graphic_only)))))))         (println "updating item" item empty))))) 

i needed pass arguments item , empty proxy-super call... (proxy-super updateitem item empty)


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -