I wanted to expose a method in the super class and use this generated
class as a stub to derive from and forward calls to multimethods etc.
I was hoping doing just this would work:

(ns test.CLjTreeCellRenderer
  (:gen-class
   :extends javax.swing.tree.DefaultTreeCellRenderer
   :exposes-methods { getTreeCellRendererComponent
superGetCellRenderer})
  (:import (javax.swing.tree DefaultTreeCellRenderer)))

but unless I override the function in question, I received the
VerifyError above.  This is not a show-stopper and I'm don't know that
it's a bug but I thought I would bring it up.

;add this took care of the problem.
(defn -getTreeCellRendererComponent
  [this tree value selected expanded leaf row has-focus]
  (.superGetCellRenderer this tree value selected expanded leaf row
has-focus)
  this)

In some cases, the Java classes give you an interface where you have
to do all kinds of shenanigans to handle various cases (like the cell
renderer) where a call to a multi-method would be so much cleaner
(IMO).  I really just wanted to create a stub class for this 1x.  The
above was not bad since it was just 1 function.
Anyone else doing similar things?

Thanks,
Eric




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to