Created
June 11, 2010 22:45
-
-
Save dakrone/435156 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn make-repl-jframe | |
| "Displays a JFrame with JConsole and attached REPL." | |
| ([] (make-repl-jframe {})) | |
| ([optmap] | |
| (let [jframe (make-jframe (merge default-opts optmap))] | |
| (javax.swing.SwingUtilities/invokeAndWait | |
| #(let [console (bsh.util.JConsole.)] | |
| (doto (.getContentPane jframe) | |
| (.setLayout (java.awt.BorderLayout.)) | |
| (.add console)) | |
| (.pack jframe) | |
| (binding [*out* (java.io.OutputStreamWriter. (.getOut console)) | |
| *in* (clojure.lang.LineNumberingPushbackReader. (.getIn console))] | |
| (.start (Thread. (bound-fn [] (clojure.main/repl)))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment