(boolean? b)
Return true if b is exactly true or false. Useful for handling optional boolean properties where we want to do nothing if the property isn't provided.
Return true if b is exactly true or false. Useful for handling optional boolean properties where we want to do nothing if the property isn't provided.
(camelize s)
Convert input string to camelCase from hyphen-case
Convert input string to camelCase from hyphen-case
A protocol for retrieving the children of a widget as a seq. This takes care of idiosyncracies of frame vs. menus, etc.
A protocol for retrieving the children of a widget as a seq. This takes care of idiosyncracies of frame vs. menus, etc.
(children c)
Returns a seq of the children of the given widget
Returns a seq of the children of the given widget
(collect root)
Given a root widget or frame, returns a depth-fist seq of all the widgets in the hierarchy. For example to disable everything:
(config (collect (.getContentPane my-frame)) :enabled? false)
Given a root widget or frame, returns a depth-fist seq of all the widgets in the hierarchy. For example to disable everything: (config (collect (.getContentPane my-frame)) :enabled? false)
(cond-doto x & forms)
Spawn of (cond) and (doto). Works like (doto), but each form has a condition which controls whether it is executed. Returns x.
(doto (new java.util.HashMap) true (.put "a" 1) (< 2 1) (.put "b" 2))
Here, only (.put "a" 1) is executed.
Spawn of (cond) and (doto). Works like (doto), but each form has a condition which controls whether it is executed. Returns x. (doto (new java.util.HashMap) true (.put "a" 1) (< 2 1) (.put "b" 2)) Here, only (.put "a" 1) is executed.
(constant-map klass & fields)
Given a class and a list of keywordized constant names returns the values of those fields in a map. The name mapping upper-cases and replaces hyphens with underscore, e.g.
:above-baseline --> ABOVE_BASELINE
Note that the fields must be static and declared in the class, not a supertype.
Given a class and a list of keywordized constant names returns the values of those fields in a map. The name mapping upper-cases and replaces hyphens with underscore, e.g. :above-baseline --> ABOVE_BASELINE Note that the fields must be static and declared *in* the class, not a supertype.
(illegal-argument fmt & args)
Throw an illegal argument exception formatted as with (clojure.core/format)
Throw an illegal argument exception formatted as with (clojure.core/format)
(resource-key? v)
Returns true if v is a i18n resource key, i.e. a namespaced keyword
Returns true if v is a i18n resource key, i.e. a namespaced keyword
(to-mnemonic-keycode v)
Convert a character to integer to a mnemonic keycode. In the case of char input, generates the correct keycode even if it's lower case. Input argument can be:
See: java.awt.event.KeyEvent for list of keycodes http://download.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html
Convert a character to integer to a mnemonic keycode. In the case of char input, generates the correct keycode even if it's lower case. Input argument can be: * i18n resource keyword - only first char is used * string - only first char is used * char - lower or upper case * int - key event code See: java.awt.event.KeyEvent for list of keycodes http://download.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html
(to-seq v)
Stupid helper to turn possibly single values into seqs
Stupid helper to turn possibly single values into seqs
(to-uri s)
Try to make a java.net.URI from s
Try to make a java.net.URI from s
(to-url s)
Try to parse (str s) as a URL. Returns new java.net.URL on success, nil otherwise. This is different from clojure.java.io/as-url in that it doesn't throw an exception and it uses (str) on the input.
Try to parse (str s) as a URL. Returns new java.net.URL on success, nil otherwise. This is different from clojure.java.io/as-url in that it doesn't throw an exception and it uses (str) on the input.
(try-cast c x)
Just like clojure.core/cast, but returns nil on failure rather than throwing ClassCastException
Just like clojure.core/cast, but returns nil on failure rather than throwing ClassCastException
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close