ClassChange.st
author Claus Gittinger <cg@exept.de>
Tue, 20 Mar 2012 19:19:01 +0100
changeset 2815 a87f6217b606
parent 2612 be94644aae8c
child 2901 6b85ec626617
permissions -rw-r--r--
added: #nameSpaceOverride:
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
"
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
    13
0
470788421600 Initial revision
claus
parents:
diff changeset
    14
Change subclass:#ClassChange
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
    15
	instanceVariableNames:'className package nameSpaceOverride'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    16
	classVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    17
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    18
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    19
!
470788421600 Initial revision
claus
parents:
diff changeset
    20
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    21
!ClassChange class methodsFor:'documentation'!
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    22
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    23
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    24
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    25
 COPYRIGHT (c) 1993 by Claus Gittinger
38
claus
parents: 10
diff changeset
    26
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    27
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    28
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    29
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    32
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    33
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    34
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    35
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    36
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    37
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    38
"
45
claus
parents: 39
diff changeset
    39
    Abstract superclass for class related changes
1162
4af27057a3ce comment
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
    40
    They are typically held in a ChangeSet.
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    41
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    42
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    43
        Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    44
"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    45
! !
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    46
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    47
!ClassChange class methodsFor:'instance creation'!
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    48
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    49
class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    50
    ^ self new class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    51
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    52
    "Created: 3.12.1995 / 14:01:32 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    53
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    54
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    55
class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    56
    ^ self new class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    57
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    58
    "Created: 3.12.1995 / 14:01:32 / cg"
1903
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    59
!
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    60
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    61
className:aClassName
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    62
    ^ self new className:aClassName
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    63
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    64
    "Created: / 13-11-2006 / 10:37:39 / cg"
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    65
!
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    66
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    67
className:aClassName source:source
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    68
    ^ self new className:aClassName source:source
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    69
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
    70
    "Created: / 12-11-2006 / 20:11:26 / cg"
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    71
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    72
0
470788421600 Initial revision
claus
parents:
diff changeset
    73
!ClassChange methodsFor:'accessing'!
470788421600 Initial revision
claus
parents:
diff changeset
    74
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    75
changeClass
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
    76
    "the class of the change (nil if not present).
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
    77
     Take care for changes from foreign Smalltalks having 
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
    78
     a different Namespace definition syntax"
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    79
1897
6f60021f9058 comment
Claus Gittinger <cg@exept.de>
parents: 1870
diff changeset
    80
    "do not autoload an owning class of a private class!!"
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    81
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
    82
    |className class owner altName nsName ns meta|
1855
0c365a83ffc2 care for class name aliases when getting an existing
Claus Gittinger <cg@exept.de>
parents: 1513
diff changeset
    83
0c365a83ffc2 care for class name aliases when getting an existing
Claus Gittinger <cg@exept.de>
parents: 1513
diff changeset
    84
    className := self className.
2245
335416c1cd10 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2169
diff changeset
    85
    className isNil ifTrue:[^ nil].
335416c1cd10 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2169
diff changeset
    86
2555
86df1e00019f comment/format in: #classNameWithoutNamespace
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
    87
    class := Smalltalk at:className asSymbol.
86df1e00019f comment/format in: #classNameWithoutNamespace
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
    88
    class notNil ifTrue:[^ class ].
86df1e00019f comment/format in: #classNameWithoutNamespace
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
    89
86df1e00019f comment/format in: #classNameWithoutNamespace
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
    90
    "/ ok, try some heuristics (for example Root.something -> Smalltalk::something)
2094
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
    91
    (className includes:$.) ifTrue:[
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
    92
        "/ VW - namespace prefix - convert to colon-notation
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
    93
        className := className copyReplaceAll:$. withAll:'::'.
2520
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
    94
    ].       
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
    95
    nsName := self nameSpaceOverride ? 'Smalltalk'.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
    96
    nsName notNil ifTrue:[
2525
0d570c8def74 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    97
        ns := Smalltalk at:nsName asSymbol.
0d570c8def74 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    98
        ns isNil ifTrue:[
0d570c8def74 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    99
            ns := NameSpace name:nsName
0d570c8def74 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   100
        ]
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   101
    ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   102
    (meta := (className endsWith:' class')) ifTrue:[    
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   103
        className := className copyWithoutLast:6.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   104
    ].
2094
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
   105
2520
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   106
    ns := (ns ? Smalltalk).
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   107
    class := ns isNameSpace 
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   108
                ifTrue:[ ns loadedClassNamed:className ]
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   109
                ifFalse:[ Smalltalk loadedClassNamed:className ].     
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   110
    class isNil ifTrue:[
1905
51e766803c45 avoid endless recursion, if change is for a namespace definition.
boris
parents: 1903
diff changeset
   111
        self isPrivateClassDefinitionChange ifTrue:[
2612
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   112
            ns isNameSpace ifTrue:[
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   113
                owner := ns loadedClassNamed:(self owningClassName).
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   114
            ] ifFalse:[
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   115
                owner := Smalltalk loadedClassNamed:(self owningClassName).
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   116
            ].
1905
51e766803c45 avoid endless recursion, if change is for a namespace definition.
boris
parents: 1903
diff changeset
   117
            owner notNil ifTrue:[
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   118
                class := owner privateClassesAt:className.
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   119
                ^ meta ifTrue:[class theMetaclass] ifFalse:[class].
1905
51e766803c45 avoid endless recursion, if change is for a namespace definition.
boris
parents: 1903
diff changeset
   120
            ].
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   121
        ] ifFalse:[
2520
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   122
            class := ns isNameSpace 
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   123
                        ifTrue:[ ns classNamed:className ]
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   124
                        ifFalse:[ Smalltalk loadedClassNamed:className ].     
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   125
2057
7324483675da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2040
diff changeset
   126
            "/ class := Parser evaluate:className ifFail:[nil].
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   127
            class isNil ifTrue:[
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   128
                (altName := self classNameForWellKnownVisualWorksNamespaceClass:className) notNil
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   129
                ifTrue:[
2520
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   130
                    class := ns isNameSpace 
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   131
                                ifTrue:[ ns classNamed:altName ]
092b3abcd994 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   132
                                ifFalse:[ Smalltalk loadedClassNamed:altName ].     
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   133
                    class isNil ifTrue:[
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   134
                        class := Parser evaluate:altName ifFail:[nil]
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   135
                    ]
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   136
                ].
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   137
            ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   138
        ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   139
        class isNil ifTrue:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   140
            ns ~= Smalltalk ifTrue:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   141
                self isPrivateClassDefinitionChange ifTrue:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   142
                    owner := Smalltalk loadedClassNamed:(self owningClassName).
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   143
                    owner notNil ifTrue:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   144
                        class := owner privateClassesAt:className.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   145
                        ^ meta ifTrue:[class theMetaclass] ifFalse:[class].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   146
                    ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   147
                ] ifFalse:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   148
                    class := Smalltalk classNamed:className.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   149
                    "/ class := Parser evaluate:className ifFail:[nil].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   150
                    class isNil ifTrue:[
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   151
                        ^ nil.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   152
                    ].
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   153
                ].
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   154
            ].
2521
8b8890f94458 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
   155
            class isNil ifTrue:[^ nil].
1870
55f67b913779 +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   156
        ].
55f67b913779 +owner access and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   157
    ].
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   158
1855
0c365a83ffc2 care for class name aliases when getting an existing
Claus Gittinger <cg@exept.de>
parents: 1513
diff changeset
   159
    "/ care for aliases...
2521
8b8890f94458 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
   160
    "/ (class nameWithoutPrefix ~= className) ifTrue:[ ^ nil ].
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   161
    ^ meta ifTrue:[class theMetaclass] ifFalse:[class].
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   162
2612
be94644aae8c changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
   163
    "Modified: / 24-11-2011 / 15:17:55 / cg"
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   164
!
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
   165
