author | Claus Gittinger <cg@exept.de> |
Fri, 18 May 2018 04:26:05 +0200 | |
changeset 18134 | d345dd754f11 |
parent 17572 | 4356f78e5f62 |
child 18360 | f1d315d42985 |
permissions | -rw-r--r-- |
5141 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3712 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
15085
dac5a348dd09
class: CodeGeneratorTool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14966
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
dac5a348dd09
class: CodeGeneratorTool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14966
diff
changeset
|
15 |
|
3712 | 16 |
Object subclass:#CodeGeneratorTool |
9757
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
17 |
instanceVariableNames:'compositeChangeCollector compositeChangeNesting userPreferences |
11170 | 18 |
generateComments confirmChanges targetClass' |
9757
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
19 |
classVariableNames:'GenerateCommentsForGetters GenerateCommentsForSetters |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
20 |
CopyrightTemplate' |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
21 |
poolDictionaries:'' |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
22 |
category:'Interface-Browsers' |
3712 | 23 |
! |
24 |
||
3719 | 25 |
!CodeGeneratorTool class methodsFor:'documentation'! |
26 |
||
5141 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
3719 | 41 |
documentation |
42 |
" |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
43 |
This utility class contains various code generation facilites; |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
44 |
these were extracted from the old and newBrowser. |
6791
6559c9ebb561
Keep method argument names when generating required methods
Stefan Vogel <sv@exept.de>
parents:
6718
diff
changeset
|
45 |
There is probably more to come... |
3719 | 46 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
47 |
Note: being refactored into separate per-language generators |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
48 |
|
3719 | 49 |
[author:] |
50 |
Claus Gittiner |
|
51 |
" |
|
52 |
! ! |
|
3712 | 53 |
|
8572 | 54 |
!CodeGeneratorTool class methodsFor:'instance creation'! |
55 |
||
56 |
new |
|
57 |
^ self basicNew initialize. |
|
58 |
! ! |
|
59 |
||
3712 | 60 |
!CodeGeneratorTool class methodsFor:'code generation'! |
61 |
||
62 |
createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
63 |
"create accessors in aClass" |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
64 |
|
5758 | 65 |
^ self new |
6313 | 66 |
createAccessMethodsFor:aCollectionOfVarNames |
67 |
in:aClass |
|
68 |
withChange:withChange |
|
69 |
asValueHolder:asValueHolder |
|
70 |
readersOnly:readersOnly |
|
71 |
writersOnly:writersOnly |
|
4444
6b077945517c
generate instvar accessors with lazy-init
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
72 |
! |
6b077945517c
generate instvar accessors with lazy-init
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
73 |
|
3712 | 74 |
createApplicationCodeFor:aClass |
75 |
"create an empty application framework" |
|
76 |
||
5758 | 77 |
^ self new createApplicationCodeFor:aClass |
3712 | 78 |
! |
79 |
||
3804 | 80 |
createClassResponsibleProtocolFor:aClass |
81 |
"create stubs for the required protocol" |
|
82 |
||
5758 | 83 |
^ self new createClassResponsibleProtocolFor:aClass |
3804 | 84 |
! |
85 |
||
5124 | 86 |
createClassTypeTestMethodsIn:aClass forClasses:subClasses |
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
87 |
"create a #isXXX test methods (I'm tired of typing)" |
4351 | 88 |
|
5758 | 89 |
^ self new createClassTypeTestMethodsIn:aClass forClasses:subClasses |
4351 | 90 |
! |
91 |
||
3712 | 92 |
createDocumentationMethodsFor:aClass |
93 |
"create empty documentation methods" |
|
94 |
||
5758 | 95 |
^ self new createDocumentationMethodsFor:aClass |
3712 | 96 |
! |
97 |
||
6313 | 98 |
createEnumTypeCodeFor:aClass |
99 |
^ self new createEnumTypeCodeFor:aClass |
|
100 |
! |
|
101 |
||
9125
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
102 |
createInitializationMethodIn:aClass |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
103 |
"create a #initialize methods (I'm tired of typing)" |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
104 |
|
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
105 |
^ self new createInitializationMethodIn:aClass |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
106 |
! |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
107 |
|
6718 | 108 |
createInitializedInstanceCreationMethodsIn:aClass |
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
109 |
"create a #new and #initialize methods (I'm tired of typing)" |
3712 | 110 |
|
6718 | 111 |
^ self new createInitializedInstanceCreationMethodsIn:aClass |
112 |
! |
|
113 |
||
13627 | 114 |
createIsAbstractMethodIn:aClass |
115 |
"create a #isABstract query method (I'm tired of typing)" |
|
116 |
||
117 |
^ self new createIsAbstractMethodIn:aClass |
|
118 |
! |
|
119 |
||
6718 | 120 |
createParametrizedInstanceCreationMethodsNamed:selector in:aClass |
121 |
"create a #selector instance creation method (I'm tired of typing)" |
|
122 |
||
123 |
^ self new createParametrizedInstanceCreationMethodsNamed:selector in:aClass |
|
3712 | 124 |
! |
125 |
||
8344
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
126 |
createRedefinedInstanceCreationMethodsIn:aClass |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
127 |
"create a redefined #new method" |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
128 |
|
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
129 |
^ self new createRedefinedInstanceCreationMethodsIn:aClass |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
130 |
! |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
131 |
|
9757
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
132 |
createSingletonPatternInstanceCreationMethodsIn:aClass usingVariable:varName |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
133 |
"create redefined #new method for singleton pattern" |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
134 |
|
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
135 |
^ self new createSingletonPatternInstanceCreationMethodsIn:aClass usingVariable:varName |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
136 |
|
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
137 |
"Created: / 10-02-2011 / 16:32:43 / cg" |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
138 |
! |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
139 |
|
10592 | 140 |
createStandaloneStartupCodeFor:aClass |
141 |
"create an empty console application framework" |
|
142 |
||
143 |
^ self new createStandaloneStartupCodeFor:aClass |
|
144 |
||
145 |
"Created: / 19-08-2011 / 01:58:57 / cg" |
|
146 |
! |
|
147 |
||
9081 | 148 |
createStartupCodeFor:aClass forStartOf:anApplicationClassOrNil |
9049
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
149 |
"create standAloneStartup code" |
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
150 |
|
9081 | 151 |
^ self new createStartupCodeFor:aClass forStartOf:anApplicationClassOrNil |
9049
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
152 |
! |
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
153 |
|
3712 | 154 |
createTestCaseSampleCodeFor:aClass |
4590 | 155 |
"create an (almost) empty testCase class" |
3712 | 156 |
|
5758 | 157 |
^ self new createTestCaseSampleCodeFor:aClass |
3712 | 158 |
! |
159 |
||
160 |
createVisitorMethodsIn:visitedClass andVisitorClass:visitorClass |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
161 |
"create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)" |
3712 | 162 |
|
5758 | 163 |
^ self new createVisitorMethodsIn:visitedClass andVisitorClass:visitorClass |
3712 | 164 |
! |
165 |
||
6050 | 166 |
createWebApplicationCodeFor:aClass |
167 |
"create an empty webApplication framework" |
|
168 |
||
169 |
^ self new createWebApplicationCodeFor:aClass |
|
170 |
! |
|
171 |
||
7973 | 172 |
createWebServiceCodeFor:aClass |
173 |
"create an empty webService framework" |
|
174 |
||
175 |
^ self new createWebServiceCodeFor:aClass |
|
176 |
! |
|
177 |
||
8572 | 178 |
createWidgetCodeFor:aClass |
179 |
"create usually required widget code (redraw, model update, event handling)" |
|
180 |
||
181 |
^ self new createWidgetCodeFor:aClass |
|
182 |
! |
|
183 |
||
3712 | 184 |
initialMenuSpecMethodSourceForApplications |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
185 |
"return code for a menuSpec with typical stuff in it" |
3712 | 186 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
187 |
self subclassResponsibility |
7973 | 188 |
! |
189 |
||
190 |
initialPageMenuSpecMethodSourceForWebApplications |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
191 |
"return code for a menuSpec with typical stuff in it" |
7973 | 192 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
193 |
self subclassResponsibility |
7973 | 194 |
|
195 |
" |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
196 |
SmalltalkCodeGeneratorTool initialPageMenuSpecMethodSourceForWebApplications |
7973 | 197 |
" |
198 |
! |
|
199 |
||
200 |
initialPageSpecMethodSourceForWebApplications |
|
201 |
"return an empty pageSpec" |
|
202 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
203 |
self subclassResponsibility |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
204 |
! |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
205 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
206 |
initialToolbarMenuSpecMethodSource |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
207 |
"return a menuSpec with typical stuff in it" |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
208 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
209 |
self subclassResponsibility |
9054 | 210 |
|
211 |
" |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
212 |
SmalltalkCodeGenerator initialToolbarMenuSpecMethodSource |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
213 |
" |
9054 | 214 |
! |
215 |
||
3712 | 216 |
initialWindowSpecMethodSourceForApplications |
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
217 |
"return an empty windowSpec with an initial menubar in it" |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
218 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
219 |
self subclassResponsibility |
3712 | 220 |
|
221 |
" |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
222 |
SmalltalkCodeGeneraotTool initialWindowSpecMethodSourceForApplications |
9054 | 223 |
" |
3712 | 224 |
! |
225 |
||
226 |
initialWindowSpecMethodSourceForDialogs |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
227 |
"return an empty windowSpec for dialogs" |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
228 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
229 |
self subclassResponsibility |
3712 | 230 |
|
231 |
" |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
232 |
SmalltalkCodeGeneraotTool initialWindowSpecMethodSourceForDialogs |
3712 | 233 |
" |
234 |
! ! |
|
235 |
||
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
236 |
!CodeGeneratorTool class methodsFor:'code generation-basic'! |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
237 |
|
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
238 |
createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly lazyInitialization:lazyInitialization |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
239 |
"workhorse for creating access methods for instvars." |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
240 |
|
5758 | 241 |
^ self new |
242 |
createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly lazyInitialization:lazyInitialization |
|
243 |
! ! |
|
244 |
||
245 |
!CodeGeneratorTool class methodsFor:'code generation-individual methods'! |
|
246 |
||
247 |
createAcceptVisitorMethod:selector in:aClass |
|
248 |
"create an acceptVisitor: method |
|
249 |
(I'm tired of typing)" |
|
250 |
||
251 |
^ self new createAcceptVisitorMethod:selector in:aClass |
|
252 |
! |
|
253 |
||
254 |
createAcceptVisitorMethodIn:aClass |
|
255 |
"create an acceptVisitor: method |
|
256 |
(I'm tired of typing)" |
|
257 |
||
258 |
^ self new createAcceptVisitorMethodIn:aClass |
|
259 |
! |
|
260 |
||
12877 | 261 |
createAspectMethodFor:anAspectSymbol in:aClass |
262 |
"create an aspect method." |
|
263 |
||
264 |
^ self new createAspectMethodFor:anAspectSymbol in:aClass |
|
265 |
! |
|
266 |
||
5758 | 267 |
createCopyrightMethodFor:aClass |
268 |
"add copyright method containing your/your companies |
|
269 |
copyright template but only if not already present. |
|
270 |
this is only added, if specified in the |
|
271 |
COPYRIGHT_TEMPLATE_FILE resources." |
|
272 |
||
273 |
^ self new createCopyrightMethodFor:aClass |
|
274 |
! |
|
275 |
||
276 |
createDocumentationMethodFor:aClass |
|
277 |
"add documentation method containing doc template |
|
278 |
but only if not already present." |
|
279 |
||
280 |
^ self new createDocumentationMethodFor:aClass |
|
281 |
! |
|
282 |
||
283 |
createExamplesMethodFor:aClass |
|
284 |
"add examples method containing examples template |
|
285 |
but only if not already present." |
|
286 |
||
287 |
^ self new createExamplesMethodFor:aClass |
|
288 |
! |
|
289 |
||
11842
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
290 |
createFalseReturnMethodFor:aSelector category:cat in:aClass |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
291 |
"add a ^ false method; |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
292 |
but only if not already present." |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
293 |
|
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
294 |
^ self new createFalseReturnMethodFor:aSelector category:cat in:aClass |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
295 |
! |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
296 |
|
5758 | 297 |
createImageSpecMethodFor:anImage comment:comment in:aClass selector:sel |
298 |
^ self new createImageSpecMethodFor:anImage comment:comment in:aClass selector:sel |
|
299 |
! |
|
300 |
||
301 |
createInitialHistoryMethodFor:aClass |
|
302 |
"add history method containing created-entry |
|
303 |
but only if not already present." |
|
304 |
||
305 |
^ self new createInitialHistoryMethodFor:aClass |
|
306 |
! |
|
307 |
||
308 |
createInstanceCreationMethodWithSetupFor:selector category:category in:aMetaClass |
|
309 |
"add an inst-creation method" |
|
310 |
||
311 |
^ self new createInstanceCreationMethodWithSetupFor:selector category:category in:aMetaClass |
|
312 |
! |
|
313 |
||
16248 | 314 |
createMultiSetterInstanceCreationMethodFor:aCollectionOfVarNames in:aClass |
315 |
"create a multi-setter instance creator method for instvars. |
|
316 |
This creates a multi setter method (a:val1 b:val2 c:val3...) |
|
317 |
and a corresponding new method on the class side." |
|
318 |
||
319 |
^ self new createMultiSetterInstanceCreationMethodFor:aCollectionOfVarNames in:aClass |
|
320 |
! |
|
321 |
||
5758 | 322 |
createMultiSetterMethodFor:aCollectionOfVarNames in:aClass |
16248 | 323 |
"create a multi-setter method (a:val1 b:val2 c:val3...) for instvars." |
5758 | 324 |
|
325 |
^ self new createMultiSetterMethodFor:aCollectionOfVarNames in:aClass |
|
326 |
! |
|
327 |
||
328 |
createSubclassResponsibilityMethodFor:aSelector category:cat in:aClass |
|
329 |
"add a subclassResponsibility method; |
|
330 |
but only if not already present." |
|
331 |
||
332 |
^ self new createSubclassResponsibilityMethodFor:aSelector category:cat in:aClass |
|
333 |
! |
|
334 |
||
335 |
createUpdateMethodIn:aClass |
|
336 |
"create an update:with:from:-method |
|
337 |
(I'm tired of typing)" |
|
338 |
||
339 |
^ self new createUpdateMethodIn:aClass |
|
340 |
! |
|
341 |
||
342 |
createVersionMethodFor:aClass |
|
11758
531b78e53e8f
comment/format in: #createVersionMethodFor:
Claus Gittinger <cg@exept.de>
parents:
11718
diff
changeset
|
343 |
"add a version method containing RCS template |
531b78e53e8f
comment/format in: #createVersionMethodFor:
Claus Gittinger <cg@exept.de>
parents:
11718
diff
changeset
|
344 |
but only if not already present and it's not a private class." |
5758 | 345 |
|
346 |
^ self new createVersionMethodFor:aClass |
|
11758
531b78e53e8f
comment/format in: #createVersionMethodFor:
Claus Gittinger <cg@exept.de>
parents:
11718
diff
changeset
|
347 |
|
531b78e53e8f
comment/format in: #createVersionMethodFor:
Claus Gittinger <cg@exept.de>
parents:
11718
diff
changeset
|
348 |
"Modified (comment): / 21-08-2012 / 11:55:15 / cg" |
5758 | 349 |
! ! |
350 |
||
7973 | 351 |
!CodeGeneratorTool class methodsFor:'code generation-menus'! |
352 |
||
353 |
createActionMethodFor:aSelector in:aClass category:aCategory redefine:redefine |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
354 |
self subclassResponsibility |
7973 | 355 |
! |
356 |
||
357 |
createAspectMethodFor:aSelector in:aClass category:aCategory redefine:redefine |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
358 |
self subclassResponsibility |
7973 | 359 |
! ! |
360 |
||
5758 | 361 |
!CodeGeneratorTool class methodsFor:'compilation'! |
362 |
||
17511 | 363 |
compile:theCode forClass:aClass inCategory:cat |
5758 | 364 |
"install some code for a class. |
17511 | 365 |
If refactory browser stuff is available the refactory tools are used to support undo" |
5758 | 366 |
|
16429 | 367 |
self new compile:theCode forClass:aClass inCategory:cat |
17511 | 368 |
|
369 |
"Modified (comment): / 17-05-2017 / 16:56:12 / mawalch" |
|
5758 | 370 |
! ! |
371 |
||
8258 | 372 |
!CodeGeneratorTool class methodsFor:'defaults'! |
373 |
||
374 |
copyrightTemplate |
|
375 |
"return the contents of COPYRIGHT_TEMPLATE_FILE resources |
|
376 |
or a standard template" |
|
377 |
||
14425 | 378 |
|fn copyrightHolder| |
8258 | 379 |
|
380 |
CopyrightTemplate notNil ifTrue:[^ CopyrightTemplate]. |
|
381 |
||
382 |
fn := SystemBrowser classResources at:#'COPYRIGHT_TEMPLATE_FILE' default:nil. |
|
383 |
fn notNil ifTrue:[ |
|
384 |
fn := fn asFilename. |
|
385 |
fn exists ifTrue:[ |
|
8488 | 386 |
^ fn contentsAsString. |
8258 | 387 |
]. |
388 |
]. |
|
14425 | 389 |
(OperatingSystem getDomainName endsWith:'exept.de') ifTrue:[ |
17496 | 390 |
copyrightHolder := 'eXept Software AG'. |
14425 | 391 |
] ifFalse:[ |
392 |
copyrightHolder := '>>your company<<'. |
|
393 |
]. |
|
394 |
||
395 |
^ ' COPYRIGHT (c) %1 by %2 |
|
8258 | 396 |
All Rights Reserved |
397 |
||
398 |
This software is furnished under a license and may be used |
|
399 |
only in accordance with the terms of that license and with the |
|
16737 | 400 |
inclusion of the above copyright notice. This software may not |
8258 | 401 |
be provided or otherwise made available to, or used by, any |
402 |
other person. No title to or ownership of the software is |
|
17269 | 403 |
hereby transferred.' bindWith:(Date today year) with:copyrightHolder. |
17496 | 404 |
|
405 |
"Modified: / 12-04-2017 / 10:29:30 / cg" |
|
8258 | 406 |
! |
407 |
||
408 |
copyrightTemplate:aString |
|
8488 | 409 |
"set the COPYRIGHT_TEMPLATE_FILE" |
410 |
||
8258 | 411 |
CopyrightTemplate := aString. |
412 |
! ! |
|
413 |
||
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
414 |
!CodeGeneratorTool class methodsFor:'interface specs'! |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
415 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
416 |
initialMenuSpecForApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
417 |
"return a menuSpec with typical stuff in it" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
418 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
419 |
"This resource specification was automatically generated by the CodeGeneratorTool." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
420 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
421 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
422 |
the MenuEditor may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
423 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
424 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
425 |
MenuEditor new openOnClass:self andSelector:#initialMenuSpecForApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
426 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
427 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
428 |
<resource: #menu> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
429 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
430 |
^ #(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
431 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
432 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
433 |
#label: 'File' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
434 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
435 |
#submenu: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
436 |
#(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
437 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
438 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
439 |
#label: 'New' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
440 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
441 |
#value: #menuNew |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
442 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
443 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
444 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
445 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
446 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
447 |
#label: 'Open...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
448 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
449 |
#value: #menuOpen |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
450 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
451 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
452 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
453 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
454 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
455 |
#label: 'Save' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
456 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
457 |
#value: #menuSave |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
458 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
459 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
460 |
#label: 'Save As...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
461 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
462 |
#value: #menuSaveAs |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
463 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
464 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
465 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
466 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
467 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
468 |
#label: 'Exit' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
469 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
470 |
#value: #closeRequest |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
471 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
472 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
473 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
474 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
475 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
476 |
#(#MenuItem |
15399 | 477 |
#label: 'MENU_Help' |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
478 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
479 |
#startGroup: #right |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
480 |
#submenu: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
481 |
#(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
482 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
483 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
484 |
#label: 'Documentation' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
485 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
486 |
#value: #openDocumentation |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
487 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
488 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
489 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
490 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
491 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
492 |
#label: 'About this Application...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
493 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
494 |
#value: #openAboutThisApplication |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
495 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
496 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
497 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
498 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
499 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
500 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
501 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
502 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
503 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
504 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
505 |
initialPageMenuSpecForWebApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
506 |
"return a menuSpec with typical stuff in it" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
507 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
508 |
"This resource specification was automatically generated by the CodeGeneratorTool." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
509 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
510 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
511 |
the MenuEditor may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
512 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
513 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
514 |
MenuEditor new openOnClass:self andSelector:#initialPageMenuSpecForWebApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
515 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
516 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
517 |
<resource: #menu> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
518 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
519 |
^ #(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
520 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
521 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
522 |
#label: 'File' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
523 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
524 |
#submenu: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
525 |
#(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
526 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
527 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
528 |
#label: 'New' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
529 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
530 |
#value: #menuNew |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
531 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
532 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
533 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
534 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
535 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
536 |
#label: 'Open...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
537 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
538 |
#value: #menuOpen |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
539 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
540 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
541 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
542 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
543 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
544 |
#label: 'Save' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
545 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
546 |
#value: #menuSave |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
547 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
548 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
549 |
#label: 'Save As...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
550 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
551 |
#value: #menuSaveAs |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
552 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
553 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
554 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
555 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
556 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
557 |
#label: 'Exit' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
558 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
559 |
#value: #closeRequest |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
560 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
561 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
562 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
563 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
564 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
565 |
#(#MenuItem |
15399 | 566 |
#label: 'MENU_Help' |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
567 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
568 |
#startGroup: #right |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
569 |
#submenu: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
570 |
#(#Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
571 |
#( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
572 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
573 |
#label: 'Documentation' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
574 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
575 |
#value: #openDocumentation |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
576 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
577 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
578 |
#label: '-' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
579 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
580 |
#(#MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
581 |
#label: 'About this Application...' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
582 |
#translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
583 |
#value: #openAboutThisApplication |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
584 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
585 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
586 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
587 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
588 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
589 |
) nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
590 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
591 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
592 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
593 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
594 |
initialPageSpecForWebApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
595 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
596 |
the UIPainter may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
597 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
598 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
599 |
UIPainter new openOnClass:self andSelector:#initialPageSpecForWebApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
600 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
601 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
602 |
<resource: #canvas> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
603 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
604 |
^ #(#FullSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
605 |
#window: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
606 |
#(#WindowSpec |
10319
c374ffaf0ec3
changed: #initialPageSpecForWebApplications
Claus Gittinger <cg@exept.de>
parents:
10284
diff
changeset
|
607 |
#name: '%1' |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
608 |
#layout: #(#LayoutFrame 204 0 162 0 503 0 461 0) |
10319
c374ffaf0ec3
changed: #initialPageSpecForWebApplications
Claus Gittinger <cg@exept.de>
parents:
10284
diff
changeset
|
609 |
#label: '%1' |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
610 |
#min: #(#Point 10 10) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
611 |
#max: #(#Point 1024 768) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
612 |
#bounds: #(#Rectangle 204 162 504 462) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
613 |
#menu: #pageMenu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
614 |
#usePreferredExtent: false |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
615 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
616 |
#component: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
617 |
#(#SpecCollection |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
618 |
#collection: #() |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
619 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
620 |
) |
10319
c374ffaf0ec3
changed: #initialPageSpecForWebApplications
Claus Gittinger <cg@exept.de>
parents:
10284
diff
changeset
|
621 |
|
c374ffaf0ec3
changed: #initialPageSpecForWebApplications
Claus Gittinger <cg@exept.de>
parents:
10284
diff
changeset
|
622 |
"Modified: / 14-07-2011 / 16:44:20 / cg" |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
623 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
624 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
625 |
initialToolbarMenuSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
626 |
"This resource specification was automatically generated |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
627 |
by the MenuEditor of ST/X." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
628 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
629 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
630 |
the MenuEditor may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
631 |
|
11041
4b9586c63c4a
changed: #initialToolbarMenuSpec
Claus Gittinger <cg@exept.de>
parents:
10594
diff
changeset
|
632 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
633 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
634 |
MenuEditor new openOnClass:CodeGeneratorTool andSelector:#initialToolbarMenuSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
635 |
(Menu new fromLiteralArrayEncoding:(CodeGeneratorTool initialToolbarMenuSpec)) startUp |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
636 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
637 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
638 |
<resource: #menu> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
639 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
640 |
^ |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
641 |
#(Menu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
642 |
( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
643 |
(MenuItem |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
644 |
label: 'Reload' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
645 |
itemValue: menuReload |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
646 |
translateLabel: true |
11041
4b9586c63c4a
changed: #initialToolbarMenuSpec
Claus Gittinger <cg@exept.de>
parents:
10594
diff
changeset
|
647 |
isButton: true |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
648 |
labelImage: (ResourceRetriever ToolbarIconLibrary reload24x24Icon) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
649 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
650 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
651 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
652 |
nil |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
653 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
654 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
655 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
656 |
initialWindowSpecForApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
657 |
"This resource specification was automatically generated |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
658 |
by the UIPainter of ST/X." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
659 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
660 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
661 |
the UIPainter may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
662 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
663 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
664 |
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
665 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
666 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
667 |
<resource: #canvas> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
668 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
669 |
^ |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
670 |
#(FullSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
671 |
name: initialWindowSpecForApplications |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
672 |
window: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
673 |
(WindowSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
674 |
label: '%1' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
675 |
name: '%1' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
676 |
min: (Point 10 10) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
677 |
bounds: (Rectangle 0 0 300 300) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
678 |
menu: mainMenu |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
679 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
680 |
component: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
681 |
(SpecCollection |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
682 |
collection: ( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
683 |
(LabelSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
684 |
label: 'Hello World' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
685 |
name: 'Label1' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
686 |
layout: (LayoutFrame 0 0.0 60 0 0 1.0 219 0) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
687 |
translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
688 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
689 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
690 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
691 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
692 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
693 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
694 |
"Modified: / 07-05-2010 / 14:21:48 / cg" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
695 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
696 |
|
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
697 |
initialWindowSpecForApplications2 |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
698 |
"This resource specification was automatically generated |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
699 |
by the UIPainter of ST/X." |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
700 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
701 |
"Do not manually edit this!! If it is corrupted, |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
702 |
the UIPainter may not be able to read the specification." |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
703 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
704 |
" |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
705 |
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications2 |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
706 |
" |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
707 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
708 |
<resource: #canvas> |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
709 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
710 |
^ |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
711 |
#(FullSpec |
9100
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
712 |
name: initialWindowSpecForApplications2 |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
713 |
window: |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
714 |
(WindowSpec |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
715 |
label: '%1' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
716 |
name: '%1' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
717 |
min: (Point 10 10) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
718 |
bounds: (Rectangle 0 0 300 300) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
719 |
menu: mainMenu |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
720 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
721 |
component: |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
722 |
(SpecCollection |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
723 |
collection: ( |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
724 |
(MenuPanelSpec |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
725 |
name: 'ToolBar1' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
726 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 36 0) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
727 |
menu: toolbarMenu |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
728 |
textDefault: true |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
729 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
730 |
(ViewSpec |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
731 |
name: 'Box1' |
9100
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
732 |
layout: (LayoutFrame 1 0 36 0 0 1 -26 1) |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
733 |
level: 1 |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
734 |
component: |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
735 |
(SpecCollection |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
736 |
collection: ( |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
737 |
(LabelSpec |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
738 |
label: 'Hello World' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
739 |
name: 'Contents' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
740 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
741 |
translateLabel: true |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
742 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
743 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
744 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
745 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
746 |
) |
9100
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
747 |
(ViewSpec |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
748 |
name: 'Box2' |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
749 |
layout: (LayoutFrame 0 0 -26 1 0 1 0 1) |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
750 |
level: 1 |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
751 |
component: |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
752 |
(SpecCollection |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
753 |
collection: ( |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
754 |
(LabelSpec |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
755 |
label: 'InfoLabel' |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
756 |
name: 'Label2' |
9261
5d817a638b5d
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9236
diff
changeset
|
757 |
layout: (LayoutFrame 0 0 -26 1 -1 1 0 1) |
9100
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
758 |
level: -1 |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
759 |
translateLabel: true |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
760 |
labelChannel: infoLabelHolder |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
761 |
adjust: left |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
762 |
) |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
763 |
) |
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
764 |
|
885eaa429d6f
changed: #initialWindowSpecForApplications2
Claus Gittinger <cg@exept.de>
parents:
9099
diff
changeset
|
765 |
) |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
766 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
767 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
768 |
|
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
769 |
) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
770 |
) |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
771 |
! |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
772 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
773 |
initialWindowSpecForDialogs |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
774 |
"This resource specification was automatically generated |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
775 |
by the UIPainter of ST/X." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
776 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
777 |
"Do not manually edit this!! If it is corrupted, |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
778 |
the UIPainter may not be able to read the specification." |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
779 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
780 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
781 |
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForDialogs |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
782 |
" |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
783 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
784 |
<resource: #canvas> |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
785 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
786 |
^ |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
787 |
#(FullSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
788 |
name: initialWindowSpecForDialogs |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
789 |
window: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
790 |
(WindowSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
791 |
label: '%1' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
792 |
name: '%1' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
793 |
min: (Point 10 10) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
794 |
bounds: (Rectangle 0 0 300 300) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
795 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
796 |
component: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
797 |
(SpecCollection |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
798 |
collection: ( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
799 |
(HorizontalPanelViewSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
800 |
name: 'buttonPanel' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
801 |
layout: (LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
802 |
horizontalLayout: spreadSpaceMax |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
803 |
verticalLayout: center |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
804 |
horizontalSpace: 3 |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
805 |
verticalSpace: 3 |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
806 |
reverseOrderIfOKAtLeft: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
807 |
component: |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
808 |
(SpecCollection |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
809 |
collection: ( |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
810 |
(ActionButtonSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
811 |
label: 'Cancel' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
812 |
name: 'cancelButton' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
813 |
translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
814 |
tabable: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
815 |
model: cancel |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
816 |
extent: (Point 125 22) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
817 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
818 |
(ActionButtonSpec |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
819 |
label: 'OK' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
820 |
name: 'okButton' |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
821 |
translateLabel: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
822 |
tabable: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
823 |
model: accept |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
824 |
isDefault: true |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
825 |
extent: (Point 125 22) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
826 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
827 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
828 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
829 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
830 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
831 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
832 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
833 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
834 |
) |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
835 |
|
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
836 |
"Modified: / 07-05-2010 / 14:21:55 / cg" |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
837 |
! ! |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
838 |
|
5758 | 839 |
!CodeGeneratorTool class methodsFor:'private'! |
840 |
||
841 |
canUseRefactoringSupport |
|
17511 | 842 |
"check if refactory browser stuff is available" |
5758 | 843 |
|
17511 | 844 |
^ RefactoryChangeManager notNil and:[RefactoryChangeManager isLoaded |
16852 | 845 |
and:[SelectorEnvironment notNil and:[SelectorEnvironment isLoaded |
846 |
and:[UserPreferences current useRefactoringSupport]]]] |
|
17511 | 847 |
|
848 |
"Modified (comment): / 17-05-2017 / 16:56:03 / mawalch" |
|
7973 | 849 |
! |
850 |
||
851 |
methodNameTemplateFor:aSelector |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
852 |
self subclassResponsibility |
5758 | 853 |
! ! |
854 |
||
16194 | 855 |
!CodeGeneratorTool class methodsFor:'queries'! |
14702
bdad8f638ac6
Marked CodeGeneratorTool as abstract
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14701
diff
changeset
|
856 |
|
bdad8f638ac6
Marked CodeGeneratorTool as abstract
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14701
diff
changeset
|
857 |
isAbstract |
bdad8f638ac6
Marked CodeGeneratorTool as abstract
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14701
diff
changeset
|
858 |
^ self == CodeGeneratorTool |
bdad8f638ac6
Marked CodeGeneratorTool as abstract
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14701
diff
changeset
|
859 |
! ! |
bdad8f638ac6
Marked CodeGeneratorTool as abstract
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14701
diff
changeset
|
860 |
|
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
861 |
!CodeGeneratorTool class methodsFor:'utilities'! |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
862 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
863 |
missingRequiredProtocolFor:aClass |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
864 |
"return the missing required protocol; |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
865 |
that is the set of selectors which send #subclassResponsibility in a superclass and |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
866 |
have no implementation in aClass or in any class between aClass and that superclass" |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
867 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
868 |
|requiredSelectors implementedSelectors| |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
869 |
|
14966 | 870 |
aClass isAbstract ifTrue:[ |
871 |
"abstract classes are not responsible for methods to be defined in subclasses" |
|
15085
dac5a348dd09
class: CodeGeneratorTool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14966
diff
changeset
|
872 |
^ #(). |
14966 | 873 |
]. |
874 |
||
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
875 |
requiredSelectors := IdentitySet new. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
876 |
implementedSelectors := IdentitySet withAll:(aClass methodDictionary keys). |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
877 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
878 |
aClass allSuperclassesDo:[:eachSuperClass | |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
879 |
eachSuperClass methodDictionary keysAndValuesDo:[:eachSelector :eachMethod | |
17572 | 880 |
(eachMethod isSubclassResponsibility) ifTrue:[ |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
881 |
(implementedSelectors includes:eachSelector) ifFalse:[ |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
882 |
requiredSelectors add:eachSelector. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
883 |
] |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
884 |
] ifFalse:[ |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
885 |
(requiredSelectors includes:eachSelector) ifFalse:[ |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
886 |
implementedSelectors add:eachSelector. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
887 |
]. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
888 |
]. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
889 |
] |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
890 |
]. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
891 |
^ requiredSelectors |
10553
7ff71943e4b4
changed: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
10466
diff
changeset
|
892 |
|
15085
dac5a348dd09
class: CodeGeneratorTool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14966
diff
changeset
|
893 |
"Modified: / 10-01-2015 / 06:46:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17572 | 894 |
"Modified: / 16-07-2017 / 11:27:17 / cg" |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
895 |
! ! |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
896 |
|
16356 | 897 |
!CodeGeneratorTool class methodsFor:'utilities - source code'! |
898 |
||
899 |
methodTemplate |
|
900 |
"return a method definition template string" |
|
901 |
||
902 |
^ '' |
|
903 |
! |
|
904 |
||
905 |
methodTemplateForDocumentation |
|
906 |
"return a method definition template string for a documentation method" |
|
907 |
||
908 |
^ self methodTemplate |
|
17079 | 909 |
! |
910 |
||
911 |
methodTemplateForPackageDocumentation |
|
912 |
"return a documentation method definition template string for a package" |
|
913 |
||
914 |
^ self methodTemplateForDocumentation |
|
915 |
||
916 |
"Created: / 18-11-2016 / 10:51:39 / cg" |
|
16356 | 917 |
! ! |
918 |
||
10466
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
919 |
!CodeGeneratorTool methodsFor:'bulk changes'! |
5759 | 920 |
|
5763 | 921 |
addChange:aChange |
922 |
compositeChangeCollector addChange:aChange |
|
923 |
! |
|
924 |
||
5759 | 925 |
executeCollectedChangesNamed:name |
10466
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
926 |
"if both the compositeChangeCollector and I myself think, that it should be confirmed, |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
927 |
the let user do it - I am not sure, if the heuristics here is useful; |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
928 |
it might be better to let the generator decide (for example, if it does high-impact |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
929 |
changes, as opposed to simple ones)" |
10256 | 930 |
|
5759 | 931 |
compositeChangeCollector notNil ifTrue:[ |
932 |
compositeChangeNesting := compositeChangeNesting - 1. |
|
933 |
compositeChangeNesting == 0 ifTrue:[ |
|
934 |
compositeChangeCollector name:name. |
|
935 |
compositeChangeCollector changesSize == 0 ifTrue:[ |
|
936 |
self information:'Nothing generated.'. |
|
937 |
] ifFalse:[ |
|
13817 | 938 |
"JV@2012-04-04: Here used to be a code for confirming changes. |
939 |
The has moved to RefactoryChangeManager so all refactorings |
|
940 |
are also subject to confirmation (is enabled in UserPreferences)" |
|
941 |
RefactoryChangeManager instance performChange: compositeChangeCollector |
|
5759 | 942 |
]. |
943 |
compositeChangeCollector := nil. |
|
944 |
] |
|
945 |
] |
|
10284
8cbf4cd11c2f
changed: #executeCollectedChangesNamed: fix in change confirmation code
vrany
parents:
10256
diff
changeset
|
946 |
|
13817 | 947 |
"Modified (comment): / 04-08-2011 / 17:30:27 / cg" |
948 |
"Modified (format): / 04-04-2012 / 16:35:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5759 | 949 |
! |
950 |
||
951 |
startCollectChanges |
|
952 |
(self canUseRefactoringSupport) ifTrue:[ |
|
953 |
compositeChangeCollector isNil ifTrue:[ |
|
954 |
compositeChangeCollector := CompositeRefactoryChange new. |
|
955 |
compositeChangeNesting := 0. |
|
956 |
]. |
|
957 |
compositeChangeNesting := compositeChangeNesting + 1. |
|
958 |
] |
|
959 |
! ! |
|
960 |
||
5758 | 961 |
!CodeGeneratorTool methodsFor:'code generation'! |
962 |
||
963 |
createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly |
|
964 |
"create accessors in aClass" |
|
965 |
||
966 |
self |
|
967 |
createAccessMethodsFor:aCollectionOfVarNames |
|
968 |
in:aClass |
|
969 |
withChange:withChange |
|
970 |
asValueHolder:asValueHolder |
|
971 |
readersOnly:readersOnly |
|
972 |
writersOnly:writersOnly |
|
973 |
lazyInitialization:false |
|
974 |
! |
|
975 |
||
976 |
createApplicationCodeFor:aClass |
|
977 |
"create an empty application framework" |
|
978 |
||
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
979 |
|nonMetaClass metaClass className txt isDialog |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
980 |
categoryForMenuActionsMethods compileTemplateAction| |
5758 | 981 |
|
982 |
self startCollectChanges. |
|
983 |
||
8572 | 984 |
categoryForMenuActionsMethods := userPreferences categoryForMenuActionsMethods. |
5758 | 985 |
|
986 |
nonMetaClass := aClass theNonMetaclass. |
|
987 |
metaClass := aClass theMetaclass. |
|
988 |
className := nonMetaClass name. |
|
989 |
||
990 |
isDialog := (nonMetaClass isSubclassOf:SimpleDialog). |
|
991 |
||
992 |
"/ add a windowSpec method for an empty applicationWindow, |
|
993 |
"/ with a menuPanel. |
|
994 |
||
995 |
(metaClass includesSelector:#windowSpec) ifFalse:[ |
|
996 |
isDialog ifTrue:[ |
|
997 |
txt := self class initialWindowSpecMethodSourceForDialogs. |
|
998 |
] ifFalse:[ |
|
999 |
txt := self class initialWindowSpecMethodSourceForApplications. |
|
1000 |
]. |
|
1001 |
self |
|
1002 |
compile:(txt bindWith:className) |
|
1003 |
forClass:metaClass |
|
1004 |
inCategory:'interface specs'. |
|
1005 |
]. |
|
1006 |
||
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1007 |
compileTemplateAction := |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1008 |
[:selector :category | |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1009 |
(nonMetaClass includesSelector:selector) ifFalse:[ |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1010 |
|codeTemplateSelector| |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1011 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1012 |
codeTemplateSelector := ('codeFor_',(selector upTo:$:)) asSymbol. |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1013 |
txt := self perform:codeTemplateSelector. |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1014 |
self |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1015 |
compile:txt |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1016 |
forClass:nonMetaClass |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1017 |
inCategory:(category = '*' ifTrue:categoryForMenuActionsMethods ifFalse:category). |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1018 |
] |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1019 |
]. |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1020 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1021 |
#( |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1022 |
#'postBuildWith:' 'initialization & release' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1023 |
#'postOpenWith:' 'initialization & release' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1024 |
) pairWiseDo:compileTemplateAction. |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1025 |
|
5758 | 1026 |
isDialog ifFalse:[ |
1027 |
"/ add a topMenu method |
|
1028 |
||
1029 |
(metaClass includesSelector:#mainMenu) ifFalse:[ |
|
1030 |
txt := self class initialMenuSpecMethodSourceForApplications. |
|
1031 |
self |
|
1032 |
compile:(txt bindWith:className) |
|
1033 |
forClass:metaClass |
|
1034 |
inCategory:'menu specs'. |
|
1035 |
]. |
|
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1036 |
(metaClass includesSelector:#toolbarMenu) ifFalse:[ |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1037 |
txt := self class initialToolbarMenuSpecMethodSource. |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1038 |
self |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1039 |
compile:(txt bindWith:className) |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1040 |
forClass:metaClass |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1041 |
inCategory:'menu specs'. |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1042 |
]. |
5758 | 1043 |
|
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1044 |
#( |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1045 |
#'hasUnsavedChanges' 'private queries' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1046 |
#'closeRequest' 'initialization & release' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1047 |
#'closeDownViews' 'initialization & release' |
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1048 |
#'menuReload' '*' |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1049 |
#'menuSaveAs' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1050 |
#'menuNew' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1051 |
#'menuOpen' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1052 |
#'menuSave' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1053 |
#'doSaveAs' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1054 |
#'openDocumentation' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1055 |
#'openAboutThisApplication' '*' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1056 |
) pairWiseDo:compileTemplateAction. |
5758 | 1057 |
]. |
1058 |
||
1059 |
isDialog ifTrue:[ |
|
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1060 |
#( |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1061 |
#'closeAccept' 'user actions' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1062 |
) pairWiseDo:compileTemplateAction. |
5758 | 1063 |
]. |
1064 |
||
6050 | 1065 |
self executeCollectedChangesNamed:('Add Application Code for ' , className). |
5758 | 1066 |
|
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1067 |
"Modified: / 27-10-2006 / 10:21:58 / cg" |
5758 | 1068 |
! |
1069 |
||
8987 | 1070 |
createClassInitializeMethodIn:aClass |
1071 |
"create a #initialize method on the class side (I'm tired of typing)" |
|
1072 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1073 |
self subclassResponsibility |
8987 | 1074 |
! |
1075 |
||
5758 | 1076 |
createClassResponsibleProtocolFor:aClass |
1077 |
"create stubs for the required protocol" |
|
1078 |
||
6050 | 1079 |
|nonMetaClass metaClass className| |
1080 |
||
1081 |
nonMetaClass := aClass theNonMetaclass. |
|
1082 |
metaClass := aClass theMetaclass. |
|
1083 |
className := nonMetaClass name. |
|
1084 |
||
5758 | 1085 |
self startCollectChanges. |
1086 |
||
6050 | 1087 |
self privCreateClassResponsibleProtocolFor:nonMetaClass. |
1088 |
self privCreateClassResponsibleProtocolFor:metaClass. |
|
5758 | 1089 |
|
6050 | 1090 |
self executeCollectedChangesNamed:('Add Required Protocol to ' , className). |
5758 | 1091 |
! |
1092 |
||
1093 |
createClassTypeTestMethodsIn:aClass forClasses:subClasses |
|
1094 |
"create a #isXXX test methods (I'm tired of typing)" |
|
1095 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1096 |
self subclassResponsibility |
5758 | 1097 |
! |
1098 |
||
1099 |
createDocumentationMethodsFor:aClass |
|
1100 |
"create empty documentation methods" |
|
1101 |
||
6050 | 1102 |
|nonMetaClass metaClass className| |
5758 | 1103 |
|
6050 | 1104 |
nonMetaClass := aClass theNonMetaclass. |
1105 |
metaClass := aClass theMetaclass. |
|
1106 |
className := nonMetaClass name. |
|
5758 | 1107 |
|
1108 |
self startCollectChanges. |
|
1109 |
||
8890 | 1110 |
"/ self createVersionMethodFor:metaClass. |
6050 | 1111 |
self createCopyrightMethodFor:metaClass. |
1112 |
self createDocumentationMethodFor:metaClass. |
|
8572 | 1113 |
self createExamplesMethodFor:metaClass. |
1114 |
"/ self createInitialHistoryMethodFor:metaClass. |
|
5758 | 1115 |
|
6050 | 1116 |
self executeCollectedChangesNamed:('Add Documentation to ' , className). |
5758 | 1117 |
! |
1118 |
||
6313 | 1119 |
createEnumTypeCodeFor:aClass |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1120 |
self subclassResponsibility |
6313 | 1121 |
! |
1122 |
||
8572 | 1123 |
createExamplesMethodForViewClass:aClass |
1124 |
"create an examples method" |
|
1125 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1126 |
self subclassResponsibility |
8572 | 1127 |
! |
1128 |
||
9125
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1129 |
createInitializationMethodIn:aClass |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1130 |
"create a #initialize methods (I'm tired of typing)" |
5758 | 1131 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1132 |
self subclassResponsibility |
9125
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1133 |
! |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1134 |
|
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1135 |
createInitializedInstanceCreationMethodsIn:aClass |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1136 |
"create a #new and #initialize methods (I'm tired of typing)" |
aaacd37a90b0
added: #createInitializationMethodIn:
Claus Gittinger <cg@exept.de>
parents:
9100
diff
changeset
|
1137 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1138 |
self subclassResponsibility |
6718 | 1139 |
! |
1140 |
||
13627 | 1141 |
createIsAbstractMethodIn:aClass |
1142 |
"create a #isAbstract query method (I'm tired of typing)" |
|
1143 |
||
1144 |
self subclassResponsibility |
|
1145 |
! |
|
1146 |
||
6718 | 1147 |
createParametrizedInstanceCreationMethodsNamed:selector in:aClass |
1148 |
"create a #selector instance creation method (I'm tired of typing)" |
|
1149 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1150 |
self subclassResponsibility |
5758 | 1151 |
! |
1152 |
||
7470 | 1153 |
createPoolInitializationCodeFor:aClass |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1154 |
self subclassResponsibility |
7470 | 1155 |
! |
1156 |
||
8344
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
1157 |
createRedefinedInstanceCreationMethodsIn:aClass |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
1158 |
"create a redefined #new methods" |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
1159 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1160 |
self subclassResponsibility |
8344
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
1161 |
! |
efda36a55d02
changed #createRedefinedInstanceCreationMethodsIn:
Claus Gittinger <cg@exept.de>
parents:
8258
diff
changeset
|
1162 |
|
9757
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1163 |
createSingletonPatternInstanceCreationMethodsIn:aClass usingVariable:varName |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1164 |
"create redefined #new methods for a singleton pattern" |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1165 |
|
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1166 |
self subclassResponsibility |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1167 |
|
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1168 |
"Created: / 10-02-2011 / 16:32:36 / cg" |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1169 |
! |
3530070667d5
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Claus Gittinger <cg@exept.de>
parents:
9705
diff
changeset
|
1170 |
|
10592 | 1171 |
createStandaloneStartupCodeFor:aClass |
1172 |
"create an empty console application framework" |
|
1173 |
||
11170 | 1174 |
|metaClass nonMetaclass className txt| |
1175 |
||
1176 |
targetClass := aClass. |
|
10592 | 1177 |
|
1178 |
self startCollectChanges. |
|
1179 |
||
1180 |
metaClass := aClass theMetaclass. |
|
11170 | 1181 |
nonMetaclass := aClass theNonMetaclass. |
1182 |
className := nonMetaclass name. |
|
10592 | 1183 |
|
1184 |
(metaClass includesSelector:#applicationRegistryPath) ifFalse:[ |
|
11170 | 1185 |
txt := self codeFor_standAloneApplicationRegistryPathFor:nonMetaclass. |
10592 | 1186 |
self |
1187 |
compile:(txt bindWith:className) |
|
1188 |
forClass:metaClass |
|
1189 |
inCategory:'constants & defaults'. |
|
1190 |
]. |
|
1191 |
(metaClass includesSelector:#applicationUUID) ifFalse:[ |
|
1192 |
txt := self codeFor_standAloneApplicationUUID. |
|
1193 |
self |
|
1194 |
compile:(txt bindWith:className) |
|
1195 |
forClass:metaClass |
|
1196 |
inCategory:'constants & defaults'. |
|
1197 |
]. |
|
1198 |
(metaClass includesSelector:#usage) ifFalse:[ |
|
1199 |
txt := self codeFor_standAloneUsage. |
|
1200 |
self |
|
1201 |
compile:(txt bindWith:className) |
|
1202 |
forClass:metaClass |
|
1203 |
inCategory:'startup'. |
|
1204 |
]. |
|
1205 |
(metaClass includesSelector:#'main:') ifFalse:[ |
|
16901 | 1206 |
txt := self codeFor_standAloneMainOnClassSide. |
10592 | 1207 |
self |
1208 |
compile:(txt bindWith:className) |
|
1209 |
forClass:metaClass |
|
1210 |
inCategory:'startup'. |
|
16901 | 1211 |
]. |
1212 |
(nonMetaclass includesSelector:#'main:') ifFalse:[ |
|
1213 |
txt := self codeFor_standAloneMain. |
|
1214 |
self |
|
1215 |
compile:(txt bindWith:className) |
|
1216 |
forClass:nonMetaclass |
|
1217 |
inCategory:'startup'. |
|
10592 | 1218 |
|
16901 | 1219 |
(nonMetaclass includesSelector:#'realMain:') ifFalse:[ |
11170 | 1220 |
txt := self codeFor_standAloneRealMainMethodFor:nonMetaclass. |
10592 | 1221 |
self |
1222 |
compile:(txt bindWith:className) |
|
16901 | 1223 |
forClass:nonMetaclass |
11170 | 1224 |
inCategory:'startup'. |
10592 | 1225 |
]. |
1226 |
||
1227 |
]. |
|
1228 |
||
1229 |
self executeCollectedChangesNamed:('Add StandaloneStartup Code for ' , className). |
|
1230 |
||
1231 |
"Created: / 19-08-2011 / 02:01:31 / cg" |
|
1232 |
! |
|
1233 |
||
5953 | 1234 |
createStandardPrintOnMethodIn:aClass |
1235 |
"create a #printOn: method (I'm tired of typing)" |
|
1236 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1237 |
self subclassResponsibility |
5953 | 1238 |
! |
1239 |
||
9081 | 1240 |
createStartupCodeFor:aClass forStartOf:anApplicationClassOrNil |
9049
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
1241 |
"create startup code (main)" |
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
1242 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1243 |
self subclassResponsibility |
9049
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
1244 |
! |
9a2003a4fef3
added: #createStartupCodeFor:forStartOf:
Claus Gittinger <cg@exept.de>
parents:
9044
diff
changeset
|
1245 |
|
5758 | 1246 |
createTestCaseSampleCodeFor:aClass |
1247 |
"create an (almost) empty testCase class" |
|
1248 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1249 |
self subclassResponsibility |
5758 | 1250 |
! |
1251 |
||
10256 | 1252 |
createVisitorMethodsIn:visitedClass andCompilerClass:visitorClass |
1253 |
" |
|
1254 |
This is much like createVisitorMethodsIn:andVisitorClass:, |
|
1255 |
but generates |
|
1256 |
acceptVisitor:forEffect: |
|
1257 |
and |
|
1258 |
visit<NODE>:forEffect: |
|
1259 |
in visit* methods. |
|
1260 |
" |
|
1261 |
||
1262 |
|sel superSel | |
|
1263 |
||
1264 |
self assert:( visitedClass isMeta not ). |
|
1265 |
self assert:( visitorClass isMeta not ). |
|
1266 |
||
1267 |
self startCollectChanges. |
|
1268 |
||
1269 |
sel := ('visit' , visitedClass nameWithoutPrefix , ':'). |
|
1270 |
superSel := ('visit' , visitedClass superclass nameWithoutPrefix , ':'). |
|
1271 |
||
1272 |
(visitedClass includesSelector:#acceptVisitor:forEffect:) ifFalse: |
|
1273 |
[self addChange: |
|
1274 |
(CodeGenerator new |
|
1275 |
class: visitedClass; |
|
1276 |
protocol: 'visiting'; |
|
1277 |
source: ('acceptVisitor: visitor forEffect: effect |
|
1278 |
"Double dispatch back to the visitor, passing my type encoded in |
|
1279 |
the selector (visitor pattern) and given effect" |
|
1280 |
||
1281 |
"stub code automatically generated - please change if required" |
|
1282 |
||
1283 |
^visitor `@sel: self forEffect: effect'); |
|
1284 |
replace: '`@sel:' with: sel asSymbol; |
|
1285 |
change) |
|
1286 |
]. |
|
1287 |
||
1288 |
||
1289 |
||
1290 |
||
1291 |
(visitorClass includesSelector:(sel, 'forEffect:') asSymbol) ifFalse:[ |
|
1292 |
self addChange: |
|
1293 |
(CodeGenerator new |
|
1294 |
class: visitorClass; |
|
1295 |
protocol: 'visiting'; |
|
1296 |
source: ('`@sel: anObject forEffect: effect |
|
1297 |
"dispatched back from the visited object (visitor pattern)" |
|
1298 |
||
1299 |
^ self `@superSel: anObject forEffect: effect'); |
|
1300 |
replace: '`@sel:' with: sel asSymbol; |
|
1301 |
replace: '`@superSel:' with: superSel asSymbol; |
|
1302 |
change) |
|
1303 |
]. |
|
1304 |
||
1305 |
||
1306 |
(visitorClass includesSelector:#'visit:') ifFalse:[ |
|
1307 |
self |
|
1308 |
compile: |
|
1309 |
('visit:anObject |
|
1310 |
"visit anObject (visitor pattern). |
|
1311 |
The object should call back one of my visitXXXX methods." |
|
1312 |
||
1313 |
^ anObject acceptVisitor:self |
|
1314 |
') |
|
1315 |
forClass:visitorClass |
|
1316 |
inCategory:'visiting'. |
|
1317 |
]. |
|
1318 |
||
1319 |
self executeCollectedChangesNamed:('Create Compiler Visiting Methods'). |
|
1320 |
||
1321 |
"Created: / 20-03-2010 / 10:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1322 |
! |
|
1323 |
||
1324 |
createVisitorMethodsIn:visitedClass andVisitorClass2:visitorClass |
|
1325 |
" |
|
1326 |
This is much like createVisitorMethodsIn:andVisitorClass:, |
|
1327 |
but generates |
|
1328 |
self visitSuperclass: anObject |
|
1329 |
in visit* methods. |
|
1330 |
" |
|
1331 |
||
1332 |
|sel superSel | |
|
1333 |
||
1334 |
self assert:( visitedClass isMeta not ). |
|
1335 |
self assert:( visitorClass isMeta not ). |
|
1336 |
||
1337 |
self startCollectChanges. |
|
1338 |
||
1339 |
sel := ('visit' , visitedClass nameWithoutPrefix , ':'). |
|
1340 |
superSel := ('visit' , visitedClass superclass nameWithoutPrefix , ':'). |
|
1341 |
self createAcceptVisitorMethod:sel in:visitedClass. |
|
1342 |
||
1343 |
(visitorClass includesSelector:sel) ifFalse:[ |
|
1344 |
self addChange: |
|
1345 |
(CodeGenerator new |
|
1346 |
class: visitorClass; |
|
1347 |
protocol: 'visiting'; |
|
1348 |
source: ('`@sel: anObject |
|
1349 |
"dispatched back from the visited %2-object (visitor pattern)" |
|
1350 |
||
1351 |
^ self `@superSel: anObject'); |
|
1352 |
replace: '`@sel:' with: sel asSymbol; |
|
1353 |
replace: '`@superSel:' with: superSel asSymbol; |
|
1354 |
change) |
|
1355 |
]. |
|
1356 |
||
1357 |
||
1358 |
(visitorClass includesSelector:#'visit:') ifFalse:[ |
|
1359 |
self |
|
1360 |
compile: |
|
1361 |
('visit:anObject |
|
1362 |
"visit anObject (visitor pattern). |
|
1363 |
The object should call back one of my visitXXXX methods." |
|
1364 |
||
1365 |
^ anObject acceptVisitor:self |
|
1366 |
') |
|
1367 |
forClass:visitorClass |
|
1368 |
inCategory:'visiting'. |
|
1369 |
]. |
|
1370 |
||
1371 |
self executeCollectedChangesNamed:('Add Visitor Pattern'). |
|
1372 |
||
1373 |
"Created: / 07-07-2009 / 19:53:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1374 |
! |
|
1375 |
||
5758 | 1376 |
createVisitorMethodsIn:visitedClass andVisitorClass:visitorClass |
1377 |
"create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)" |
|
1378 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1379 |
self subclassResponsibility |
6050 | 1380 |
! |
1381 |
||
13817 | 1382 |
createVisitorMethodsIn:arg1 andVisitorClass:arg2 withParameter:arg3 withSuper:arg4 |
1383 |
"raise an error: must be redefined in concrete subclass(es)" |
|
1384 |
||
1385 |
^ self subclassResponsibility |
|
1386 |
! |
|
1387 |
||
6050 | 1388 |
createWebApplicationCodeFor:aClass |
1389 |
"create an empty webApplication framework" |
|
1390 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1391 |
self subclassResponsibility |
7973 | 1392 |
! |
1393 |
||
1394 |
createWebServiceCodeFor:aClass |
|
1395 |
"create an empty webService framework" |
|
1396 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1397 |
self subclassResponsibility |
8572 | 1398 |
! |
1399 |
||
1400 |
createWidgetCodeFor:aClass |
|
1401 |
"create usually required widget code (redraw, model update, event handling)" |
|
1402 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1403 |
self subclassResponsibility |
5758 | 1404 |
! ! |
1405 |
||
1406 |
!CodeGeneratorTool methodsFor:'code generation-basic'! |
|
1407 |
||
1408 |
createAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange asValueHolder:asValueHolder readersOnly:readersOnly writersOnly:writersOnly lazyInitialization:lazyInitialization |
|
1409 |
"workhorse for creating access methods for instvars." |
|
1410 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1411 |
self subclassResponsibility |
5763 | 1412 |
! |
1413 |
||
7615 | 1414 |
createCollectionAccessMethodsFor:aCollectionOfVarNames in:aClass withChange:withChange |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1415 |
self subclassResponsibility |
7615 | 1416 |
! |
1417 |
||
13409 | 1418 |
createGetterFor:aVarName in:aClass |
1419 |
self |
|
1420 |
createAccessMethodsFor:{ aVarName} in:aClass |
|
1421 |
withChange:false asValueHolder:false readersOnly:true writersOnly:false |
|
1422 |
lazyInitialization:false |
|
1423 |
! |
|
1424 |
||
1425 |
createSetterFor:aVarName in:aClass |
|
1426 |
self |
|
1427 |
createAccessMethodsFor:{ aVarName} in:aClass |
|
1428 |
withChange:false asValueHolder:false readersOnly:false writersOnly:true |
|
1429 |
lazyInitialization:false |
|
1430 |
||
1431 |
" |
|
1432 |
||
1433 |
" |
|
1434 |
! |
|
1435 |
||
5763 | 1436 |
createValueHoldersFor:aCollectionOfVarNames in:aClass lazyInitialization:lazyInitialization |
1437 |
"workhorse for creating access methods for instvars." |
|
1438 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1439 |
self subclassResponsibility |
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1440 |
! ! |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1441 |
|
5758 | 1442 |
!CodeGeneratorTool methodsFor:'code generation-individual methods'! |
3712 | 1443 |
|
1444 |
createAcceptVisitorMethod:selector in:aClass |
|
1445 |
"create an acceptVisitor: method |
|
1446 |
(I'm tired of typing)" |
|
1447 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1448 |
self subclassResponsibility |
3712 | 1449 |
! |
1450 |
||
1451 |
createAcceptVisitorMethodIn:aClass |
|
1452 |
"create an acceptVisitor: method |
|
1453 |
(I'm tired of typing)" |
|
1454 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1455 |
self subclassResponsibility |
3712 | 1456 |
! |
1457 |
||
12877 | 1458 |
createAspectMethodFor:anAspectSymbol in:aClass |
1459 |
"create an aspect method." |
|
1460 |
||
1461 |
self subclassResponsibility |
|
1462 |
! |
|
1463 |
||
3712 | 1464 |
createCopyrightMethodFor:aClass |
1465 |
"add copyright method containing your/your companies |
|
1466 |
copyright template but only if not already present. |
|
1467 |
this is only added, if specified in the |
|
1468 |
COPYRIGHT_TEMPLATE_FILE resources." |
|
1469 |
||
8258 | 1470 |
|fn copyRightText| |
3712 | 1471 |
|
1472 |
(aClass includesSelector:#copyright) ifFalse:[ |
|
1473 |
fn := SystemBrowser classResources at:#'COPYRIGHT_TEMPLATE_FILE' default:nil. |
|
1474 |
fn notNil ifTrue:[ |
|
1475 |
fn := fn asFilename. |
|
1476 |
fn exists ifTrue:[ |
|
8488 | 1477 |
copyRightText := fn contentsAsString. |
8258 | 1478 |
self createCopyrightMethodFor:copyRightText for:aClass |
3712 | 1479 |
] |
1480 |
]. |
|
8258 | 1481 |
]. |
1482 |
! |
|
1483 |
||
1484 |
createCopyrightMethodFor:copyRightText for:aClass |
|
1485 |
"add copyright method containing text, |
|
1486 |
but only if not already present." |
|
1487 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1488 |
self subclassResponsibility |
3712 | 1489 |
! |
1490 |
||
1491 |
createDocumentationMethodFor:aClass |
|
1492 |
"add documentation method containing doc template |
|
1493 |
but only if not already present." |
|
1494 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1495 |
self subclassResponsibility |
3712 | 1496 |
! |
1497 |
||
1498 |
createExamplesMethodFor:aClass |
|
1499 |
"add examples method containing examples template |
|
1500 |
but only if not already present." |
|
1501 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1502 |
self subclassResponsibility |
3712 | 1503 |
! |
1504 |
||
11842
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1505 |
createFalseReturnMethodFor:aSelector category:cat in:aClass |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1506 |
"add a ^false method; |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1507 |
but only if not already present." |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1508 |
|
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1509 |
self subclassResponsibility |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1510 |
! |
70180ac9f3bf
+generate false return method
Claus Gittinger <cg@exept.de>
parents:
11758
diff
changeset
|
1511 |
|
3822
4e9f2f69875f
code generation for icons moved from ImageEditor
Claus Gittinger <cg@exept.de>
parents:
3804
diff
changeset
|
1512 |
createImageSpecMethodFor:anImage comment:comment in:aClass selector:sel |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1513 |
self subclassResponsibility |
3822
4e9f2f69875f
code generation for icons moved from ImageEditor
Claus Gittinger <cg@exept.de>
parents:
3804
diff
changeset
|
1514 |
! |
4e9f2f69875f
code generation for icons moved from ImageEditor
Claus Gittinger <cg@exept.de>
parents:
3804
diff
changeset
|
1515 |
|
3712 | 1516 |
createInitialHistoryMethodFor:aClass |
1517 |
"add history method containing created-entry |
|
1518 |
but only if not already present." |
|
1519 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1520 |
self subclassResponsibility |
3712 | 1521 |
! |
1522 |
||
4512 | 1523 |
createInstanceCreationMethodWithSetupFor:selector category:category in:aMetaClass |
1524 |
"add an inst-creation method" |
|
1525 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1526 |
self subclassResponsibility |
4512 | 1527 |
! |
1528 |
||
16248 | 1529 |
createMultiSetterInstanceCreationMethodFor:aCollectionOfVarNames in:aClass |
1530 |
"create a multi-setter instance creator method for instvars. |
|
1531 |
This creates a multi setter method (a:val1 b:val2 c:val3...) |
|
1532 |
and a corresponding new method on the class side." |
|
1533 |
||
1534 |
self subclassResponsibility |
|
1535 |
! |
|
1536 |
||
3712 | 1537 |
createMultiSetterMethodFor:aCollectionOfVarNames in:aClass |
16248 | 1538 |
"create a multi-setter method (a:val1 b:val2 c:val3...) for instvars." |
3712 | 1539 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1540 |
self subclassResponsibility |
3712 | 1541 |
! |
1542 |
||
13590 | 1543 |
createShouldImplementMethodFor:aSelector category:cat in:aClass |
1544 |
"add a shouldImplement method; |
|
1545 |
but only if not already present." |
|
1546 |
||
1547 |
self subclassResponsibility |
|
1548 |
! |
|
1549 |
||
3800
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1550 |
createSubclassResponsibilityMethodFor:aSelector category:cat in:aClass |
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1551 |
"add a subclassResponsibility method; |
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1552 |
but only if not already present." |
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1553 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1554 |
self subclassResponsibility |
3800
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1555 |
! |
a5c75c369855
added generateSubclassResponsibility
Claus Gittinger <cg@exept.de>
parents:
3719
diff
changeset
|
1556 |
|
3712 | 1557 |
createUpdateMethodIn:aClass |
1558 |
"create an update:with:from:-method |
|
1559 |
(I'm tired of typing)" |
|
1560 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1561 |
self subclassResponsibility |
3712 | 1562 |
! |
1563 |
||
1564 |
createVersionMethodFor:aClass |
|
8890 | 1565 |
<resource: #obsolete> |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1566 |
|
3712 | 1567 |
"add version method containing RCS template |
1568 |
but only if not already present and its not a private class." |
|
1569 |
||
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1570 |
self subclassResponsibility |
3712 | 1571 |
! ! |
1572 |
||
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1573 |
!CodeGeneratorTool methodsFor:'code templates'! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1574 |
|
8987 | 1575 |
codeFor_classInitialize |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1576 |
self subclassResponsibility |
8987 | 1577 |
! |
1578 |
||
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1579 |
codeFor_closeAccept |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1580 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1581 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1582 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1583 |
codeFor_closeDownViews |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1584 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1585 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1586 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1587 |
codeFor_closeRequest |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1588 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1589 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1590 |
"Created: / 27-10-2006 / 10:01:06 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1591 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1592 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1593 |
codeFor_doSaveAs |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1594 |
^ self codeFor_emptyMenuActionCodeFor:#doSaveAs menuItem:'save/saveAs' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1595 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1596 |
"Created: / 27-10-2006 / 10:22:06 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1597 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1598 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1599 |
codeFor_emptyMenuActionCodeFor:selector menuItem:item |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1600 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1601 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1602 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1603 |
codeFor_hasUnsavedChanges |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1604 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1605 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1606 |
"Created: / 27-10-2006 / 10:00:36 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1607 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1608 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1609 |
codeFor_menuNew |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1610 |
^ self codeFor_emptyMenuActionCodeFor:#menuNew menuItem:'new' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1611 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1612 |
"Created: / 27-10-2006 / 10:17:08 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1613 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1614 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1615 |
codeFor_menuOpen |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1616 |
^ self codeFor_emptyMenuActionCodeFor:#menuOpen menuItem:'open' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1617 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1618 |
"Created: / 27-10-2006 / 10:17:18 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1619 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1620 |
|
9099
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1621 |
codeFor_menuReload |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1622 |
^ self codeFor_emptyMenuActionCodeFor:#menuReload menuItem:'reload' |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1623 |
! |
2729600bb93c
include toolbar for new apps
Claus Gittinger <cg@exept.de>
parents:
9081
diff
changeset
|
1624 |
|
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1625 |
codeFor_menuSave |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1626 |
^ self codeFor_emptyMenuActionCodeFor:#menuSave menuItem:'save' |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1627 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1628 |
"Created: / 27-10-2006 / 10:17:25 / cg" |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1629 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1630 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1631 |
codeFor_menuSaveAs |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1632 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1633 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1634 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1635 |
codeFor_openAboutThisApplication |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1636 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1637 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1638 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1639 |
codeFor_openDocumentation |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1640 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1641 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1642 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1643 |
codeFor_postBuildWith |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1644 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1645 |
! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1646 |
|
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1647 |
codeFor_postOpenWith |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1648 |
self subclassResponsibility |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1649 |
! |
8572 | 1650 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1651 |
codeFor_shouldImplementFor:selector inClass:aClass |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1652 |
"used in the 'generate required protocol' to generate a shouldImplement-sending |
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1653 |
method for each subclassClassresponsibility method above aClass." |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1654 |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1655 |
self subclassResponsibility |
8572 | 1656 |
! |
1657 |
||
10592 | 1658 |
codeFor_standAloneApplicationRegistryPath |
11170 | 1659 |
^ self codeFor_standAloneApplicationRegistryPathFor:nil |
1660 |
||
1661 |
"Created: / 19-08-2011 / 02:13:14 / cg" |
|
1662 |
! |
|
1663 |
||
1664 |
codeFor_standAloneApplicationRegistryPathFor:aClass |
|
10592 | 1665 |
self subclassResponsibility |
1666 |
||
11170 | 1667 |
"Created: / 21-01-2012 / 11:23:47 / cg" |
10592 | 1668 |
! |
1669 |
||
1670 |
codeFor_standAloneApplicationUUID |
|
1671 |
self subclassResponsibility |
|
1672 |
||
1673 |
"Created: / 19-08-2011 / 02:12:51 / cg" |
|
1674 |
! |
|
1675 |
||
1676 |
codeFor_standAloneMain |
|
1677 |
self subclassResponsibility |
|
1678 |
||
1679 |
"Created: / 19-08-2011 / 02:12:44 / cg" |
|
1680 |
! |
|
1681 |
||
11170 | 1682 |
codeFor_standAloneRealMainMethodFor:aClass |
1683 |
self subclassResponsibility |
|
1684 |
||
1685 |
"Created: / 21-01-2012 / 12:28:45 / cg" |
|
1686 |
! |
|
1687 |
||
10592 | 1688 |
codeFor_standAloneUsage |
1689 |
self subclassResponsibility |
|
1690 |
||
1691 |
"Created: / 19-08-2011 / 02:21:52 / cg" |
|
1692 |
! |
|
1693 |
||
8572 | 1694 |
code_forWidget_buttonPress |
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1695 |
self subclassResponsibility |
8572 | 1696 |
! |
1697 |
||
1698 |
code_forWidget_initialize |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1699 |
self subclassResponsibility |
8572 | 1700 |
! |
1701 |
||
1702 |
code_forWidget_keyPress |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1703 |
self subclassResponsibility |
8572 | 1704 |
! |
1705 |
||
1706 |
code_forWidget_redraw |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1707 |
self subclassResponsibility |
8572 | 1708 |
! |
1709 |
||
1710 |
code_forWidget_sizeChanged |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1711 |
self subclassResponsibility |
8572 | 1712 |
! |
1713 |
||
1714 |
code_forWidget_update |
|
9705
3c29845b149d
reorganized/refactored into language specific and
Claus Gittinger <cg@exept.de>
parents:
9503
diff
changeset
|
1715 |
self subclassResponsibility |
7480
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1716 |
! ! |
33930379ab27
code cleanup; more application code generation
Claus Gittinger <cg@exept.de>
parents:
7470
diff
changeset
|
1717 |
|
6938 | 1718 |
!CodeGeneratorTool methodsFor:'compilation'! |
1719 |
||
17511 | 1720 |
compile:theCode forClass:aClass inCategory:cat |
6938 | 1721 |
"install some code for a class. |
17511 | 1722 |
If refactory browser stuff is available the refactory tools are used to support undo" |
6938 | 1723 |
|
7037 | 1724 |
self |
17511 | 1725 |
compile:theCode forClass:aClass inCategory:cat |
7037 | 1726 |
skipIfSame:true |
17511 | 1727 |
|
1728 |
"Modified (comment): / 17-05-2017 / 16:55:17 / mawalch" |
|
7037 | 1729 |
! |
6938 | 1730 |
|
17511 | 1731 |
compile:theCode forClass:aClass inCategory:categoryOrNil skipIfSame:skipIfSame |
7037 | 1732 |
"install some code for a class. |
17511 | 1733 |
If refactory browser stuff is available the refactory tools are used to support undo" |
7037 | 1734 |
|
16429 | 1735 |
|change compiler selector oldMethod category| |
6938 | 1736 |
|
16429 | 1737 |
category := categoryOrNil. |
13590 | 1738 |
|
7037 | 1739 |
skipIfSame ifTrue:[ |
14701
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1740 |
"JV: Do not use class's compilerClass, it may differ from |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1741 |
the compiler of this generator's language. For instance, |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1742 |
when compiling Smalltalk extension to Java or JavaScript class. |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1743 |
So, use proper compiler for language the receiver is generator for, |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1744 |
i.e., Compiler for SmalltalkCodeGenerator, JavaScriptCompiler for |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1745 |
JavaScriptCodeGenerator..." |
16392 | 1746 |
|
1747 |
"/ this is not the real compilation - but a prescan for the selector |
|
14701
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1748 |
compiler := self compilerClass new. |
7037 | 1749 |
compiler parseMethod:theCode in:aClass ignoreErrors:true ignoreWarnings:true. |
1750 |
||
1751 |
selector := compiler selector. |
|
1752 |
selector notNil ifTrue:[ |
|
13590 | 1753 |
oldMethod := aClass compiledMethodAt:selector. |
1754 |
oldMethod notNil ifTrue:[ |
|
16429 | 1755 |
oldMethod source = theCode ifTrue:[^ self ]. "/ the same. |
17511 | 1756 |
|
16429 | 1757 |
categoryOrNil isNil ifTrue:[ |
1758 |
"/ if no category given, take the existing one. |
|
1759 |
category := oldMethod category. |
|
1760 |
]. |
|
13590 | 1761 |
]. |
6938 | 1762 |
]. |
1763 |
]. |
|
1764 |
||
16429 | 1765 |
category isNil ifTrue:[ |
1766 |
category := Compiler defaultMethodCategory. |
|
17511 | 1767 |
]. |
16429 | 1768 |
|
6938 | 1769 |
self canUseRefactoringSupport ifFalse:[ |
1770 |
"/ compile immediately |
|
16429 | 1771 |
^ aClass compile:theCode classified:category. |
6938 | 1772 |
]. |
1773 |
||
13590 | 1774 |
change := InteractiveAddMethodChange compile:(theCode asString) in:aClass classified:category. |
16392 | 1775 |
change controller:(CompilationErrorHandlerQuery query). |
6938 | 1776 |
|
1777 |
compositeChangeCollector notNil ifTrue:[ |
|
16429 | 1778 |
"/ if collecting, add to changes, to be executed as one change at the end. |
1779 |
"/ In order to have only one change in the undo-list (instead of many) |
|
1780 |
compositeChangeCollector addChange:change. |
|
6938 | 1781 |
] ifFalse:[ |
16429 | 1782 |
"/ do it now. |
7037 | 1783 |
RefactoryChangeManager performChange:change. |
16429 | 1784 |
]. |
17511 | 1785 |
|
6938 | 1786 |
"Modified: / 21-08-2006 / 18:39:06 / cg" |
11170 | 1787 |
"Modified (format): / 21-01-2012 / 10:40:59 / cg" |
14701
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1788 |
"Modified (format): / 05-08-2014 / 21:06:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17511 | 1789 |
"Modified (comment): / 17-05-2017 / 16:55:49 / mawalch" |
14701
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1790 |
! |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1791 |
|
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1792 |
compilerClass |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1793 |
"Return a real compiler classto use to compile code" |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1794 |
|
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1795 |
^ self subclassResponsibility |
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1796 |
|
a10c86eb7b9c
Fixes in CodeGeneatorTool for to handle properly mixed-language classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14425
diff
changeset
|
1797 |
"Created: / 05-08-2014 / 21:01:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6938 | 1798 |
! ! |
3712 | 1799 |
|
8572 | 1800 |
!CodeGeneratorTool methodsFor:'initialization'! |
1801 |
||
10466
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1802 |
confirmChanges |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1803 |
"if true, let user confirm complicated changes; if false, just do it" |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1804 |
|
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1805 |
^ confirmChanges ? true |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1806 |
|
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1807 |
"Created: / 04-08-2011 / 17:31:45 / cg" |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1808 |
! |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1809 |
|
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1810 |
confirmChanges:aBoolean |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1811 |
"if true, let user confirm complicated changes; if false, just do it" |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1812 |
|
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1813 |
confirmChanges := aBoolean |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1814 |
|
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1815 |
"Created: / 04-08-2011 / 17:26:47 / cg" |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1816 |
! |
4b42e5a1f395
added a hook to turn off confirmations
Claus Gittinger <cg@exept.de>
parents:
10319
diff
changeset
|
1817 |
|
8572 | 1818 |
initialize |
1819 |
userPreferences := UserPreferences current. |
|
1820 |
generateComments := userPreferences generateComments. |
|
1821 |
! ! |
|
1822 |
||
5758 | 1823 |
!CodeGeneratorTool methodsFor:'private'! |
4108
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1824 |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1825 |
canUseRefactoringSupport |
17511 | 1826 |
"check if refactory browser stuff is available" |
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1827 |
|
5758 | 1828 |
^ self class canUseRefactoringSupport |
17511 | 1829 |
|
1830 |
"Modified (comment): / 17-05-2017 / 16:55:06 / mawalch" |
|
5013
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1831 |
! |
0f2c39fc6e8c
comments; allow for comments to be suppressed
Claus Gittinger <cg@exept.de>
parents:
4926
diff
changeset
|
1832 |
|
4108
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1833 |
privCreateClassResponsibleProtocolFor:aClass |
6791
6559c9ebb561
Keep method argument names when generating required methods
Stefan Vogel <sv@exept.de>
parents:
6718
diff
changeset
|
1834 |
"create stubs for the required protocol. |
6559c9ebb561
Keep method argument names when generating required methods
Stefan Vogel <sv@exept.de>
parents:
6718
diff
changeset
|
1835 |
aClass may be a a MetaClass or a non-MetaClass" |
4108
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1836 |
|
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1837 |
|requiredProtocol| |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1838 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1839 |
requiredProtocol := self class missingRequiredProtocolFor:aClass. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1840 |
requiredProtocol do:[:eachSelector | |
9025
124489bab860
added: #codeForShouldImplementFor:inClass:
Claus Gittinger <cg@exept.de>
parents:
9022
diff
changeset
|
1841 |
|code implClass| |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1842 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1843 |
implClass := aClass whichClassImplements:eachSelector. |
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1844 |
implClass == Object ifFalse:[ |
9027
f2edc1bca4de
added: #codeFor_shouldImplementFor:inClass:
Claus Gittinger <cg@exept.de>
parents:
9025
diff
changeset
|
1845 |
code := self codeFor_shouldImplementFor:eachSelector inClass:aClass. |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1846 |
|
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1847 |
self |
9025
124489bab860
added: #codeForShouldImplementFor:inClass:
Claus Gittinger <cg@exept.de>
parents:
9022
diff
changeset
|
1848 |
compile:code |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1849 |
forClass:aClass |
9025
124489bab860
added: #codeForShouldImplementFor:inClass:
Claus Gittinger <cg@exept.de>
parents:
9022
diff
changeset
|
1850 |
inCategory:(implClass compiledMethodAt:eachSelector) category. |
9022
676088a17690
added: #missingRequiredProtocolFor:
Claus Gittinger <cg@exept.de>
parents:
8987
diff
changeset
|
1851 |
] |
4108
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1852 |
]. |
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1853 |
! ! |
19af32811dfd
Generate minimal protocol classes for metaclass.
Stefan Vogel <sv@exept.de>
parents:
3823
diff
changeset
|
1854 |
|
3712 | 1855 |
!CodeGeneratorTool class methodsFor:'documentation'! |
1856 |
||
10594
362f9b437426
changed: #createStandaloneStartupCodeFor:
Claus Gittinger <cg@exept.de>
parents:
10592
diff
changeset
|
1857 |
version |
16194 | 1858 |
^ '$Header$' |
10594
362f9b437426
changed: #createStandaloneStartupCodeFor:
Claus Gittinger <cg@exept.de>
parents:
10592
diff
changeset
|
1859 |
! |
362f9b437426
changed: #createStandaloneStartupCodeFor:
Claus Gittinger <cg@exept.de>
parents:
10592
diff
changeset
|
1860 |
|
8890 | 1861 |
version_CVS |
16194 | 1862 |
^ '$Header$' |
3712 | 1863 |
! ! |
12877 | 1864 |