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