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