ClassDefinitionChange.st
author Claus Gittinger <cg@exept.de>
Wed, 13 Jun 2012 12:26:13 +0200
changeset 2832 3cefeea51558
parent 2831 667bf6769db8
child 2833 08f9fc1732e2
permissions -rw-r--r--
changed: #poolDictionaries #setupFromSource fixed pool extraction
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     1
"
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
     3
	      All Rights Reserved
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     4
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     5
 This software is furnished under a license and may be used
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     6
 only in accordance with the terms of that license and with the
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     8
 be provided or otherwise made available to, or used by, any
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     9
 other person.  No title to or ownership of the software is
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    10
 hereby transferred.
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
    13
0
470788421600 Initial revision
claus
parents:
diff changeset
    14
ClassChange subclass:#ClassDefinitionChange
2316
df2a19de6d8a class definition
Claus Gittinger <cg@exept.de>
parents: 2289
diff changeset
    15
	instanceVariableNames:'objectType superClassName classType indexedType otherParameters
df2a19de6d8a class definition
Claus Gittinger <cg@exept.de>
parents: 2289
diff changeset
    16
		instanceVariableNames classVariableNames
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    17
		classInstanceVariableNames poolDictionaries category private
1871
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
    18
		definitionSelector owningClassName'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    19
	classVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    20
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    21
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    22
!
470788421600 Initial revision
claus
parents:
diff changeset
    23
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    24
!ClassDefinitionChange class methodsFor:'documentation'!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    25
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    26
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    27
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    28
 COPYRIGHT (c) 1993 by Claus Gittinger
38
claus
parents: 10
diff changeset
    29
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    30
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    31
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    32
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    34
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    35
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    36
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    37
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    38
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    39
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    40
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    41
"
1162
4af27057a3ce comment
Claus Gittinger <cg@exept.de>
parents: 1134
diff changeset
    42
    instances represent class definition-changes. 
4af27057a3ce comment
Claus Gittinger <cg@exept.de>
parents: 1134
diff changeset
    43
    They are typically held in a ChangeSet.
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    44
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    45
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    46
        Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 6
diff changeset
    47
"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    48
! !
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    49
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    50
!ClassDefinitionChange methodsFor:'accessing'!
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    51
1434
bc28c94f2e04 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    52
basicSuperClassName 
bc28c94f2e04 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    53
    ^ superClassName
