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