66
|
1 |
Object subclass:#WindowBuilder
|
75
|
2 |
instanceVariableNames:'topView application bindings aspects focusSequence'
|
66
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
80
|
5 |
category:'Interface-Support-UI'
|
66
|
6 |
!
|
|
7 |
|
|
8 |
!WindowBuilder class methodsFor:'documentation'!
|
|
9 |
|
|
10 |
documentation
|
|
11 |
"
|
69
|
12 |
a no-op class, for systems which do not use the UIBuilder.
|
66
|
13 |
Concrete subclasses know how to create a view (with components) from
|
|
14 |
some interface spec. Currently, an experimantal version of UIBuilder exists,
|
|
15 |
and more may be added in the future (for example, to parse different UI
|
|
16 |
specs - thinking of motifs UIL specs etc).
|
|
17 |
"
|
|
18 |
! !
|
|
19 |
|
|
20 |
!WindowBuilder methodsFor:'accessing'!
|
|
21 |
|
|
22 |
bindings
|
86
|
23 |
^ bindings
|
66
|
24 |
!
|
|
25 |
|
|
26 |
bindings:aDictionary
|
86
|
27 |
bindings := aDictionary
|
66
|
28 |
!
|
|
29 |
|
|
30 |
focusSequence
|
|
31 |
^ focusSequence
|
|
32 |
!
|
|
33 |
|
|
34 |
aspectAt:aSymbol
|
|
35 |
aspects isNil ifTrue:[^ nil].
|
|
36 |
^ aspects at:aSymbol ifAbsent:nil
|
|
37 |
!
|
|
38 |
|
|
39 |
aspectAt:aSymbol put:aModel
|
|
40 |
aspects isNil ifTrue:[
|
|
41 |
aspects := IdentityDictionary new
|
|
42 |
].
|
|
43 |
^ aspects at:aSymbol put:aModel
|
|
44 |
!
|
|
45 |
|
86
|
46 |
namedComponents
|
|
47 |
^ bindings
|
|
48 |
!
|
|
49 |
|
66
|
50 |
componentAt:name
|
86
|
51 |
bindings isNil ifTrue:[^ nil].
|
75
|
52 |
^ bindings at:name ifAbsent:nil
|
66
|
53 |
!
|
|
54 |
|
86
|
55 |
componentAt:name put:aComponent
|
|
56 |
bindings isNil ifTrue:[
|
|
57 |
bindings := IdentityDictionary new.
|
|
58 |
].
|
|
59 |
bindings at:name put:aComponent
|
|
60 |
!
|
|
61 |
|
69
|
62 |
window:aView
|
|
63 |
topView := aView
|
|
64 |
!
|
|
65 |
|
66
|
66 |
window
|
|
67 |
^ topView
|
|
68 |
!
|
|
69 |
|
|
70 |
windowGroup
|
|
71 |
^ topView windowGroup
|
|
72 |
!
|
|
73 |
|
|
74 |
application
|
|
75 |
^ application
|
|
76 |
!
|
|
77 |
|
|
78 |
application:anApplicationModel
|
|
79 |
application := anApplicationModel
|
|
80 |
!
|
|
81 |
|
|
82 |
source:anApplicationModel
|
|
83 |
application := anApplicationModel
|
|
84 |
! !
|
|
85 |
|
|
86 |
!WindowBuilder methodsFor:'operation'!
|
|
87 |
|
|
88 |
buildFromSpec:aSpec
|
|
89 |
self subclassResponsibility
|
|
90 |
!
|
|
91 |
|
|
92 |
open
|
80
|
93 |
"open my topView, as previously created"
|
|
94 |
|
66
|
95 |
self openWithExtent:nil andType:#normal
|
|
96 |
!
|
|
97 |
|
80
|
98 |
openWithExtent:aPoint
|
|
99 |
"open my topView, as previously created, but override
|
|
100 |
the extent."
|
|
101 |
|
|
102 |
self openWithExtent:aPoint andType:#normal
|
|
103 |
!
|
|
104 |
|
66
|
105 |
openDialog
|
80
|
106 |
"open my topView, as previously created as a modal view,
|
|
107 |
blocking interaction to the currently active view."
|
|
108 |
|
66
|
109 |
self openWithExtent:nil andType:#dialog
|
|
110 |
!
|
|
111 |
|
86
|
112 |
openDialogWithExtent:ext
|
|
113 |
"open my topView, as previously created as a modal view,
|
|
114 |
blocking interaction to the currently active view."
|
|
115 |
|
|
116 |
self openWithExtent:ext andType:#dialog
|
|
117 |
!
|
|
118 |
|
66
|
119 |
openWithExtent:ext andType:type
|
80
|
120 |
"open my topView, as previously created. The type argument
|
|
121 |
may be #dialog or #normal, and specifies if the view should
|
|
122 |
be opened as a modal view, blocking interaction to the currently
|
|
123 |
active view, or as a normal view."
|
|
124 |
|
66
|
125 |
ext notNil ifTrue:[
|
|
126 |
topView extent:ext
|
|
127 |
].
|
|
128 |
type == #dialog ifTrue:[
|
|
129 |
topView openModal.
|
|
130 |
^ self
|
|
131 |
].
|
|
132 |
|
|
133 |
type == #normal ifTrue:[
|
|
134 |
topView open.
|
|
135 |
^ self
|
|
136 |
].
|
80
|
137 |
"
|
|
138 |
if ST-80 supports more types - these may be added later
|
|
139 |
"
|
66
|
140 |
self halt:'unimplemented'
|
|
141 |
!
|
|
142 |
|
|
143 |
closeRequest
|
|
144 |
topView destroy
|
|
145 |
! !
|