1040
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   166
changeClass:aClass
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   167
    "set the class of the change"
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   168
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   169
    className := aClass name.
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   170
!
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   171
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   172
class:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   173
    "set the class of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   174
1903
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
   175
    self className:aClass name.
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   176
1903
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
   177
    "Created: / 03-12-1995 / 14:01:45 / cg"
fc7a6b27312e changed #class:
Claus Gittinger <cg@exept.de>
parents: 1897
diff changeset
   178
    "Modified: / 12-11-2006 / 20:10:28 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   179
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   180
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   181
class:aClass source:newSource
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   182
    "set both class and source of the change"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   183
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   184
    self className:(aClass name) source:newSource
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   185
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   186
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   187
classBaseName 
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   188
    "return the className of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   189
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   190
    ^ self cutNameSpaceOf:className
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   191
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   192
    "Modified: 15.7.1996 / 09:28:35 / cg"
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   193
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   194
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   195
className:aString 
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   196
    "set the className of the change"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   197
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   198
    className := aString
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   199
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   200
    "Modified: / 15.7.1996 / 09:28:35 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   201
    "Created: / 16.2.1998 / 13:05:36 / cg"
1233
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   202
!
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   203
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   204
className:newClassName source:newSource
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   205
    "set both className and source of the change"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   206
1469
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   207
    self assert:(newSource isString).
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   208
    self assert:(newClassName isString).
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   209
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   210
    className := newClassName.
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   211
    source := newSource.
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   212
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   213
    "Created: 3.12.1995 / 14:01:45 / cg"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   214
    "Modified: 15.7.1996 / 09:28:26 / cg"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   215
!
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   216
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   217
classNameForWellKnownVisualWorksNamespaceClass:className
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   218
    (className startsWith:'Root::') ifTrue:[
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   219
        ^ className copyFrom:7.
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   220
    ].
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   221
    (className startsWith:'Core.') ifTrue:[
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   222
        ^ className copyFrom:6.
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   223
    ].
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   224
    (className startsWith:'Smalltalk.') ifTrue:[
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   225
        ^ className copyFrom:11.
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   226
    ].
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   227
    ^ nil
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   228
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   229
    "Created: / 29-01-2011 / 11:29:59 / cg"
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   230
!
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   231
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   232
classNameWithoutNamespace
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   233
    "return the className of the change"
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   234
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   235
    ^ self cutNameSpaceOf:className
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   236
2555
86df1e00019f comment/format in: #classNameWithoutNamespace
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   237
    "Modified: / 06-10-2011 / 16:58:34 / cg"
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   238
!
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   239
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   240
nameSpaceOverride
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   241
    |ns|
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   242
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   243
    nameSpaceOverride notNil ifTrue:[^ nameSpaceOverride].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   244
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   245
    ns := Class nameSpaceQuerySignal query.
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   246
    ns == Smalltalk ifTrue:[^ nil].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   247
    ^ ns name
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   248
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   249
    "Created: / 07-09-2011 / 20:45:43 / cg"
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   250
!
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   251
2815
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   252
nameSpaceOverride:aNamespace
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   253
    nameSpaceOverride := aNamespace
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   254
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   255
    "Created: / 20-03-2012 / 17:12:08 / cg"
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   256
!
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   257
2169
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   258
nonMetaClassName
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   259
    ^ self isForMeta
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   260
	ifTrue:[ self className copyTo:(self className size - 6) ]
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   261
	ifFalse:[ self className ]
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   262
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   263
    "Created: / 06-11-2008 / 17:26:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   264
!
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   265
1233
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   266
package
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   267
    "return the value of the instance variable 'package' (automatically generated)"
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   268
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   269
    ^ package
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   270
!
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   271
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   272
package:something
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   273
    "set the value of the instance variable 'package' (automatically generated)"
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   274
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   275
    package := something.
