resin 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/amber/css/amber-normalize.css +73 -73
- data/amber/css/amber-normalize.less +1 -1
- data/amber/css/amber.css +106 -106
- data/amber/css/helios.css +242 -0
- data/amber/images/hsplitter.png +0 -0
- data/amber/images/vsplitter.png +0 -0
- data/amber/js/Benchfib.deploy.js +116 -38
- data/amber/js/Benchfib.js +120 -42
- data/amber/js/Canvas.deploy.js +674 -403
- data/amber/js/Canvas.js +682 -411
- data/amber/js/Compiler-AST.deploy.js +1150 -0
- data/amber/js/Compiler-AST.js +1591 -0
- data/amber/js/Compiler-Core.deploy.js +1562 -0
- data/amber/js/Compiler-Core.js +1972 -0
- data/amber/js/Compiler-Exceptions.deploy.js +114 -0
- data/amber/js/Compiler-Exceptions.js +161 -0
- data/amber/js/Compiler-IR.deploy.js +2326 -0
- data/amber/js/Compiler-IR.js +3146 -0
- data/amber/js/Compiler-Inlining.deploy.js +1147 -0
- data/amber/js/Compiler-Inlining.js +1514 -0
- data/amber/js/Compiler-Semantic.deploy.js +1207 -0
- data/amber/js/Compiler-Semantic.js +1628 -0
- data/amber/js/Compiler-Tests.deploy.js +646 -60
- data/amber/js/Compiler-Tests.js +843 -82
- data/amber/js/Compiler.deploy.js +1097 -159
- data/amber/js/Compiler.js +1414 -161
- data/amber/js/Examples.deploy.js +31 -15
- data/amber/js/Examples.js +33 -17
- data/amber/js/Helios-Announcements.deploy.js +127 -0
- data/amber/js/Helios-Announcements.js +157 -0
- data/amber/js/Helios-Browser.deploy.js +1473 -0
- data/amber/js/Helios-Browser.js +1953 -0
- data/amber/js/Helios-Commands.deploy.js +403 -0
- data/amber/js/Helios-Commands.js +563 -0
- data/amber/js/Helios-Core.deploy.js +1070 -0
- data/amber/js/Helios-Core.js +1445 -0
- data/amber/js/Helios-Environments.deploy.js +132 -0
- data/amber/js/Helios-Environments.js +179 -0
- data/amber/js/Helios-Inspector.deploy.js +855 -0
- data/amber/js/Helios-Inspector.js +1155 -0
- data/amber/js/Helios-KeyBindings.deploy.js +753 -0
- data/amber/js/Helios-KeyBindings.js +1023 -0
- data/amber/js/Helios-Layout.deploy.js +383 -0
- data/amber/js/Helios-Layout.js +523 -0
- data/amber/js/Helios-Workspace.deploy.js +799 -0
- data/amber/js/Helios-Workspace.js +1074 -0
- data/amber/js/IDE.deploy.js +2541 -1490
- data/amber/js/IDE.js +2721 -1660
- data/amber/js/Importer-Exporter.deploy.js +671 -0
- data/amber/js/Importer-Exporter.js +816 -0
- data/amber/js/Kernel-Announcements.deploy.js +137 -20
- data/amber/js/Kernel-Announcements.js +176 -22
- data/amber/js/Kernel-Classes.deploy.js +555 -168
- data/amber/js/Kernel-Classes.js +662 -205
- data/amber/js/Kernel-Collections.deploy.js +1403 -618
- data/amber/js/Kernel-Collections.js +1545 -690
- data/amber/js/Kernel-Exceptions.deploy.js +109 -45
- data/amber/js/Kernel-Exceptions.js +123 -49
- data/amber/js/Kernel-Methods.deploy.js +196 -81
- data/amber/js/Kernel-Methods.js +214 -89
- data/amber/js/Kernel-Objects.deploy.js +1542 -1117
- data/amber/js/Kernel-Objects.js +1593 -1148
- data/amber/js/Kernel-Tests.deploy.js +1725 -772
- data/amber/js/Kernel-Tests.js +2301 -1123
- data/amber/js/Kernel-Transcript.deploy.js +23 -25
- data/amber/js/Kernel-Transcript.js +24 -26
- data/amber/js/SUnit.deploy.js +204 -131
- data/amber/js/SUnit.js +222 -139
- data/amber/js/Spaces.deploy.js +240 -0
- data/amber/js/Spaces.js +326 -0
- data/amber/js/amber.js +26 -7
- data/amber/js/boot.js +65 -47
- data/amber/js/init.js +1 -1
- data/amber/js/lib/CodeMirror/amber.css +21 -21
- data/amber/js/lib/CodeMirror/codemirror.css +119 -13
- data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
- data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
- data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
- data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
- data/amber/st/Compiler-AST.st +505 -0
- data/amber/st/Compiler-Core.st +835 -0
- data/amber/st/Compiler-Exceptions.st +87 -0
- data/amber/st/Compiler-IR.st +1097 -0
- data/amber/st/Compiler-Inlining.st +650 -0
- data/amber/st/Compiler-Semantic.st +558 -0
- data/amber/st/Compiler-Tests.st +285 -381
- data/amber/st/Compiler.st +725 -2
- data/amber/st/Helios-Announcements.st +104 -0
- data/amber/st/Helios-Browser.st +708 -0
- data/amber/st/Helios-Commands.st +223 -0
- data/amber/st/Helios-Core.st +532 -0
- data/amber/st/Helios-Environments.st +98 -0
- data/amber/st/Helios-Inspector.st +367 -0
- data/amber/st/Helios-KeyBindings.st +337 -0
- data/amber/st/Helios-Layout.st +199 -0
- data/amber/st/Helios-Workspace.st +367 -0
- data/amber/st/IDE.st +75 -53
- data/amber/st/Importer-Exporter.st +386 -0
- data/amber/st/Kernel-Announcements.st +92 -0
- data/amber/st/Kernel-Classes.st +137 -15
- data/amber/st/Kernel-Collections.st +137 -47
- data/amber/st/Kernel-Exceptions.st +14 -0
- data/amber/st/Kernel-Methods.st +9 -1
- data/amber/st/Kernel-Objects.st +29 -5
- data/amber/st/Kernel-Tests.st +545 -199
- data/amber/st/SUnit.st +10 -0
- data/amber/st/Spaces.st +142 -0
- data/lib/resin/app.rb +1 -1
- metadata +86 -31
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Smalltalk current createPackage: 'Helios-Announcements' properties: #{}!
|
|
2
|
+
Object subclass: #HLAnnouncement
|
|
3
|
+
instanceVariableNames: ''
|
|
4
|
+
package: 'Helios-Announcements'!
|
|
5
|
+
|
|
6
|
+
HLAnnouncement subclass: #HLCodeHandled
|
|
7
|
+
instanceVariableNames: 'code'
|
|
8
|
+
package: 'Helios-Announcements'!
|
|
9
|
+
|
|
10
|
+
!HLCodeHandled methodsFor: 'accessing'!
|
|
11
|
+
|
|
12
|
+
code
|
|
13
|
+
|
|
14
|
+
^ code
|
|
15
|
+
!
|
|
16
|
+
|
|
17
|
+
code: aModel
|
|
18
|
+
|
|
19
|
+
code := aModel
|
|
20
|
+
! !
|
|
21
|
+
|
|
22
|
+
!HLCodeHandled class methodsFor: 'actions'!
|
|
23
|
+
|
|
24
|
+
on: aCodeModel
|
|
25
|
+
|
|
26
|
+
^ self new
|
|
27
|
+
code: aCodeModel;
|
|
28
|
+
yourself
|
|
29
|
+
! !
|
|
30
|
+
|
|
31
|
+
HLCodeHandled subclass: #HLDoItExecuted
|
|
32
|
+
instanceVariableNames: ''
|
|
33
|
+
package: 'Helios-Announcements'!
|
|
34
|
+
|
|
35
|
+
HLCodeHandled subclass: #HLDoItRequested
|
|
36
|
+
instanceVariableNames: ''
|
|
37
|
+
package: 'Helios-Announcements'!
|
|
38
|
+
|
|
39
|
+
HLCodeHandled subclass: #HLInspectItRequested
|
|
40
|
+
instanceVariableNames: ''
|
|
41
|
+
package: 'Helios-Announcements'!
|
|
42
|
+
|
|
43
|
+
HLCodeHandled subclass: #HLPrintItRequested
|
|
44
|
+
instanceVariableNames: ''
|
|
45
|
+
package: 'Helios-Announcements'!
|
|
46
|
+
|
|
47
|
+
HLAnnouncement subclass: #HLDiveRequested
|
|
48
|
+
instanceVariableNames: ''
|
|
49
|
+
package: 'Helios-Announcements'!
|
|
50
|
+
|
|
51
|
+
HLAnnouncement subclass: #HLItemSelected
|
|
52
|
+
instanceVariableNames: 'item'
|
|
53
|
+
package: 'Helios-Announcements'!
|
|
54
|
+
|
|
55
|
+
!HLItemSelected methodsFor: 'accessing'!
|
|
56
|
+
|
|
57
|
+
item
|
|
58
|
+
^ item
|
|
59
|
+
!
|
|
60
|
+
|
|
61
|
+
item: anObject
|
|
62
|
+
item := anObject
|
|
63
|
+
! !
|
|
64
|
+
|
|
65
|
+
!HLItemSelected class methodsFor: 'instance creation'!
|
|
66
|
+
|
|
67
|
+
on: anItem
|
|
68
|
+
^ self new
|
|
69
|
+
item: anItem;
|
|
70
|
+
yourself
|
|
71
|
+
! !
|
|
72
|
+
|
|
73
|
+
HLItemSelected subclass: #HLClassSelected
|
|
74
|
+
instanceVariableNames: ''
|
|
75
|
+
package: 'Helios-Announcements'!
|
|
76
|
+
|
|
77
|
+
HLItemSelected subclass: #HLInstanceVariableSelected
|
|
78
|
+
instanceVariableNames: ''
|
|
79
|
+
package: 'Helios-Announcements'!
|
|
80
|
+
|
|
81
|
+
HLItemSelected subclass: #HLMethodSelected
|
|
82
|
+
instanceVariableNames: ''
|
|
83
|
+
package: 'Helios-Announcements'!
|
|
84
|
+
|
|
85
|
+
HLItemSelected subclass: #HLPackageSelected
|
|
86
|
+
instanceVariableNames: ''
|
|
87
|
+
package: 'Helios-Announcements'!
|
|
88
|
+
|
|
89
|
+
HLItemSelected subclass: #HLProtocolSelected
|
|
90
|
+
instanceVariableNames: ''
|
|
91
|
+
package: 'Helios-Announcements'!
|
|
92
|
+
|
|
93
|
+
HLAnnouncement subclass: #HLRefreshRequested
|
|
94
|
+
instanceVariableNames: ''
|
|
95
|
+
package: 'Helios-Announcements'!
|
|
96
|
+
|
|
97
|
+
HLAnnouncement subclass: #HLShowCommentToggled
|
|
98
|
+
instanceVariableNames: ''
|
|
99
|
+
package: 'Helios-Announcements'!
|
|
100
|
+
|
|
101
|
+
HLAnnouncement subclass: #HLShowInstanceToggled
|
|
102
|
+
instanceVariableNames: ''
|
|
103
|
+
package: 'Helios-Announcements'!
|
|
104
|
+
|
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
Smalltalk current createPackage: 'Helios-Browser' properties: #{}!
|
|
2
|
+
HLWidget subclass: #HLBrowser
|
|
3
|
+
instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
|
|
4
|
+
package: 'Helios-Browser'!
|
|
5
|
+
|
|
6
|
+
!HLBrowser methodsFor: 'accessing'!
|
|
7
|
+
|
|
8
|
+
announcer
|
|
9
|
+
^ self model announcer
|
|
10
|
+
!
|
|
11
|
+
|
|
12
|
+
environment
|
|
13
|
+
^ self model environment
|
|
14
|
+
!
|
|
15
|
+
|
|
16
|
+
model
|
|
17
|
+
^ model ifNil: [ model := HLBrowserModel new ]
|
|
18
|
+
!
|
|
19
|
+
|
|
20
|
+
model: aModel
|
|
21
|
+
model := aModel
|
|
22
|
+
! !
|
|
23
|
+
|
|
24
|
+
!HLBrowser methodsFor: 'keybindings'!
|
|
25
|
+
|
|
26
|
+
registerBindingsOn: aBindingGroup
|
|
27
|
+
aBindingGroup
|
|
28
|
+
addGroupKey: 66 labelled: 'Browse';
|
|
29
|
+
addGroupKey: 71 labelled: 'Go to';
|
|
30
|
+
addGroupKey: 84 labelled: 'Toggle'.
|
|
31
|
+
|
|
32
|
+
HLBrowserCommand withAllSubclasses do: [ :each |
|
|
33
|
+
each key ifNotNil: [
|
|
34
|
+
(aBindingGroup at: each bindingGroup)
|
|
35
|
+
add: (each on: self model) asBinding ] ]
|
|
36
|
+
! !
|
|
37
|
+
|
|
38
|
+
!HLBrowser methodsFor: 'rendering'!
|
|
39
|
+
|
|
40
|
+
renderContentOn: html
|
|
41
|
+
html with: (HLContainer with: (HLHorizontalSplitter
|
|
42
|
+
with: (HLVerticalSplitter
|
|
43
|
+
with: (HLVerticalSplitter
|
|
44
|
+
with: self packagesListWidget
|
|
45
|
+
with: self classesListWidget)
|
|
46
|
+
with: (HLVerticalSplitter
|
|
47
|
+
with: self protocolsListWidget
|
|
48
|
+
with: self methodsListWidget))
|
|
49
|
+
with: self sourceWidget))
|
|
50
|
+
! !
|
|
51
|
+
|
|
52
|
+
!HLBrowser methodsFor: 'widgets'!
|
|
53
|
+
|
|
54
|
+
classesListWidget
|
|
55
|
+
^ classesListWidget ifNil: [
|
|
56
|
+
classesListWidget := HLClassesListWidget on: self model.
|
|
57
|
+
classesListWidget next: self protocolsListWidget ]
|
|
58
|
+
!
|
|
59
|
+
|
|
60
|
+
methodsListWidget
|
|
61
|
+
^ methodsListWidget ifNil: [
|
|
62
|
+
methodsListWidget := HLMethodsListWidget on: self model ]
|
|
63
|
+
!
|
|
64
|
+
|
|
65
|
+
packagesListWidget
|
|
66
|
+
^ packagesListWidget ifNil: [
|
|
67
|
+
packagesListWidget := HLPackagesListWidget on: self model.
|
|
68
|
+
packagesListWidget next: self classesListWidget ]
|
|
69
|
+
!
|
|
70
|
+
|
|
71
|
+
protocolsListWidget
|
|
72
|
+
^ protocolsListWidget ifNil: [
|
|
73
|
+
protocolsListWidget := HLProtocolsListWidget on: self model.
|
|
74
|
+
protocolsListWidget next: self methodsListWidget ]
|
|
75
|
+
!
|
|
76
|
+
|
|
77
|
+
sourceWidget
|
|
78
|
+
^ sourceWidget ifNil: [
|
|
79
|
+
sourceWidget := HLBrowserSourceWidget on: self model ]
|
|
80
|
+
! !
|
|
81
|
+
|
|
82
|
+
HLBrowser class instanceVariableNames: 'nextId'!
|
|
83
|
+
|
|
84
|
+
!HLBrowser class methodsFor: 'accessing'!
|
|
85
|
+
|
|
86
|
+
nextId
|
|
87
|
+
nextId ifNil: [ nextId := 0 ].
|
|
88
|
+
^ 'browser_', (nextId + 1) asString
|
|
89
|
+
!
|
|
90
|
+
|
|
91
|
+
tabLabel
|
|
92
|
+
^ 'Browser'
|
|
93
|
+
!
|
|
94
|
+
|
|
95
|
+
tabPriority
|
|
96
|
+
^ 0
|
|
97
|
+
! !
|
|
98
|
+
|
|
99
|
+
!HLBrowser class methodsFor: 'testing'!
|
|
100
|
+
|
|
101
|
+
canBeOpenAsTab
|
|
102
|
+
^ true
|
|
103
|
+
! !
|
|
104
|
+
|
|
105
|
+
HLNavigationListWidget subclass: #HLBrowserListWidget
|
|
106
|
+
instanceVariableNames: 'model'
|
|
107
|
+
package: 'Helios-Browser'!
|
|
108
|
+
|
|
109
|
+
!HLBrowserListWidget methodsFor: 'accessing'!
|
|
110
|
+
|
|
111
|
+
model
|
|
112
|
+
^ model
|
|
113
|
+
!
|
|
114
|
+
|
|
115
|
+
model: aBrowserModel
|
|
116
|
+
model := aBrowserModel.
|
|
117
|
+
|
|
118
|
+
self observeModel
|
|
119
|
+
! !
|
|
120
|
+
|
|
121
|
+
!HLBrowserListWidget methodsFor: 'actions'!
|
|
122
|
+
|
|
123
|
+
observeModel
|
|
124
|
+
! !
|
|
125
|
+
|
|
126
|
+
!HLBrowserListWidget class methodsFor: 'instance creation'!
|
|
127
|
+
|
|
128
|
+
on: aModel
|
|
129
|
+
^ self new
|
|
130
|
+
model: aModel;
|
|
131
|
+
yourself
|
|
132
|
+
! !
|
|
133
|
+
|
|
134
|
+
HLBrowserListWidget subclass: #HLClassesListWidget
|
|
135
|
+
instanceVariableNames: ''
|
|
136
|
+
package: 'Helios-Browser'!
|
|
137
|
+
|
|
138
|
+
!HLClassesListWidget methodsFor: 'accessing'!
|
|
139
|
+
|
|
140
|
+
getChildrenOf: aClass
|
|
141
|
+
^ self items select: [ :each | each superclass = aClass ]
|
|
142
|
+
!
|
|
143
|
+
|
|
144
|
+
getRootClassesOf: aCollection
|
|
145
|
+
^ aCollection select: [ :each |
|
|
146
|
+
(each allSuperclasses intersection: aCollection) isEmpty ]
|
|
147
|
+
!
|
|
148
|
+
|
|
149
|
+
iconForItem: aClass
|
|
150
|
+
^ aClass theNonMetaClass comment isEmpty
|
|
151
|
+
ifFalse: [ 'icon-none' ]
|
|
152
|
+
ifTrue: [ 'icon-question-sign' ]
|
|
153
|
+
!
|
|
154
|
+
|
|
155
|
+
showInstance
|
|
156
|
+
^ self model showInstance
|
|
157
|
+
! !
|
|
158
|
+
|
|
159
|
+
!HLClassesListWidget methodsFor: 'actions'!
|
|
160
|
+
|
|
161
|
+
focusMethodsListWidget
|
|
162
|
+
self model announcer announce: HLMethodsListFocus new
|
|
163
|
+
!
|
|
164
|
+
|
|
165
|
+
focusProtocolsListWidget
|
|
166
|
+
self model announcer announce: HLProtocolsListFocus new
|
|
167
|
+
!
|
|
168
|
+
|
|
169
|
+
observeModel
|
|
170
|
+
self model announcer
|
|
171
|
+
on: HLPackageSelected do: [ :ann | self onPackageSelected: ann item ];
|
|
172
|
+
on: HLShowInstanceToggled do: [ :ann | self onShowInstanceToggled ];
|
|
173
|
+
on: HLClassSelected do: [ :ann | self onClassSelected: ann item ]
|
|
174
|
+
!
|
|
175
|
+
|
|
176
|
+
selectItem: aClass
|
|
177
|
+
super selectItem: aClass.
|
|
178
|
+
self model selectedClass: aClass
|
|
179
|
+
!
|
|
180
|
+
|
|
181
|
+
showInstance: aBoolean
|
|
182
|
+
self model showInstance: aBoolean
|
|
183
|
+
! !
|
|
184
|
+
|
|
185
|
+
!HLClassesListWidget methodsFor: 'reactions'!
|
|
186
|
+
|
|
187
|
+
onClassSelected: aClass
|
|
188
|
+
self focus
|
|
189
|
+
!
|
|
190
|
+
|
|
191
|
+
onPackageSelected: aPackage
|
|
192
|
+
self selectedItem: nil.
|
|
193
|
+
|
|
194
|
+
self items: (aPackage
|
|
195
|
+
ifNil: [ #() ]
|
|
196
|
+
ifNotNil: [ (aPackage classes
|
|
197
|
+
collect: [ :each | each theNonMetaClass ]) asSet asArray ]).
|
|
198
|
+
|
|
199
|
+
self refresh
|
|
200
|
+
!
|
|
201
|
+
|
|
202
|
+
onShowInstanceToggled
|
|
203
|
+
self refresh
|
|
204
|
+
! !
|
|
205
|
+
|
|
206
|
+
!HLClassesListWidget methodsFor: 'rendering'!
|
|
207
|
+
|
|
208
|
+
renderButtonsOn: html
|
|
209
|
+
html div
|
|
210
|
+
class: 'btn-group';
|
|
211
|
+
at: 'data-toggle' put: 'buttons-radio';
|
|
212
|
+
with: [
|
|
213
|
+
html button
|
|
214
|
+
class: (String streamContents: [ :str |
|
|
215
|
+
str nextPutAll: 'btn'.
|
|
216
|
+
self showInstance ifTrue: [
|
|
217
|
+
str nextPutAll: ' active'] ]);
|
|
218
|
+
with: 'Instance';
|
|
219
|
+
onClick: [ self showInstance: true ].
|
|
220
|
+
html button
|
|
221
|
+
class: (String streamContents: [ :str |
|
|
222
|
+
str nextPutAll: 'btn'.
|
|
223
|
+
self model showInstance ifFalse: [
|
|
224
|
+
str nextPutAll: ' active'] ]);
|
|
225
|
+
with: 'Class';
|
|
226
|
+
onClick: [ self model showInstance: false ] ].
|
|
227
|
+
|
|
228
|
+
html button
|
|
229
|
+
class: 'btn';
|
|
230
|
+
at: 'data-toggle' put: 'button';
|
|
231
|
+
with: 'Comment'
|
|
232
|
+
!
|
|
233
|
+
|
|
234
|
+
renderItem: aClass level: anInteger on: html
|
|
235
|
+
| li |
|
|
236
|
+
|
|
237
|
+
li := html li.
|
|
238
|
+
li
|
|
239
|
+
at: 'list-data' put: (self items indexOf: aClass);
|
|
240
|
+
class: (self cssClassForItem: aClass);
|
|
241
|
+
with: [
|
|
242
|
+
html a
|
|
243
|
+
with: [
|
|
244
|
+
(html tag: 'i') class: (self iconForItem: aClass).
|
|
245
|
+
self renderItemLabel: aClass level: anInteger on: html ];
|
|
246
|
+
onClick: [
|
|
247
|
+
self activateListItem: li asJQuery ] ].
|
|
248
|
+
|
|
249
|
+
(self getChildrenOf: aClass) do: [ :each |
|
|
250
|
+
self renderItem: each level: anInteger + 1 on: html ]
|
|
251
|
+
!
|
|
252
|
+
|
|
253
|
+
renderItem: aClass on: html
|
|
254
|
+
super renderItem: aClass on: html.
|
|
255
|
+
(self getChildrenOf: aClass) do: [ :each |
|
|
256
|
+
self renderItem: each level: 1 on: html ]
|
|
257
|
+
!
|
|
258
|
+
|
|
259
|
+
renderItemLabel: aClass level: anInteger on: html
|
|
260
|
+
html span asJQuery html: (String streamContents: [ :str |
|
|
261
|
+
anInteger timesRepeat: [
|
|
262
|
+
str nextPutAll: ' '].
|
|
263
|
+
str nextPutAll: aClass name ])
|
|
264
|
+
!
|
|
265
|
+
|
|
266
|
+
renderItemLabel: aClass on: html
|
|
267
|
+
self renderItemLabel: aClass level: 0 on: html
|
|
268
|
+
!
|
|
269
|
+
|
|
270
|
+
renderListOn: html
|
|
271
|
+
(self getRootClassesOf: self items)
|
|
272
|
+
do: [ :each | self renderItem: each on: html ]
|
|
273
|
+
! !
|
|
274
|
+
|
|
275
|
+
HLBrowserListWidget subclass: #HLMethodsListWidget
|
|
276
|
+
instanceVariableNames: 'selectorsCache'
|
|
277
|
+
package: 'Helios-Browser'!
|
|
278
|
+
|
|
279
|
+
!HLMethodsListWidget methodsFor: 'accessing'!
|
|
280
|
+
|
|
281
|
+
allProtocol
|
|
282
|
+
^ self model allProtocol
|
|
283
|
+
!
|
|
284
|
+
|
|
285
|
+
iconForItem: aCompiledMethod
|
|
286
|
+
| override overriden |
|
|
287
|
+
|
|
288
|
+
override := self isOverride: aCompiledMethod.
|
|
289
|
+
overriden := self isOverriden: aCompiledMethod.
|
|
290
|
+
|
|
291
|
+
^ override
|
|
292
|
+
ifTrue: [ overriden
|
|
293
|
+
ifTrue: [ 'icon-resize-vertical' ]
|
|
294
|
+
ifFalse: [ 'icon-arrow-up' ] ]
|
|
295
|
+
ifFalse: [
|
|
296
|
+
overriden
|
|
297
|
+
ifTrue: [ 'icon-arrow-down' ]
|
|
298
|
+
ifFalse: [ 'icon-none' ] ]
|
|
299
|
+
!
|
|
300
|
+
|
|
301
|
+
methodsInProtocol: aString
|
|
302
|
+
^ aString = self allProtocol
|
|
303
|
+
ifTrue: [ self model selectedClass methods ]
|
|
304
|
+
ifFalse: [ self model selectedClass methodsInProtocol: aString ]
|
|
305
|
+
!
|
|
306
|
+
|
|
307
|
+
overrideSelectors
|
|
308
|
+
^ self selectorsCache
|
|
309
|
+
at: 'override'
|
|
310
|
+
ifAbsentPut: [
|
|
311
|
+
self model selectedClass allSuperclasses
|
|
312
|
+
inject: Set new into: [ :acc :each | acc addAll: each selectors; yourself ] ]
|
|
313
|
+
!
|
|
314
|
+
|
|
315
|
+
overridenSelectors
|
|
316
|
+
^ self selectorsCache
|
|
317
|
+
at: 'overriden'
|
|
318
|
+
ifAbsentPut: [
|
|
319
|
+
self model selectedClass allSubclasses
|
|
320
|
+
inject: Set new into: [ :acc :each | acc addAll: each selectors; yourself ] ]
|
|
321
|
+
!
|
|
322
|
+
|
|
323
|
+
selectorsCache
|
|
324
|
+
^ selectorsCache
|
|
325
|
+
! !
|
|
326
|
+
|
|
327
|
+
!HLMethodsListWidget methodsFor: 'actions'!
|
|
328
|
+
|
|
329
|
+
observeModel
|
|
330
|
+
self model announcer on: HLProtocolSelected do: [ :ann |
|
|
331
|
+
self onProtocolSelected: ann item ].
|
|
332
|
+
self model announcer on: HLShowInstanceToggled do: [ :ann |
|
|
333
|
+
self onProtocolSelected: nil ].
|
|
334
|
+
self model announcer on: HLMethodSelected do: [ :ann |
|
|
335
|
+
self onMethodSelected: ann item ]
|
|
336
|
+
!
|
|
337
|
+
|
|
338
|
+
selectItem: aCompiledMethod
|
|
339
|
+
super selectItem: aCompiledMethod.
|
|
340
|
+
self model selectedMethod: aCompiledMethod
|
|
341
|
+
! !
|
|
342
|
+
|
|
343
|
+
!HLMethodsListWidget methodsFor: 'cache'!
|
|
344
|
+
|
|
345
|
+
flushSelectorsCache
|
|
346
|
+
selectorsCache := Dictionary new
|
|
347
|
+
! !
|
|
348
|
+
|
|
349
|
+
!HLMethodsListWidget methodsFor: 'initialization'!
|
|
350
|
+
|
|
351
|
+
initialize
|
|
352
|
+
super initialize.
|
|
353
|
+
self flushSelectorsCache
|
|
354
|
+
! !
|
|
355
|
+
|
|
356
|
+
!HLMethodsListWidget methodsFor: 'reactions'!
|
|
357
|
+
|
|
358
|
+
onMethodSelected: aMethod
|
|
359
|
+
self focus
|
|
360
|
+
!
|
|
361
|
+
|
|
362
|
+
onProtocolSelected: aString
|
|
363
|
+
self selectedItem: nil.
|
|
364
|
+
|
|
365
|
+
self items: (self model selectedClass
|
|
366
|
+
ifNil: [ #() ]
|
|
367
|
+
ifNotNil: [ aString
|
|
368
|
+
ifNil: [ #() ]
|
|
369
|
+
ifNotNil: [ self methodsInProtocol: aString ] ]).
|
|
370
|
+
|
|
371
|
+
self refresh
|
|
372
|
+
! !
|
|
373
|
+
|
|
374
|
+
!HLMethodsListWidget methodsFor: 'rendering'!
|
|
375
|
+
|
|
376
|
+
renderContentOn: html
|
|
377
|
+
self model showInstance
|
|
378
|
+
ifFalse: [ html div
|
|
379
|
+
class: 'class_side';
|
|
380
|
+
with: [ super renderContentOn: html ] ]
|
|
381
|
+
ifTrue: [ super renderContentOn: html ].
|
|
382
|
+
|
|
383
|
+
self flushSelectorsCache
|
|
384
|
+
!
|
|
385
|
+
|
|
386
|
+
renderItemLabel: aCompiledMethod on: html
|
|
387
|
+
html with: aCompiledMethod selector
|
|
388
|
+
! !
|
|
389
|
+
|
|
390
|
+
!HLMethodsListWidget methodsFor: 'testing'!
|
|
391
|
+
|
|
392
|
+
isOverride: aMethod
|
|
393
|
+
|
|
394
|
+
^ self overrideSelectors includes: aMethod selector
|
|
395
|
+
!
|
|
396
|
+
|
|
397
|
+
isOverriden: aMethod
|
|
398
|
+
|
|
399
|
+
^ self overridenSelectors includes: aMethod selector
|
|
400
|
+
! !
|
|
401
|
+
|
|
402
|
+
HLBrowserListWidget subclass: #HLPackagesListWidget
|
|
403
|
+
instanceVariableNames: ''
|
|
404
|
+
package: 'Helios-Browser'!
|
|
405
|
+
|
|
406
|
+
!HLPackagesListWidget methodsFor: 'accessing'!
|
|
407
|
+
|
|
408
|
+
initializeItems
|
|
409
|
+
^ items := self model packages sort:[:a :b|
|
|
410
|
+
a name < b name]
|
|
411
|
+
!
|
|
412
|
+
|
|
413
|
+
items
|
|
414
|
+
^ items ifNil: [self initializeItems]
|
|
415
|
+
! !
|
|
416
|
+
|
|
417
|
+
!HLPackagesListWidget methodsFor: 'actions'!
|
|
418
|
+
|
|
419
|
+
focusClassesListWidget
|
|
420
|
+
self model announcer announce: HLClassesListFocus new
|
|
421
|
+
!
|
|
422
|
+
|
|
423
|
+
observeModel
|
|
424
|
+
self model announcer on: HLPackageSelected do: [ :ann |
|
|
425
|
+
self onPackageSelected: ann item ]
|
|
426
|
+
!
|
|
427
|
+
|
|
428
|
+
selectItem: aPackage
|
|
429
|
+
super selectItem: aPackage.
|
|
430
|
+
self model selectedPackage: aPackage
|
|
431
|
+
! !
|
|
432
|
+
|
|
433
|
+
!HLPackagesListWidget methodsFor: 'reactions'!
|
|
434
|
+
|
|
435
|
+
onPackageSelected: aPackage
|
|
436
|
+
self focus
|
|
437
|
+
! !
|
|
438
|
+
|
|
439
|
+
!HLPackagesListWidget methodsFor: 'rendering'!
|
|
440
|
+
|
|
441
|
+
renderButtonsOn: html
|
|
442
|
+
|
|
443
|
+
html span class: 'info'; with: 'Auto commit'.
|
|
444
|
+
html div
|
|
445
|
+
class: 'btn-group switch';
|
|
446
|
+
at: 'data-toggle' put: 'buttons-radio';
|
|
447
|
+
with: [
|
|
448
|
+
html button
|
|
449
|
+
class: (String streamContents: [ :str |
|
|
450
|
+
str nextPutAll: 'btn' ]);
|
|
451
|
+
with: 'On'.
|
|
452
|
+
html button
|
|
453
|
+
class: (String streamContents: [ :str |
|
|
454
|
+
str nextPutAll: 'btn active' ]);
|
|
455
|
+
with: 'Off' ].
|
|
456
|
+
|
|
457
|
+
html a
|
|
458
|
+
class: 'btn';
|
|
459
|
+
with: 'Commit'.
|
|
460
|
+
! !
|
|
461
|
+
|
|
462
|
+
HLBrowserListWidget subclass: #HLProtocolsListWidget
|
|
463
|
+
instanceVariableNames: ''
|
|
464
|
+
package: 'Helios-Browser'!
|
|
465
|
+
|
|
466
|
+
!HLProtocolsListWidget methodsFor: 'accessing'!
|
|
467
|
+
|
|
468
|
+
allProtocol
|
|
469
|
+
^ self model allProtocol
|
|
470
|
+
!
|
|
471
|
+
|
|
472
|
+
selectedItem
|
|
473
|
+
^ super selectedItem" ifNil: [ self allProtocol ]"
|
|
474
|
+
! !
|
|
475
|
+
|
|
476
|
+
!HLProtocolsListWidget methodsFor: 'actions'!
|
|
477
|
+
|
|
478
|
+
observeModel
|
|
479
|
+
self model announcer on: HLClassSelected do: [ :ann |
|
|
480
|
+
self onClassSelected: ann item ].
|
|
481
|
+
self model announcer on: HLShowInstanceToggled do: [ :ann |
|
|
482
|
+
self onClassSelected: self model selectedClass ].
|
|
483
|
+
self model announcer on: HLProtocolSelected do: [ :ann |
|
|
484
|
+
self onProtocolSelected: ann item ]
|
|
485
|
+
!
|
|
486
|
+
|
|
487
|
+
selectItem: aString
|
|
488
|
+
super selectItem: aString.
|
|
489
|
+
self model selectedProtocol: aString
|
|
490
|
+
! !
|
|
491
|
+
|
|
492
|
+
!HLProtocolsListWidget methodsFor: 'reactions'!
|
|
493
|
+
|
|
494
|
+
onClassSelected: aClass
|
|
495
|
+
self selectedItem: nil.
|
|
496
|
+
|
|
497
|
+
self items: (aClass
|
|
498
|
+
ifNil: [ Array with: self allProtocol ]
|
|
499
|
+
ifNotNil: [
|
|
500
|
+
(Array with: self allProtocol)
|
|
501
|
+
addAll: aClass protocols;
|
|
502
|
+
yourself ]).
|
|
503
|
+
|
|
504
|
+
self refresh
|
|
505
|
+
!
|
|
506
|
+
|
|
507
|
+
onProtocolSelected: aString
|
|
508
|
+
self focus
|
|
509
|
+
! !
|
|
510
|
+
|
|
511
|
+
!HLProtocolsListWidget methodsFor: 'rendering'!
|
|
512
|
+
|
|
513
|
+
renderContentOn: html
|
|
514
|
+
self model showInstance
|
|
515
|
+
ifFalse: [ html div
|
|
516
|
+
class: 'class_side';
|
|
517
|
+
with: [ super renderContentOn: html ] ]
|
|
518
|
+
ifTrue: [ super renderContentOn: html ]
|
|
519
|
+
! !
|
|
520
|
+
|
|
521
|
+
Object subclass: #HLBrowserModel
|
|
522
|
+
instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedMethod showInstance showComment'
|
|
523
|
+
package: 'Helios-Browser'!
|
|
524
|
+
|
|
525
|
+
!HLBrowserModel methodsFor: 'accessing'!
|
|
526
|
+
|
|
527
|
+
allProtocol
|
|
528
|
+
^ '-- All --'
|
|
529
|
+
!
|
|
530
|
+
|
|
531
|
+
announcer
|
|
532
|
+
^ announcer ifNil: [ announcer := Announcer new ]
|
|
533
|
+
!
|
|
534
|
+
|
|
535
|
+
environment
|
|
536
|
+
^ environment ifNil: [ HLManager current environment ]
|
|
537
|
+
!
|
|
538
|
+
|
|
539
|
+
environment: anEnvironment
|
|
540
|
+
environment := anEnvironment
|
|
541
|
+
!
|
|
542
|
+
|
|
543
|
+
packages
|
|
544
|
+
^ self environment packages
|
|
545
|
+
!
|
|
546
|
+
|
|
547
|
+
selectedClass
|
|
548
|
+
^ selectedClass
|
|
549
|
+
!
|
|
550
|
+
|
|
551
|
+
selectedClass: aClass
|
|
552
|
+
selectedClass = aClass ifFalse: [
|
|
553
|
+
aClass
|
|
554
|
+
ifNil: [ selectedClass := nil ]
|
|
555
|
+
ifNotNil: [
|
|
556
|
+
self showInstance
|
|
557
|
+
ifTrue: [ selectedClass := aClass theNonMetaClass ]
|
|
558
|
+
ifFalse: [ selectedClass := aClass theMetaClass ] ].
|
|
559
|
+
|
|
560
|
+
self
|
|
561
|
+
selectedMethod: nil;
|
|
562
|
+
selectedProtocol: nil ].
|
|
563
|
+
|
|
564
|
+
self announcer announce: (HLClassSelected on: self selectedClass)
|
|
565
|
+
!
|
|
566
|
+
|
|
567
|
+
selectedMethod
|
|
568
|
+
^ selectedMethod
|
|
569
|
+
!
|
|
570
|
+
|
|
571
|
+
selectedMethod: aCompiledMethod
|
|
572
|
+
selectedMethod = aCompiledMethod ifFalse: [
|
|
573
|
+
selectedMethod := aCompiledMethod ].
|
|
574
|
+
|
|
575
|
+
self announcer announce: (HLMethodSelected on: aCompiledMethod)
|
|
576
|
+
!
|
|
577
|
+
|
|
578
|
+
selectedPackage
|
|
579
|
+
^ selectedPackage
|
|
580
|
+
!
|
|
581
|
+
|
|
582
|
+
selectedPackage: aPackage
|
|
583
|
+
selectedPackage = aPackage ifFalse: [
|
|
584
|
+
selectedPackage := aPackage.
|
|
585
|
+
self selectedClass: nil ].
|
|
586
|
+
|
|
587
|
+
self announcer announce: (HLPackageSelected on: aPackage)
|
|
588
|
+
!
|
|
589
|
+
|
|
590
|
+
selectedProtocol
|
|
591
|
+
^ selectedProtocol
|
|
592
|
+
!
|
|
593
|
+
|
|
594
|
+
selectedProtocol: aString
|
|
595
|
+
selectedProtocol = aString ifFalse: [
|
|
596
|
+
selectedProtocol := aString.
|
|
597
|
+
self selectedMethod: nil ].
|
|
598
|
+
|
|
599
|
+
self announcer announce: (HLProtocolSelected on: aString)
|
|
600
|
+
!
|
|
601
|
+
|
|
602
|
+
showComment
|
|
603
|
+
^ showComment ifNil: [ false ]
|
|
604
|
+
!
|
|
605
|
+
|
|
606
|
+
showComment: aBoolean
|
|
607
|
+
showComment := aBoolean.
|
|
608
|
+
|
|
609
|
+
self announcer announce: HLShowCommentToggled new
|
|
610
|
+
!
|
|
611
|
+
|
|
612
|
+
showInstance
|
|
613
|
+
^ showInstance ifNil: [ true ]
|
|
614
|
+
!
|
|
615
|
+
|
|
616
|
+
showInstance: aBoolean
|
|
617
|
+
showInstance := aBoolean.
|
|
618
|
+
|
|
619
|
+
self selectedClass ifNotNil: [
|
|
620
|
+
self selectedClass: (aBoolean
|
|
621
|
+
ifTrue: [self selectedClass theNonMetaClass ]
|
|
622
|
+
ifFalse: [ self selectedClass theMetaClass ]) ].
|
|
623
|
+
|
|
624
|
+
self announcer announce: HLShowInstanceToggled new
|
|
625
|
+
! !
|
|
626
|
+
|
|
627
|
+
!HLBrowserModel class methodsFor: 'actions'!
|
|
628
|
+
|
|
629
|
+
on: anEnvironment
|
|
630
|
+
|
|
631
|
+
^ self new
|
|
632
|
+
environment: anEnvironment;
|
|
633
|
+
yourself
|
|
634
|
+
! !
|
|
635
|
+
|
|
636
|
+
HLWidget subclass: #HLBrowserSourceWidget
|
|
637
|
+
instanceVariableNames: 'model codeWidget'
|
|
638
|
+
package: 'Helios-Browser'!
|
|
639
|
+
|
|
640
|
+
!HLBrowserSourceWidget methodsFor: 'accessing'!
|
|
641
|
+
|
|
642
|
+
codeWidget
|
|
643
|
+
^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]
|
|
644
|
+
!
|
|
645
|
+
|
|
646
|
+
contents
|
|
647
|
+
^ self sourceArea contents
|
|
648
|
+
!
|
|
649
|
+
|
|
650
|
+
contents: aString
|
|
651
|
+
self codeWidget contents: aString
|
|
652
|
+
!
|
|
653
|
+
|
|
654
|
+
model
|
|
655
|
+
^ model
|
|
656
|
+
!
|
|
657
|
+
|
|
658
|
+
model: aBrowserModel
|
|
659
|
+
model := aBrowserModel.
|
|
660
|
+
|
|
661
|
+
self observeModel
|
|
662
|
+
! !
|
|
663
|
+
|
|
664
|
+
!HLBrowserSourceWidget methodsFor: 'actions'!
|
|
665
|
+
|
|
666
|
+
observeModel
|
|
667
|
+
self model announcer on: HLMethodSelected do: [ :ann |
|
|
668
|
+
self onMethodSelected: ann item ].
|
|
669
|
+
self model announcer on: HLClassSelected do: [ :ann |
|
|
670
|
+
self onClassSelected: ann item ].
|
|
671
|
+
self model announcer on: HLProtocolSelected do: [ :ann |
|
|
672
|
+
self onProtocolSelected: ann item ]
|
|
673
|
+
! !
|
|
674
|
+
|
|
675
|
+
!HLBrowserSourceWidget methodsFor: 'reactions'!
|
|
676
|
+
|
|
677
|
+
onClassSelected: aClass
|
|
678
|
+
aClass ifNil: [ ^ self contents: '' ].
|
|
679
|
+
|
|
680
|
+
self contents: aClass definition
|
|
681
|
+
!
|
|
682
|
+
|
|
683
|
+
onMethodSelected: aCompiledMethod
|
|
684
|
+
aCompiledMethod ifNil: [ ^ self contents: '' ].
|
|
685
|
+
|
|
686
|
+
self contents: aCompiledMethod source
|
|
687
|
+
!
|
|
688
|
+
|
|
689
|
+
onProtocolSelected: aString
|
|
690
|
+
self model selectedClass ifNil: [ ^ self contents: '' ].
|
|
691
|
+
|
|
692
|
+
self contents: self model selectedClass definition
|
|
693
|
+
! !
|
|
694
|
+
|
|
695
|
+
!HLBrowserSourceWidget methodsFor: 'rendering'!
|
|
696
|
+
|
|
697
|
+
renderContentOn: html
|
|
698
|
+
self codeWidget renderOn: html
|
|
699
|
+
! !
|
|
700
|
+
|
|
701
|
+
!HLBrowserSourceWidget class methodsFor: 'instance creation'!
|
|
702
|
+
|
|
703
|
+
on: aBrowserModel
|
|
704
|
+
^ self new
|
|
705
|
+
model: aBrowserModel;
|
|
706
|
+
yourself
|
|
707
|
+
! !
|
|
708
|
+
|