diff options
author | scgilardi <scgilardi@gmail.com> | 2009-05-13 17:05:26 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2009-05-13 17:05:26 +0000 |
commit | b402ee96757f99ff9c1be8daf8166bd2f4f9b4c7 (patch) | |
tree | fc156b04c07c975470b9a6b50705e8472f81d191 /src/clojure | |
parent | 295a1bf6e1e217b446a2415c8e777fd8770e6409 (diff) |
miglayout: change dependency on miglayout jar from compile time to run time, add it to the list of compilable libs in build.xml
Diffstat (limited to 'src/clojure')
-rw-r--r-- | src/clojure/contrib/miglayout.clj | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/clojure/contrib/miglayout.clj b/src/clojure/contrib/miglayout.clj index 32fd7e17..0e03f8d4 100644 --- a/src/clojure/contrib/miglayout.clj +++ b/src/clojure/contrib/miglayout.clj @@ -14,7 +14,7 @@ ;; Example: ;; ;; (use '[clojure.contrib.miglayout.test :as mlt :only ()]) -;; (doseq [i (range 3)] (mlt/run-test i)) +;; (dotimes [i 5] (mlt/run-test i)) ;; ;; scgilardi (gmail) ;; Created 5 October 2008 @@ -27,12 +27,12 @@ http://www.miglayout.com/ Example: (use '[clojure.contrib.miglayout.test :as mlt :only ()]) - (doseq [i (range 3)] (mlt/run-test i)) + (dotimes [i 5] (mlt/run-test i)) "} clojure.contrib.miglayout (:import (java.awt Container Component) - (net.miginfocom.swing MigLayout)) + (clojure.lang RT)) (:use clojure.contrib.miglayout.internal)) (defn miglayout @@ -66,8 +66,14 @@ Example: [#^Container container & args] (let [item-constraints (apply parse-item-constraints args) {:keys [keywords components]} item-constraints - {:keys [layout column row]} keywords] - (.setLayout container (MigLayout. layout column row)) + {:keys [layout column row]} keywords + class (RT/classForName "net.miginfocom.swing.MigLayout") + layout-manager (.newInstance class)] + (doto layout-manager + (.setLayoutConstraints layout) + (.setColumnConstraints column) + (.setRowConstraints row)) + (.setLayout container layout-manager) (doseq [[#^Component component constraints] components] (.add container component constraints)) container)) |