0
470788421600 Initial revision
claus
parents:
diff changeset
   276
! !
470788421600 Initial revision
claus
parents:
diff changeset
   277
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   278
!ClassChange methodsFor:'applying'!
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   279
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   280
apply
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   281
    "apply the change"
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   282
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   283
    |class|
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   284
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   285
    class := self changeClass.
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   286
    class isNil ifTrue:[
2078
e749382ae30a allow proceed
Claus Gittinger <cg@exept.de>
parents: 2057
diff changeset
   287
        self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
e749382ae30a allow proceed
Claus Gittinger <cg@exept.de>
parents: 2057
diff changeset
   288
        ^ self
2019
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   289
    ].
685031a55645 changed #apply: load class before applying a change
Stefan Vogel <sv@exept.de>
parents: 1905
diff changeset
   290
    class autoload.         "Most changes cannot be applied to unloaded classes"
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   291
    Class nameSpaceQuerySignal answer:self nameSpace do:[
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   292
        Parser evaluate:(self source)
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   293
    ].
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   294
"/    |ns|
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   295
"/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   296
"/    ns := Class nameSpaceQuerySignal isHandled 
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   297
"/            ifTrue:[ Class nameSpaceQuerySignal query ]
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   298
"/            ifFalse:[ self nameSpace ].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   299
"/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   300
"/    Class nameSpaceQuerySignal answer:ns do:[
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   301
"/        Parser evaluate:(self source)
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   302
"/    ].
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   303
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   304
    "Modified: / 29-01-2011 / 12:28:03 / cg"
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   305
!
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   306
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   307
className
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   308
    |ns|
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   309
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   310
    "/ used to be ^ className;
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   311
    "/
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   312
    "/ now include a translation from vw namespace to stx nameSpace
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   313
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   314
    ns := self nameSpaceName.
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   315
    (ns isNil or:[ns = 'Smalltalk']) ifTrue:[^ className].
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   316
    ^ ns , '::' , (self classNameWithoutNamespace)
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   317
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   318
    "Modified: / 29-01-2011 / 11:33:26 / cg"
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   319
!
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   320
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   321
fullClassName
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   322
    |ns|
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   323
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   324
    "/ used to be ^ className;
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   325
    "/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   326
    "/ now include a translation from vw namespace to stx nameSpace
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   327
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   328
    ns := self nameSpaceName.
1304
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   329
    (ns isNil or:[ns = 'Smalltalk']) ifTrue:[^ self className].
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   330
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   331
    ^ ns , '::' , self className
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   332
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   333
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   334
nameSpace
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   335
    |nsName nameSpace|
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   336
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   337
    (nsName := self nameSpaceName) notNil ifTrue:[
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   338
        ^ NameSpace name:nsName.
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   339
    ].
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   340
    ^ Smalltalk
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   341
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   342
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   343
nameSpaceName
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   344
    |ns cnm idx|
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   345
1513
12441a3e4504 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   346
    className isNil ifTrue:[^ nil].
12441a3e4504 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   347
2094
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
   348
    (idx := className indexOf:$:) ~~ 0 ifTrue:[
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   349
        "/ in a namespace
2094
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
   350
        ^ className copyTo:(idx - 1).
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   351
    ].
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   352
    (idx := className indexOf:$.) ~~ 0 ifTrue:[
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   353
        "/ in a namespace
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   354
        ns := className copyTo:(idx - 1).
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   355
        cnm := className copyFrom:(idx + 1).
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   356
        "cheat: VW namespaces"
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   357
        ^ self nameSpaceForVWNamespace:ns class:cnm ifAbsent:ns
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   358
    ].
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   359
    ^ nil