bc28c94f2e04 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    54
!
bc28c94f2e04 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
    55
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    56
category
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    57
    category isNil ifTrue:[
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    58
        self setupFromSource.
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    59
    ].
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    60
    ^ category
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    61
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
    62
    "Modified: / 11-10-2006 / 14:12:01 / cg"
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    63
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    64
1178
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    65
category:something
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    66
    category := something.
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    67
!
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    68
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    69
classInstanceVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    70
    ^ classInstanceVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    71
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    72
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    73
classInstanceVariableNames:something
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    74
    classInstanceVariableNames := something.
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    75
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    76
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    77
classVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    78
    ^ classVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    79
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    80
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    81
classVariableNames:something
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    82
    classVariableNames := something.
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    83
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    84
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    85
delta
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    86
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    87
    | class |
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    88
    class := self changeClass.
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    89
    class ifNil:[^#+].
2504
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    90
    ^(self class isSource: self source sameSourceAs: class definitionWithoutPackage "definition")
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    91
        ifTrue:[#=]
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
    92
        ifFalse:[#~]
2504
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    93
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    94
    "Modified: / 31-08-2011 / 09:26:48 / cg"
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    95
!
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    96
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    97
deltaDetail
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    98
    "Returns a delta to the current state as a ChangeDelta object"
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
    99
2690
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   100
    | class mySource imageSource myTree imageTree same |
2504
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   101
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   102
    class := self changeClass.
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   103
    class isNil ifTrue:[^ ChangeDeltaInformation added ].
2753
81f43ea8ce75 changed: #deltaDetail
vrany
parents: 2690
diff changeset
   104
    class isLoaded ifFalse:[^ ChangeDeltaInformation different ].
2504
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   105
    mySource := self source.
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   106
    imageSource := class definitionWithoutPackage "definition".
2690
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   107
    same := (mySource = imageSource).
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   108
    same ifFalse:[
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   109
        same := (self class isSource: mySource sameSourceAs: imageSource ).
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   110
        same ifFalse:[
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   111
            "/ care for formatting (tabs, indentation etc.)
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   112
            myTree := RBParser parseExpression:mySource.
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   113
            imageTree := RBParser parseExpression:imageSource.
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   114
            same := (myTree = imageTree).
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   115
            same ifFalse:[
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   116
                "/ some classDefinition strings contain sn
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   117
                "/ instVarName string like 'foo bar ' instead of 'foo bar' (i.e. added a space)...
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   118
                ((myTree receiver = imageTree receiver)
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   119
                    and:[ (myTree selector = imageTree selector)
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   120
                    and:[ ('*ubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' match: myTree selector)
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   121
                    and:[ (myTree arguments at:1) = (imageTree arguments at:1)  
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   122
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   123
                    and:[ (2 to:5) conform:[:i |
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   124
                            ((myTree arguments at:i) isLiteral
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   125
                            and:[ (imageTree arguments at:i) isLiteral
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   126
                            and:[ (myTree arguments at:i) value asString withoutSeparators
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   127
                                  = (imageTree arguments at:i) value asString withoutSeparators ]]) ]   
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   128
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   129
                ]]]])
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   130
                    ifTrue:[
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   131
                        same := true
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   132
                    ]
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   133
            ].
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   134
        ]
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   135
    ].
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   136
f2ccdca6b6af changed: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   137
    ^ same 
2504
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   138
        ifTrue:[ ChangeDeltaInformation identical ]
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   139
        ifFalse:[ ChangeDeltaInformation different ]
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   140
c0f78584ae54 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2425
diff changeset
   141
    "Created: / 31-08-2011 / 10:26:42 / cg"
2753
81f43ea8ce75 changed: #deltaDetail
vrany
parents: 2690
diff changeset
   142
    "Modified: / 24-01-2012 / 22:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   143
!
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   144
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   145
instanceVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   146
    ^ instanceVariableNames
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   147
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   148
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   149
instanceVariableNames:something
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   150
    instanceVariableNames := something.
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   151
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   152
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   153
nameSpaceName
1318
e31c6a24ab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   154
    objectType == #variable ifTrue:[
e31c6a24ab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   155
        ^ nil
e31c6a24ab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   156
    ].
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   157
    ^ self cutNameSpaceOf:(self nameSpaceOverride ? super nameSpaceName)
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   158
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   159
    "Modified: / 07-09-2011 / 20:47:14 / cg"
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   160
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   161
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   162
nameSpaceName: aNameSpaceName classType: aClassType otherParameters:otherParametersArg
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   163
    "this instance setup message is used when reading from a VW-xml change file.
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   164
     Support for this is not yet complete."
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   165
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   166
    |indexedType imports|
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   167
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   168
    nameSpaceOverride := aNameSpaceName.
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   169
    classType := aClassType.
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   170
    otherParameters := Dictionary new addAll:otherParametersArg; yourself.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   171
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   172
    superClassName := otherParameters at:#superclass: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   173
    superClassName notNil ifTrue:[
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   174
        superClassName := superClassName pathString.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   175
    ].
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   176
    indexedType := otherParameters at:#indexedType: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   177
    private := otherParameters at:#private: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   178
    instanceVariableNames := otherParameters at:#instanceVariableNames: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   179
    classInstanceVariableNames := otherParameters at:#classInstanceVariableNames: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   180
    imports := otherParameters at:#imports: ifAbsent:nil.
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   181
    category := otherParameters at:#category: ifAbsent:nil.
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   182
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   183
    "Modified: / 15-06-2010 / 14:50:35 / cg"
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   184
!
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   185
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   186
objectType
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   187
    "return the value of the instance variable 'objectType' (automatically generated)"
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   188
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   189
    ^ objectType
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   190
!
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   191
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   192
objectType:something
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   193
    "set the value of the instance variable 'objectType' (automatically generated)"
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   194
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   195
    objectType := something.
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   196
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   197
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   198
poolDictionaries
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   199
    poolDictionaries isNil ifTrue:[
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   200
        self setupFromSource.
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   201
    ].
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   202
    ^ poolDictionaries
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   203
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   204
    "Modified: / 13-06-2012 / 12:23:41 / cg"
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   205
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   206
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   207
poolDictionaries:something
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   208
    poolDictionaries := something.
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   209
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   210
2289
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   211
private:aBoolean
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   212
    private := aBoolean.
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   213
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   214
    "Created: / 30-08-2010 / 13:56:11 / cg"
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   215
!
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   216
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   217
source
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   218
    "return the source of the change"
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   219
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   220
    |src ns|
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   221
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   222
    (src := source) isNil ifTrue:[
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   223
        src := self definitionString
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   224
    ].
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   225
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   226
    (ns := self nameSpaceOverride) notNil ifTrue:[
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   227
        (className startsWith:(ns,'::')) ifFalse:[
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   228
            ^ '"{ NameSpace: ' , ns , ' }"' , 
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   229
                Character cr, Character cr , 
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   230
                src string
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   231
        ].
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   232
    ].
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   233
    ^ src
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   234
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   235
    "Modified: / 07-09-2011 / 20:46:13 / cg"
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   236
!
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   237
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   238
superClassName 
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   239
    |nm|
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   240
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   241
    nm := superClassName.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   242
    nm notNil ifTrue:[
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   243
        (nm includes:$.) ifTrue:[
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   244
            ^ nm copyReplaceAll:$. withAll:'::'.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   245
        ]
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   246
    ].
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   247
    ^ nm
1427
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   248
!
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   249
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   250
superClassName:something
ada0805a62aa more state
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   251
    superClassName := something.
2207
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   252
    self invalidateSource.
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   253
!
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   254
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   255
superClassNameWithoutMyNamespace
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   256
    |nm|
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   257
1956
45c24d58e47e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   258
    superClassName isNil ifTrue:[^ 'nil'].
45c24d58e47e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   259
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   260
    nm := self cutMyNameSpaceOf:superClassName.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   261
    (nm includes:$.) ifTrue:[
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   262
        ^ nm copyReplaceAll:$. withAll:'::'.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   263
    ].
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   264
    ^ nm
1956
45c24d58e47e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   265
45c24d58e47e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
   266
    "Modified: / 03-03-2007 / 13:09:07 / cg"
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   267
!
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   268
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   269
superClassNameWithoutNamespace
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   270
    |nm|
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   271
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   272
    nm := self cutNameSpaceOf:superClassName.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   273
    (nm includes:$.) ifTrue:[
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   274
        ^ nm copyReplaceAll:$. withAll:'::'.
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   275
    ].
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   276
    ^ nm
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   277
! !
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   278
1998
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   279
!ClassDefinitionChange methodsFor:'applying'!
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   280
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   281
apply
2425
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   282
    superClassName isNil ifTrue:[
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   283
        self setupFromSource
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   284
    ].
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   285
    superClassName isNil ifTrue:[
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   286
        self error:'Should not happen'
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   287
    ].
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   288
    (Smalltalk classNamed:superClassName) isNil ifTrue:[
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   289
        Class undeclared:superClassName
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   290
    ].
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   291
    Parser evaluate:(self source).       
1998
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   292
    package notNil ifTrue:[
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   293
        self changeClass setPackage:package.
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   294
    ].
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   295
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   296
    "
2425
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   297
      (ClassDefinitionChange className: #TestB source: 'TestA subclass: #TestB
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   298
          instanceVariableNames:''''
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   299
          classVariableNames:''''
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   300
          poolDictionaries:''''
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   301
          category:''* remove me *''')
b0011db09dfe changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2410
diff changeset
   302
          apply
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   303
    "
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   304
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   305
    "Modified: / 08-11-2010 / 16:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   306
    "Modified: / 06-10-2011 / 17:01:58 / cg"
1998
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   307
! !
06004ad8a6e4 changed #apply - set the packageId
Stefan Vogel <sv@exept.de>
parents: 1956
diff changeset
   308
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   309
!ClassDefinitionChange methodsFor:'comparing'!
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   310
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   311
isForSameAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   312
    "return true, if the given change represents a change for the same
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   313
     thingy as the receiver (i.e. same method, same definition etc.)."
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   314
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   315
    changeB isClassDefinitionChange ifFalse:[^ false].   
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   316
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   317
    className ~= changeB className ifTrue:[^ false].
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   318
    ^ true
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   319
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   320
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   321
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   322
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   323
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   324
!
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   325
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   326
sameAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   327
    "return true, if the given change represents the same change as the receiver."
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   328
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
   329
    (self isForSameAs:changeB) ifFalse:[^ false].
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   330
    ^ self sameSourceAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   331
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   332
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   333
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   334
! !
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   335
2410
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   336
!ClassDefinitionChange methodsFor:'converting'!
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   337
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   338
asAntiChange
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   339
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   340
    ^ClassRemoveChange className: self className
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   341
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   342
    "Created: / 02-11-2009 / 11:11:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   343
! !
b09cc8e12790 Extension methods from libsvn
vrany
parents: 2402
diff changeset
   344
962
3821ab69b939 category change
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   345
!ClassDefinitionChange methodsFor:'printing & storing'!
787
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   346
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   347
definitionString
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   348
    |ns classNameUsed superClassNameUsed|
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   349
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   350
    ns := self nameSpaceOverride.
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   351
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   352
    objectType == #variable ifTrue:[
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   353
        ^ String streamContents:[:stream |
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   354
            ns notNil ifTrue:[
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   355
                stream 
2515
39059cf824a8 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
   356
                    nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::')
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   357
            ] ifFalse:[
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   358
                self halt:'can this happen ?'.
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   359
                stream 
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   360
                    nextPutAll:'Smalltalk'
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   361
            ].
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   362
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   363
            stream 
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   364
                nextPutAll:' addClassVarName:';
1318
e31c6a24ab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   365
                nextPutAll:className asString storeString
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   366
          ].
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   367
    ].
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   368
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   369
    superClassNameUsed := self superClassName.
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   370
    classNameUsed := self className.
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   371
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   372
    ^ String streamContents:[:stream |
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   373
        stream 
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   374
            nextPutAll:superClassNameUsed;
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   375
            nextPutAll:' subclass:';
2554
f3d7c0dc56b0 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   376
            nextPutAll: classNameUsed asSymbol storeString
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   377
            ;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   378
            cr;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   379
            spaces:4;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   380
            nextPutAll:'instanceVariableNames: ';
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   381
            nextPutAll:(instanceVariableNames ? '') storeString;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   382
            cr;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   383
            spaces:4;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   384
            nextPutAll:'classVariableNames: ';
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   385
            nextPutAll:(classVariableNames ? '') storeString;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   386
            cr;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   387
            spaces:4;
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   388
            nextPutAll:'poolDictionaries: ';
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   389
            nextPutAll:(poolDictionaries ? '') storeString;
2831
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   390
            cr.
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   391
        private == true ifTrue:[
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   392
            stream 
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   393
                spaces:4;
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   394
                nextPutAll:'privateIn: ';
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   395
                nextPutAll:(self owningClassName)
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   396
        ] ifFalse:[
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   397
            stream 
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   398
                spaces:4;
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   399
                nextPutAll:'category: ';
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   400
                nextPutAll:(category ? '') storeString
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   401
        ].
1473
a8fe22600414 more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   402
      ]
2280
c93519e114c9 fix for namespace: do not add ns twice.
Claus Gittinger <cg@exept.de>
parents: 2207
diff changeset
   403
2831
667bf6769db8 changed: #definitionString
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   404
    "Modified: / 06-06-2012 / 16:41:20 / cg"
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   405
!
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   406
1101
fd826cb660e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   407
printOn:aStream
1866
137956d65cad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   408
    aStream 
137956d65cad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   409
        nextPutAll:className; nextPutAll:' {definition}'
137956d65cad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   410
137956d65cad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   411
    "Modified: / 12-10-2006 / 17:48:28 / cg"
1101
fd826cb660e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   412
!
fd826cb660e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   413
896
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   414
printWithoutClassNameOn:aStream
787
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   415
    aStream nextPutAll:('definition of ' , className)
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   416
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   417
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   418
! !
5d49bd054fc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   419
772
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   420
!ClassDefinitionChange methodsFor:'queries'!
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   421
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   422
definitionSelector
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   423
    definitionSelector isNil ifTrue:[
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   424
        self setupFromSource.
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   425
    ].
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   426
    ^ definitionSelector
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   427
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   428
    "Modified: / 11-10-2006 / 14:11:44 / cg"
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   429
!
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   430
772
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   431
isClassDefinitionChange
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   432
    ^ true
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   433
!
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   434
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   435
isPrivateClassDefinitionChange
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   436
    private isNil ifTrue:[
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   437
        (className includes:$:) ifFalse:[
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   438
            "/ cannot be private
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   439
            private := false
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   440
        ] ifTrue:[
1909
ec92c9dabf66 care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents: 1904
diff changeset
   441
            source isNil ifTrue:[^ false ].
ec92c9dabf66 care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents: 1904
diff changeset
   442
            (source includesString:'private') ifFalse:[
ec92c9dabf66 care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents: 1904
diff changeset
   443
                private := false.
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   444
            ] ifTrue:[
1916
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   445
"/                (self changeClass notNil
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   446
"/                and:[self changeClass isLoaded not]) ifTrue:[
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   447
"/                    "/ cannot be private
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   448
"/                    private := false
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   449
"/                ] ifTrue:[
1909
ec92c9dabf66 care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents: 1904
diff changeset
   450
                    self setupFromSource.
1916
398d157846cb changed #isPrivateClassDefinitionChange
ca
parents: 1909
diff changeset
   451
"/                ].
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   452
            ].
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   453
        ].
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   454
    ].
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   455
    ^ private
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   456
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   457
    "Created: / 11-10-2006 / 14:19:03 / cg"
1909
ec92c9dabf66 care for isPrivate query when no source is avail.
Claus Gittinger <cg@exept.de>
parents: 1904
diff changeset
   458
    "Modified: / 16-11-2006 / 16:34:19 / cg"
1871
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   459
!
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   460
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   461
owningClassName
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   462
    self isPrivateClassDefinitionChange ifTrue:[
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   463
        owningClassName isNil ifTrue:[
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   464
            self setupFromSource.
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   465
        ].
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   466
    ].
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   467
    ^ owningClassName
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   468
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   469
    "Created: / 12-10-2006 / 23:07:25 / cg"
2289
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   470
!
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   471
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   472
owningClassName:aStringOrSymbol
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   473
    owningClassName := aStringOrSymbol
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   474
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   475
    "Created: / 30-08-2010 / 13:55:37 / cg"
772
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   476
! !
8e638e1b2da3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   477
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   478
!ClassDefinitionChange methodsFor:'special'!
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   479
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   480
installAsAutoloadedClassIfPublicWithFilename:aFilenameString
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   481
    "install the class defined by this change as autoloaded.
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   482
     Skip private classes.
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   483
     Enter class file name as abbreviation"
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   484
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   485
    |parseTree sel cat clsName cls catIdx pkg|
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   486
2289
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   487
    private == true ifTrue:[^ self].
Claus Gittinger <cg@exept.de>
parents: 2280
diff changeset
   488
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   489
    parseTree := Parser parseExpression:self source.
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   490
    parseTree isMessage ifFalse:[
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   491
        self error:'bad change source'.
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   492
    ].
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   493
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   494
    sel := parseTree selector.
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   495
    (sel endsWith:':privateIn:') ifTrue:[^ self].
1418
12e8c28ea8a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1395
diff changeset
   496
2402
f6799fe6acc4 changed: #installAsAutoloadedClassIfPublicWithFilename:
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   497
    catIdx := sel asSymbol keywords indexOf:'category:'.  
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   498
    catIdx ~~ 0 ifTrue:[
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   499
        cat := (parseTree args at:catIdx) evaluate.
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   500
    ].
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   501
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   502
    clsName := self className asSymbol.
1802
e6b6e7ff0475 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1473
diff changeset
   503
    cls := Smalltalk at:clsName.
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   504
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   505
    pkg := package ? Project current package.   
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   506
1802
e6b6e7ff0475 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1473
diff changeset
   507
    (cls isNil 
e6b6e7ff0475 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1473
diff changeset
   508
     or:[cls isBehavior not
e6b6e7ff0475 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1473
diff changeset
   509
     or:[cls isLoaded not]]) ifTrue:[
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   510
        |autoloadedClass|
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   511
1836
32d067ea4c1a classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   512
        autoloadedClass := Smalltalk 
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   513
           installAutoloadedClassNamed:clsName 
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   514
           category:cat 
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   515
           package:pkg 
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   516
           revision:nil.
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   517
        aFilenameString notNil ifTrue:[
1836
32d067ea4c1a classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   518
            autoloadedClass setClassFilename:aFilenameString.
32d067ea4c1a classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   519
            "/ Smalltalk setFilename:aFilenameString forClass:clsName package:pkg.
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   520
        ]
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   521
    ] ifFalse:[
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   522
        cls notNil ifTrue:[
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   523
            cls isBehavior ifTrue:[
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   524
                cls package ~= pkg ifTrue:[
2180
c952a3ae234d changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents: 2093
diff changeset
   525
Transcript showCR:('Autoloaded class: %1 not installed (package would change from %2 to %3)' 
c952a3ae234d changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents: 2093
diff changeset
   526
                        bindWith:clsName with:cls package with:pkg).
1904
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   527
                ]
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   528
            ].
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   529
        ].
d025e9f1cb8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1887
diff changeset
   530
    ].
1836
32d067ea4c1a classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   531
2402
f6799fe6acc4 changed: #installAsAutoloadedClassIfPublicWithFilename:
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   532
    "Modified: / 03-07-2011 / 18:34:05 / cg"
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   533
!
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   534
2207
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   535
invalidateSource
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   536
    "internal - flush the sourceString if it got invalidated due to a
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   537
     className, superclassName, etc... change"
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   538
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   539
    source := nil.
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   540
!
16ad29953b1b added: #invalidateSource
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
   541
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   542
setupFromSource
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   543
    "extract privacy, category and selector from the source"
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   544
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   545
    |parseTree catIdx poolIdx|
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   546
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   547
    source notNil ifTrue:[
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   548
        parseTree := Parser parseExpression:source.
1878
03616db03ea9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1871
diff changeset
   549
        (parseTree notNil and:[parseTree isMessage]) ifFalse:[
1887
8dac6c403660 changed #setupFromSource
Claus Gittinger <cg@exept.de>
parents: 1878
diff changeset
   550
            self error:'bad change source' mayProceed:true.
8dac6c403660 changed #setupFromSource
Claus Gittinger <cg@exept.de>
parents: 1878
diff changeset
   551
            ^ self
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   552
        ].
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   553
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   554
        definitionSelector := parseTree selector.
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   555
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   556
        private := (definitionSelector endsWith:':privateIn:').
1871
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   557
        private ifTrue:[
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   558
            owningClassName := parseTree args last name.
3daa5601c86e +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1866
diff changeset
   559
        ].
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   560
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   561
        catIdx := definitionSelector keywords indexOf:'category:'.  
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   562
        catIdx ~~ 0 ifTrue:[
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   563
            category := (parseTree args at:catIdx) evaluate.
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   564
        ].
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   565
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   566
        poolIdx := definitionSelector keywords indexOf:'poolDictionaries:'.  
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   567
        poolIdx ~~ 0 ifTrue:[
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   568
            poolDictionaries := (parseTree args at:poolIdx) evaluate.
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   569
        ].
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   570
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   571
        superClassName := parseTree receiver name.
1854
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   572
    ].
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   573
0ff12f6ba051 queries for privacy
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   574
    "Created: / 11-10-2006 / 14:10:02 / cg"
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   575
    "Modified: / 08-11-2010 / 13:47:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   576
    "Modified: / 13-06-2012 / 12:25:10 / cg"
1134
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   577
! !
915934e8aab8 care for package; added installAsAutoloaded
Claus Gittinger <cg@exept.de>
parents: 1101
diff changeset
   578
2614
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   579
!ClassDefinitionChange methodsFor:'visiting'!
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   580
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   581
acceptChangeVisitor:aVisitor
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   582
    ^ aVisitor visitClassDefinitionChange:self.
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   583
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   584
    "Created: / 25-11-2011 / 17:13:13 / cg"
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   585
! !
7d342615bb66 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   586
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   587
!ClassDefinitionChange class methodsFor:'documentation'!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   588
2518
2cae313d2ab7 changed: #package:
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   589
version
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   590
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.68 2012-06-13 10:26:13 cg Exp $'
2518
2cae313d2ab7 changed: #package:
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   591
!
2cae313d2ab7 changed: #package:
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   592
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   593
version_CVS
2832
3cefeea51558 changed:
Claus Gittinger <cg@exept.de>
parents: 2831
diff changeset
   594
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.68 2012-06-13 10:26:13 cg Exp $'
2180
c952a3ae234d changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents: 2093
diff changeset
   595
!
c952a3ae234d changed: #installAsAutoloadedClassIfPublicWithFilename:
Stefan Vogel <sv@exept.de>
parents: 2093
diff changeset
   596
2368
7e64ab6633f9 Jan's changes
vrany
parents: 2316
diff changeset
   597
version_SVN
2402
f6799fe6acc4 changed: #installAsAutoloadedClassIfPublicWithFilename:
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   598
    ^ '§ Id: ClassDefinitionChange.st 1867 2011-06-08 21:57:08Z vranyj1  §'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   599
! !