Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/akhudek/clj-swingrepl
Browse files Browse the repository at this point in the history
  • Loading branch information
alandipert committed Nov 5, 2010
2 parents 659e3cb + 35eead2 commit dbc3b20
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 455 deletions.
1 change: 1 addition & 0 deletions project.clj
Expand Up @@ -10,4 +10,5 @@
[lein-clojars "0.5.0-SNAPSHOT"]
[swank-clojure "1.2.1"]]
:repositories {"clojure-releases" "http://build.clojure.org/releases"}
:hooks [leiningen.hooks.javac]
:main org.dipert.swingrepl.main)
10 changes: 5 additions & 5 deletions src/clj/org/dipert/swingrepl/main.clj
@@ -1,7 +1,7 @@
(ns org.dipert.swingrepl.main
"Swing Clojure REPL using BeanShell's JConsole"
(:require clojure.main)
(:import (javax.swing JFrame))
(:import (javax.swing JFrame) (bsh.util JConsole))
(:gen-class))

(def ^{:doc "Formatted Clojure version string"
Expand Down Expand Up @@ -35,9 +35,9 @@
(doto jframe
(.pack)
(.setSize width height))
(binding [*out* (java.io.OutputStreamWriter. (.getOut console))
*in* (clojure.lang.LineNumberingPushbackReader. (.getIn console))
*err* (.getOut console)]
(binding [*out* (.getOut console)
*in* (clojure.lang.LineNumberingPushbackReader. (.getIn console))
*err* (.getOut console)]
(.start (Thread. (bound-fn [] (clojure.main/main)))))))))


Expand Down Expand Up @@ -90,7 +90,7 @@
(doto jframe#
(.pack)
(.setSize (:width opts#) (:height opts#)))
(binding [*out* (java.io.OutputStreamWriter. (.getOut console#))
(binding [*out* (.getOut console#)
*in* (clojure.lang.LineNumberingPushbackReader. (.getIn console#))
*err* (.getOut console#)]
(.start (Thread. (bound-fn []
Expand Down
7 changes: 3 additions & 4 deletions src/jvm/bsh/ConsoleInterface.java
Expand Up @@ -46,10 +46,9 @@ implementations. e.g. print() with color can be mapped to plain text.
*/
public interface ConsoleInterface {
public Reader getIn();
public PrintStream getOut();
public PrintStream getErr();
public PrintWriter getOut();
public PrintWriter getErr();
public void println( Object o );
public void print( Object o );
public void error( Object o );
}

}

0 comments on commit dbc3b20

Please sign in to comment.