1513
12441a3e4504 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   360
12441a3e4504 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   361
    "Modified: / 03-08-2006 / 02:04:03 / cg"
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   362
! !
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   363
962
3821ab69b939 category change
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   364
!ClassChange methodsFor:'printing & storing'!
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   365
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   366
printOn:aStream
801
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   367
    "append a user printed representation of the receiver to aStream.
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   368
     The format is suitable for a human - not meant to be read back."
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   369
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   370
    source isNil ifTrue:[
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   371
        aStream nextPutAll:'an empty change'.
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   372
        ^ self
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   373
    ].
1469
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   374
    aStream nextPutAll:(self class name , ' - ' , source string firstLine , '...').
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   375
! !
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   376
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   377
!ClassChange methodsFor:'queries'!
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   378
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   379
cutMyNameSpaceOf:aString
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   380
    |ns|
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   381
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   382
    aString isNil ifTrue:[ ^ aString ].
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   383
    (ns := self nameSpaceOverride) isNil ifTrue:[ ^ aString ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   384
    (aString startsWith:(ns , '.')) ifTrue:[ ^ self cutNameSpaceOf:aString ].
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   385
    (aString startsWith:(ns , '::')) ifTrue:[ ^ self cutNameSpaceOf:aString ].
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   386
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   387
    ^ aString
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   388
2514
36e11e387006 handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2315
diff changeset
   389
    "Modified: / 07-09-2011 / 20:49:33 / cg"
2315
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   390
!
dde09d0ab7bf class definition
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
   391
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   392
cutNameSpaceOf:aString
1304
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   393
    |dotIndex colonIndex|
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   394
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   395
    aString isNil ifTrue:[ ^ nil].
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   396
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   397
    dotIndex := aString indexOf:$..
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   398
    dotIndex ~~ 0 ifTrue:[
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   399
        ^ aString copyFrom:dotIndex+1
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   400
    ].
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   401
    colonIndex := aString indexOf:$:.
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   402
    colonIndex ~~ 0 ifTrue:[
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   403
        ^ aString copyFrom:colonIndex+2
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   404
    ].
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   405
    ^ aString
2314
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   406
ba70ddd96c9e added: #classNameForWellKnownVisualWorksNamespaceClass:
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
   407
    "Modified: / 29-01-2011 / 11:32:01 / cg"
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   408
!
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   409
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   410
isClassChange
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   411
    ^ true
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   412
!
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   413
2169
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   414
isForMeta
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   415
    ^ (self className endsWith:' class')
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   416
!
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
   417
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   418
nameSpaceForVWNamespace:ns class:className ifAbsent:default
2094
09ded92b1604 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2083
diff changeset
   419
    "map the namespace for a given class - hack; only works for some"
1303
36df29ea195d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
   420
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   421
    ns = 'Core' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   422
    ns = 'Kernel' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   423
    ns = 'Graphics' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   424
    ns = 'OS' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   425
    ns = 'Smalltalk' ifTrue:[^ 'Smalltalk'].
1303
36df29ea195d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
   426
    ns = 'UI' ifTrue:[^ 'Smalltalk'].
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   427
    ^ default value
2057
7324483675da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2040
diff changeset
   428
!
7324483675da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2040
diff changeset
   429
7324483675da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2040
diff changeset
   430
owningClassName
7324483675da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2040
diff changeset
   431
    self shouldImplement
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   432
! !
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   433
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   434
!ClassChange class methodsFor:'documentation'!
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   435
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   436
version
2815
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   437
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassChange.st,v 1.65 2012-03-20 18:19:01 cg Exp $'
2245
335416c1cd10 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2169
diff changeset
   438
!
335416c1cd10 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2169
diff changeset
   439
335416c1cd10 changed: #changeClass
Claus Gittinger <cg@exept.de>
parents: 2169
diff changeset
   440
version_CVS
2815
a87f6217b606 added: #nameSpaceOverride:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   441
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassChange.st,v 1.65 2012-03-20 18:19:01 cg Exp $'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   442
! !