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