Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed dependency to [franks42/seesaw "1.4.2-SNAPSHOT"], which inclu…

…des the seesaw.clipboard and seesaw.rsyntaxtextarea

changed clipboard and rsyntaxtextarea interactions to conform to seesaw
pushed new 1.3.0-SNAPSHOT to clojars for testing
  • Loading branch information...
commit 76b00d0403ac7cf94c6f902e1cd790433e06d973 1 parent 9bb4398
@franks42 authored
View
11 pom.xml
@@ -17,7 +17,7 @@
<scm>
<connection>scm:git:git://github.com/franks42/clj-ns-browser.git</connection>
<developerConnection>scm:git:ssh://git@github.com/franks42/clj-ns-browser.git</developerConnection>
- <tag>c8706573f5dd282e0e81f0c34379c9c80a9fa1da</tag>
+ <tag>9bb4398b63e1165b5c0dc41be6c37895a185345d</tag>
<url>https://github.com/franks42/clj-ns-browser</url>
</scm>
<build>
@@ -63,9 +63,9 @@
<version>1.3.0</version>
</dependency>
<dependency>
- <groupId>seesaw</groupId>
+ <groupId>franks42</groupId>
<artifactId>seesaw</artifactId>
- <version>1.4.1</version>
+ <version>1.4.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
@@ -99,11 +99,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.fife.ui</groupId>
- <artifactId>rsyntaxtextarea</artifactId>
- <version>2.0.3</version>
- </dependency>
- <dependency>
<groupId>org.thnetos</groupId>
<artifactId>cd-client</artifactId>
<version>0.3.4</version>
View
4 project.clj
@@ -4,13 +4,13 @@
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.3.0"]
- [seesaw "1.4.1"]
+ [franks42/seesaw "1.4.2-SNAPSHOT"]
[org.clojure/tools.namespace "0.1.2"]
[clj-info "0.2.3"]
[hiccup "0.3.8"]
[org.clojure/tools.trace "0.7.3"]
[clojure-complete "0.2.1" :exclusions [org.clojure/clojure]]
- [org.fife.ui/rsyntaxtextarea "2.0.3"]
+ ;;[org.fife.ui/rsyntaxtextarea "2.0.3"]
[org.thnetos/cd-client "0.3.4"]]
:dev-dependencies [[lein-marginalia "0.6.0"]
;[franks42/debug-repl "0.3.1-FS"]
View
13 src/clj_ns_browser/browser.clj
@@ -10,6 +10,7 @@
(:require [seesaw.selector]
[seesaw.dnd]
[seesaw.bind :as b]
+ [seesaw.rsyntax]
[clojure.java.browse]
[clojure.java.shell]
[clojure.java.io]
@@ -18,6 +19,7 @@
[clj-info.doc2map :as d2m]
[clj-ns-browser.inspector]
[seesaw.meta]
+ [seesaw.clipboard]
[clojure.java.javadoc]
[cd-client.core]
[clojure.tools.trace])
@@ -433,14 +435,14 @@
(let [id (partial select-id (to-root e))]
(if-let [s (selection (id :doc-ta))]
(let [fqn (subs (config (id :doc-ta) :text) (first s) (second s))]
- (set-clip! fqn))
+ (seesaw.clipboard/contents! fqn))
(if-let [fqn (config (id :doc-tf) :text)]
- (set-clip! fqn)))))))
+ (seesaw.clipboard/contents! fqn)))))))
(add-app-action :fqn-from-clipboard-action
(action :name "Paste - FQN from clipboard"
:key "menu V"
- :handler (fn [e] (if-let [fqn (get-clip)] (invoke-soon (browser-with-fqn *ns* fqn (to-root e)))))))
+ :handler (fn [e] (if-let [fqn (seesaw.clipboard/contents)] (invoke-soon (browser-with-fqn *ns* fqn (to-root e)))))))
(add-app-action :fqn-from-selection-action
(action :name "FQN from selection"
@@ -961,9 +963,8 @@
(b/transform (fn [o]
(when (= (.getName (type (id :doc-ta))) "org.fife.ui.rsyntaxtextarea.RSyntaxTextArea")
(if (or (= "Source" o) (= "Examples" o) (= "Meta" o))
- (.setSyntaxEditingStyle (id :doc-ta) org.fife.ui.rsyntaxtextarea.SyntaxConstants/SYNTAX_STYLE_CLOJURE)
-;; (.setSyntaxEditingStyle (id :doc-ta) org.fife.ui.rsyntaxtextarea.SyntaxConstants/SYNTAX_STYLE_CLOJURE))))))
- (.setSyntaxEditingStyle (id :doc-ta) org.fife.ui.rsyntaxtextarea.SyntaxConstants/SYNTAX_STYLE_NONE))))))
+ (config! (id :doc-ta) :syntax :clojure)
+ (config! (id :doc-ta) :syntax :none))))))
;;
;; bring up browser with url
(b/bind
View
33 src/clj_ns_browser/utils.clj
@@ -295,39 +295,6 @@
""))
-;; following three clipboard-related functions copied from lib.sfd.clip-utils of
-;; https://github.com/francoisdevlin/devlinsf-clojure-utils/
-;; library seems a little abandoned, but the following functions just work.
-;; Kudos to Sean Devlin.
-
-(defn- get-sys-clip
- "A helper fn to get the clipboard object"
- []
- (. (java.awt.Toolkit/getDefaultToolkit) getSystemClipboard))
-
-(defn get-clip
- "Get the contents of the clipboard. Currently only supports text."
- []
- (let [clipboard (get-sys-clip)]
- (if clipboard
- (let [contents (. clipboard getContents nil)]
- (cond
- (nil? contents) nil
- (not (. contents isDataFlavorSupported java.awt.datatransfer.DataFlavor/stringFlavor)) nil
- true (. contents getTransferData java.awt.datatransfer.DataFlavor/stringFlavor))))))
-
-(defn set-clip!
- "Set the contents of the clipboard. Currently only supports text."
- [input-string]
- (if input-string
- (let [clipboard (get-sys-clip)]
- (if clipboard
- (do
- (let [selection (java.awt.datatransfer.StringSelection. input-string)]
- (. clipboard setContents selection nil))
- input-string)))))
-
-
;; functions to collect different (filtered/sub-) lists of vars, classes, special-forms, etc.
(defn ns-special-forms
Please sign in to comment.
Something went wrong with that request. Please try again.