Skip to content

Commit

Permalink
::tabs-window
Browse files Browse the repository at this point in the history
  • Loading branch information
unclebob committed Jun 23, 2023
1 parent 8974186 commit 1455331
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/more_speech/mem.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[more-speech.types.tab :as tab-type]
[more-speech.types.event-counter :as event-counter-type]
[more-speech.types.user-configuration :as user-configuration-type]
[more-speech.types.event :as event-type])
[more-speech.types.event :as event-type]
[more-speech.types.tabs-window :as tabs-window-type])
(:import (javax.swing JFrame)
(javax.swing.tree DefaultMutableTreeNode)))

Expand Down Expand Up @@ -84,8 +85,8 @@
::relay-manager-frame
::event-handler
::article-panel
::tabs-window-type/tabs-window

::tabs-window
::user-window

::backing-up]))
Expand Down
22 changes: 22 additions & 0 deletions src/more_speech/types/tabs_window.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(ns more-speech.types.tabs-window
(:require [clojure.spec.alpha :as s])
(:import (javax.swing JList)))

(s/def ::id number?)
(s/def ::tab-name string?)
(s/def ::selected (s/coll-of
(s/or :id ::id
:match string?)))
(s/def ::blocked (s/coll-of ::id))
(s/def ::selected-listbox #(instance? JList %))
(s/def ::tab-data (s/keys :opt-un [::selected
::selected-listbox
::blocked]))

(s/def ::all-ids (s/coll-of ::id))

(s/def ::tabs-window ; a map of tab names to tab data or :all-ids to a list of ids.
(s/map-of (s/or :tab-data ::tab-name
:all-ids #(= :all-ids %))
(s/or :tab-data ::tab-data
:all-ids ::all-ids)))

0 comments on commit 1455331

Please sign in to comment.