Skip to content

Commit 1a2e0c8

Browse files
committed
Mark text nilable
1 parent e476ed5 commit 1a2e0c8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/cljfx/dev/definitions.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@
797797
:parent :xy-chart
798798
:req [:x-axis :y-axis]
799799
:of 'javafx.scene.chart.BubbleChart)
800+
(defmethod keyword-prop->spec-form :nilable [{:keys [of]}]
801+
`(s/nilable ~(keyword-prop->spec-form of)))
800802
(register-props! :labeled :control
801803
'{:alignment {:type :enum :of javafx.geometry.Pos}
802804
:content-display {:type :enum :of javafx.scene.control.ContentDisplay}
@@ -806,7 +808,7 @@
806808
:graphic-text-gap {:type :number}
807809
:line-spacing {:type :number}
808810
:mnemonic-parsing {:type :boolean}
809-
:text {:type :string}
811+
:text {:type :nilable :of {:type :string}}
810812
:text-alignment {:type :enum :of javafx.scene.text.TextAlignment}
811813
:text-fill {:type :paint}
812814
:text-overrun {:type :enum :of javafx.scene.control.OverrunStyle}

src/cljfx/dev/help.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
(.getEnumConstants (resolve of)))]
99
(str "either of: " (str/join ", " options))))
1010

11+
(defmethod short-keyword-prop-help-string :nilable [{:keys [of]}]
12+
(str "nil or " (short-keyword-prop-help-string of)))
13+
1114
(defmethod short-keyword-prop-help-string :coll [{:keys [item]}]
1215
(str "coll of " (short-keyword-prop-help-string item)))
1316

@@ -225,6 +228,11 @@
225228
(defn- splice-syntax [& syntaxes]
226229
(reduce #(into %1 (if (string? %2) [%2] %2)) [] syntaxes))
227230

231+
(defmethod long-keyword-prop-help-syntax :nilable [{:keys [of]}]
232+
(splice-syntax
233+
"Nilable "
234+
(long-keyword-prop-help-syntax of)))
235+
228236
(defmethod long-keyword-prop-help-syntax :desc [{:keys [of]}]
229237
["Cljfx desc, a map with :fx/type key
230238

0 commit comments

Comments
 (0)