Class.st
author Stefan Vogel <sv@exept.de>
Thu, 16 Apr 2020 16:54:50 +0200
changeset 25361 4ea026855e31
parent 25288 d308ef18be52
permissions -rw-r--r--
#TUNING by stefan class: UnixOperatingSystem class changed: #fork #getProcessId cache my own pid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     1
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
     3
	       All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
5340
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    12
"{ Package: 'stx:libbasic' }"
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    13
17403
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
    14
"{ NameSpace: Smalltalk }"
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
    15
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    16
ClassDescription subclass:#Class
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    17
	instanceVariableNames:'name category classvars comment subclasses classFilename package
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    18
		revision environment signature attributes'
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    19
	classVariableNames:'DefaultCategoryForDolphin DefaultCategoryForSTV
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
    20
		DefaultCategoryForUncategorizedClasses
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    21
		DefaultCategoryForUndeclaredClasses DefaultCategoryForVAGE
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    22
		SubclassCacheSequenceNumber ValidateSourceOnlyOnce
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    23
		ValidatedClasses'
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    24
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    25
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    26
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    27
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    28
Array variableSubclass:#ArrayWithSequenceNumberValidation
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    29
	instanceVariableNames:'sequenceNumber'
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    30
	classVariableNames:''
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    31
	poolDictionaries:''
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    32
	privateIn:Class
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    33
!
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
    34
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    35
Object subclass:#ClassAttributes
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    36
	instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions
14579
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
    37
		sharedPools traitComposition localSelectors vGuid fGuid
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
    38
		projectDirectory'
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    39
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    40
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    41
	privateIn:Class
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    42
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    43
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    44
Object subclass:#SimulatedClassPool
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    45
	instanceVariableNames:'class'
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    46
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    47
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    48
	privateIn:Class
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    49
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    50
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    51
Association subclass:#SimulatedVariableBinding
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    52
	instanceVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    53
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    54
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    55
	privateIn:Class::SimulatedClassPool
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    56
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    57
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    58
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    59
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    60
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    61
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    62
 COPYRIGHT (c) 1989 by Claus Gittinger
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
    63
	       All Rights Reserved
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    64
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    65
 This software is furnished under a license and may be used
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    66
 only in accordance with the terms of that license and with the
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    67
 inclusion of the above copyright notice.   This software may not
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    68
 be provided or otherwise made available to, or used by, any
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    69
 other person.  No title to or ownership of the software is
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    70
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    71
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    72
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    73
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    74
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    75
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    76
    Class adds more functionality to classes; minimum stuff has already
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    77
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    78
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    79
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    80
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    81
        name            <Symbol>                    the classes name
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    82
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    83
        category        <Symbol>                    the classes category
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    84
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    85
        classvars       <String>                    the names of the class variables;
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    86
                        | <Collection of words>     initially, stc generates a string; this is converted on the fly
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    87
                                                    to an array of names. In the future, stc may be changed.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    88
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    89
        comment         <String>                    the classes comment; either a string,
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    90
                                                    a number specifying the offset in classFilename, or nil
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    91
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    92
        subclasses      <Collection>                cached collection of subclasses
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    93
                                                    (not used for execution, but for the IDE to speed up certain operations)
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    94
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    95
        classFilename   <String>                    the file (or nil) where the classes' sources are found
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    96
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    97
        package         <Symbol>                    the package, in which the class was defined (inserted by compilers)
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    98
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
    99
        revision        <String>                    revision string - inserted by stc
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   100
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   101
        environment     <Symbol | nil>              cached environment (i.e. Smalltalk or a namespace)
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   102
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   103
        signature       <SmallInteger>              the classes signature (used to detect obsolete or changed classes with binaryStorage)
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   104
                                                    This is filled in lazy - i.e. upon the first signature query.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   105
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   106
        attributes   <Array | nil>                  describes primitiveIncludes, primitiveFunctions etc.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   107
                                                    also a place to add additional attributes, without a need to recompile all classes.
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   108
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   109
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   110
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   111
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   112
    [note:]
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   113
        the subclasses instvar keeps a cached collection of the known subclasses in the system.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   114
        this cache is lazyly flushed when a SubclassCacheSequenceNumber comparison detects a mismatch.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   115
        (this seqNr is incremented, whenever something in any class hierarchy changes).
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   116
        This is a q&d mechanism to allow for no-overhead fileIn and package loading,
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   117
        and reasonable speedup in the hierarchy walkers (i.e. the browsers).
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   118
        (flushing all is obviously too much flushing, and we could do better in many situations)
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   119
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   120
    [author:]
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   121
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   122
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   123
    [see also:]
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   124
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   125
"
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   126
!
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   127
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   128
versionManagement
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   129
"
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   130
    old scheme (up to 5.4.x):
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   131
	the #version method is supposed to return a CVS (or RCS) version string.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   132
	this string contains (among other info) the revision number of the CVS container
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   133
	from which the class was compiled.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   134
	To access the source code of a class, this file is reconstructed (either cached or
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   135
	checked out), and the source-chunk is fetched from that file at the position which
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   136
	is stored in the method object.
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   137
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   138
    new scheme (starting with 5.5.0):
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   139
	a classes sourcecode might be present in multiple source code management systems;
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   140
	for example, a site might decide to use CVS, where another might wonna use SVN
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   141
	(or other in the future).
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   142
	Therefore, a single version method is no longer sufficient; each sourceCodeManager
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   143
	will store its version info in its own format in a separate version method.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   144
	The sourceCodeManager can be asked via #nameOfVersionMethodInClasses for the selector
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   145
	of this version.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   146
	Currently these are #version_CVS and #version_SVN. More might be added in the future.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   147
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   148
	Two additional identifiers are added to support a unique id, which can be used to
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   149
	compare classes and methods coming from different source containers:
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   150
	    version_VID and version_FID
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   151
	Both are UUID's. The VID is updated with every change, whereas the FID is assigned only once.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   152
	The FID can be interpreted as a functional-ID, and the VID as an identity id.
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   153
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   154
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   155
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
   156
!Class class methodsFor:'accessing-flags'!
362
claus
parents: 360
diff changeset
   157
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   158
tryLocalSourceFirst
11952
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   159
    "if true, local source files are tried first, before a sourceCodemanager is
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   160
     consulted. This may speed up the source access, but adds some insecurity, because
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   161
     the sourceCodemanager is always getting the source for the classes correct version.
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   162
     In contrast, the local file might be different from (edited in an external tool) in
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   163
     the meantime. You have been warned - better leave it false (the sourceCodemanager will
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   164
     fill its cache and eventually be just as fast...)"
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   165
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   166
    "JV: When smalltalk is not yet initialized, do use local sources
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   167
         because before that, SCM support may not be loaded and configured
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   168
         properly, leading to funny errors."
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   169
    ^ Smalltalk isInitialized not or:[TryLocalSourceFirst == true].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   170
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   171
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   172
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   173
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   174
tryLocalSourceFirst:aBoolean
11952
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   175
    "if true, local source files are tried first, before a sourceCodemanager is
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   176
     consulted. This may speed up the source access, but adds some insecurity, because
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   177
     the sourceCodemanager is always getting the source for the classes correct version.
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   178
     In contrast, the local file might be different from (edited in an external tool) in
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   179
     the meantime. You have been warned - better leave it false (the sourceCodemanager will
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   180
     fill its cache and eventually be just as fast...)"
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   181
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   182
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   183
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   184
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   185
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   186
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   187
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   188
    "turn on/off changes management. Return the prior value of the flag.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   189
     This value is used as a default fallback - a querySignal handler may still
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   190
     decide to return something else."
362
claus
parents: 360
diff changeset
   191
claus
parents: 360
diff changeset
   192
    |prev|
claus
parents: 360
diff changeset
   193
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   194
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   195
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   196
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   197
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   198
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   199
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   200
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   201
     The value returned here is the default fallback - a querySignal handler may still
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   202
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   204
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   205
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   206
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   207
!Class class methodsFor:'creating new classes'!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   208
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   209
name:newName
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   210
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   211
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   212
    ^ self
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   213
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   214
        subclassOf:Object
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   215
        instanceVariableNames:''
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   216
        category:(self defaultCategoryForUncategorizedClasses)
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   217
!
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   218
16049
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   219
name:newName instanceVariableNames:stringOfInstVarNames
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   220
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   221
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   222
    ^ self
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   223
        name:newName
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   224
        subclassOf:Object
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   225
        instanceVariableNames:stringOfInstVarNames
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   226
        category:(self defaultCategoryForUncategorizedClasses)
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   227
!
5485d20a09fe class: Class
Claus Gittinger <cg@exept.de>
parents: 16043
diff changeset
   228
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   229
name:newName subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   230
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   231
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   232
    ^ self
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   233
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   234
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   235
        instanceVariableNames:''
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   236
        category:(self defaultCategoryForUncategorizedClasses)
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   237
!
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   238
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   239
name:newName subclassOf:aClass instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   240
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   241
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   242
    ^ self
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   243
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   244
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   245
        instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   246
        category:(self defaultCategoryForUncategorizedClasses)
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   247
!
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   248
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   249
name:newName subclassOf:aClass instanceVariableNames:stringOfInstVarNames category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   250
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   251
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   252
    ^ self
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   253
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   254
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   255
        instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   256
        classVariableNames:nil
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   257
        poolDictionaries:nil
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   258
        category:categoryString
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   259
!
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   260
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   261
name:newName
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   262
         subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   263
         instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   264
         classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   265
         category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   266
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   267
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   268
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   269
    ^ self
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   270
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   271
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   272
        instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   273
        classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   274
        poolDictionaries:nil
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   275
        category:categoryString
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   276
!
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   277
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   278
name:newName
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   279
         subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   280
         instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   281
         classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   282
         classInstanceVariableNames:stringOfClassInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   283
         poolDictionaries:stringOfPoolNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   284
         category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   285
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   286
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   287
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   288
    ^ self class
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   289
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   290
        inEnvironment:Smalltalk
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   291
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   292
        instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   293
        variable:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   294
        words:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   295
        pointers:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   296
        classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   297
        poolDictionaries:stringOfPoolNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   298
        category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   299
        comment:nil
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   300
        changed:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   301
        classInstanceVariableNames:stringOfClassInstVarNames
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   302
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   303
    "Modified: 16.6.1997 / 11:53:58 / cg"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   304
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   305
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   306
name:newName
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   307
         subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   308
         instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   309
         classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   310
         poolDictionaries:stringOfPoolNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   311
         category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   312
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   313
    "this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   314
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   315
    ^ self class
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   316
        name:newName
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   317
        inEnvironment:Smalltalk
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   318
        subclassOf:aClass
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   319
        instanceVariableNames:stringOfInstVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   320
        variable:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   321
        words:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   322
        pointers:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   323
        classVariableNames:stringOfClassVarNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   324
        poolDictionaries:stringOfPoolNames
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   325
        category:categoryString
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   326
        comment:nil
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   327
        changed:false
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   328
        classInstanceVariableNames:nil
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   329
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   330
    "Modified: 16.6.1997 / 11:53:58 / cg"
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   331
!
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   332
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   333
undeclared: name
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   334
    "Creates an 'undeclared' class, a placeholder for
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   335
     superclass when loading/filing-in a class whose
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   336
     superclass does not exist yet."
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   337
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   338
    Transcript showCR:'Smalltalk [info]: Declaring undeclared class: ', name.
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   339
    ^ Object 
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   340
        subclass: name asSymbol
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   341
        instanceVariableNames:''
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   342
        classVariableNames:''
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   343
        poolDictionaries:''
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   344
        category:(self defaultCategoryForUndeclaredClasses)
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   345
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   346
    "Created: / 08-11-2010 / 16:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   347
! !
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   348
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   349
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   350
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   351
nameWithoutPrefix:name
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   352
    "helper for fileOut and others - return a name's printString,
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   353
     without any owningClass or nameSpace prefix"
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   354
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   355
    |idx|
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   356
14235
810d699d6963 changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents: 14228
diff changeset
   357
    name isNil ifTrue:[^ nil].
810d699d6963 changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents: 14228
diff changeset
   358
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   359
    idx := name lastIndexOf:$:.
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   360
    [idx > 1 and:[ (name at:(idx-1)) ~~ $: ]] whileTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   361
	idx := name lastIndexOf:$: startingAt:idx-2.
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   362
    ].
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   363
    idx == 0 ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   364
	^ name
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   365
    ].
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   366
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   367
    ^ name copyFrom:idx+1.
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   368
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   369
    "a public class:
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   370
     Class nameWithoutPrefix:'Array'
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   371
     Class nameWithoutPrefix:'Tools::Array'
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   372
    "
14235
810d699d6963 changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents: 14228
diff changeset
   373
810d699d6963 changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents: 14228
diff changeset
   374
    "Modified: / 13-06-2012 / 14:41:21 / cg"
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   375
!
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   376
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   377
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   378
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   379
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   380
    "return a revision info, given a string.
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   381
     This extracts the relevant info from aString, asking
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   382
     the default sourceCode manager (if there is one).
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   383
     Notice, that this method is only invoked, if a class does not know
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   384
     its sourceCode manager."
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   385
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   386
    |mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   387
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   388
    "/
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   389
    "/ mhmh - ask the default manager.
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   390
    "/ if none has been defined, use the CVSSourceCodeManager
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   391
    "/
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   392
    mgr := SourceCodeManager ? CVSSourceCodeManager.
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   393
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   394
    "/ care for standAlone apps which have no CVS (libbasic3) included
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   395
    "/
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   396
    mgr isNil ifTrue:[
20991
fad7b4f21cbb #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20784
diff changeset
   397
        AbstractSourceCodeManager notNil ifTrue:[
fad7b4f21cbb #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20784
diff changeset
   398
            ^ AbstractSourceCodeManager revisionInfoFromRCSString:aString
fad7b4f21cbb #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20784
diff changeset
   399
        ].
fad7b4f21cbb #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20784
diff changeset
   400
        ^ nil
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   401
    ].
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   402
    ^ mgr revisionInfoFromString:aString.
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   403
13759
60d609b1d5fb changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents: 13756
diff changeset
   404
    "Modified: / 29-09-2011 / 21:53:29 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   405
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   406
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   407
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   408
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   409
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   410
    "extract a revision string from a method's source string.
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   411
     Caveat: Assumes CVS."
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   412
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   413
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   414
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   415
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   416
    lines do:[:l |
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   417
        |i|
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   418
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   419
        i := l indexOfSubCollection:'$Header: '.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   420
        "JV @ 2009-12-13: Also search for '$Id: ' (because of SVN-only classes)"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   421
        i == 0 ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   422
        i := l indexOfSubCollection:'$Id: '].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   423
        "JV @ 2013-07-18: Also search for '$Changeset: ' (because of Mercurial-only classes)"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   424
        i == 0 ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   425
        i := l indexOfSubCollection:'$Changeset: '].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   426
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   427
        i ~~ 0 ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   428
            line := l copyFrom:i.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   429
            i := line lastIndexOf:$$.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   430
            i > 1 ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   431
                line := line copyTo:i.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   432
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   433
            ^ line
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   434
        ]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   435
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   436
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   437
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   438
    "Created: / 15-10-1996 / 18:57:57 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   439
    "Modified: / 22-10-2008 / 20:29:50 / cg"
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
   440
    "Modified: / 19-07-2013 / 23:32:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   441
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   442
3618
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   443
!Class class methodsFor:'misc'!
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   444
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   445
template:aCategoryString
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   446
    "return a class-definition template"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   447
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   448
    ^ 'NameOfSuperclass subclass:#NameOfClass
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   449
    instanceVariableNames:''instVarName1 instVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   450
    classVariableNames:''classVarName1 classVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   451
    poolDictionaries:''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   452
    category:''' , aCategoryString , ''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   453
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   454
    "Created: / 19.6.1998 / 02:09:06 / cg"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   455
! !
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   456
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   457
!Class class methodsFor:'private'!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   458
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   459
flushSubclassInfo
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   460
    "throw away (forget) the cached subclass information, 
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   461
     as created by #subclassInfo.
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   462
     This is private protocol"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   463
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
   464
    SubclassCacheSequenceNumber := (SubclassCacheSequenceNumber ? 0) + 1.
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
   465
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
   466
"/    self allSubInstancesDo:[:cls |
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
   467
"/        cls flushSubclasses
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
   468
"/    ].
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   469
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   470
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   471
     Class flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   472
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   473
13861
9630807c9d21 subclassinfo
Claus Gittinger <cg@exept.de>
parents: 13860
diff changeset
   474
    "Modified: / 06-12-2011 / 16:20:13 / cg"
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   475
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   476
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   477
flushSubclassInfoFor:aClass
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   478
    "throw away (forget) the cached subclass information for aClass, 
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   479
     as created by #subclassInfo.
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   480
     This is private protocol"
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   481
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   482
    aClass notNil ifTrue:[
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   483
        aClass flushSubclasses
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   484
    ].
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   485
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   486
    "
12694
6a2c27a17e14 comment
Claus Gittinger <cg@exept.de>
parents: 12689
diff changeset
   487
     Class flushSubclassInfoFor:View
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   488
    "
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   489
13861
9630807c9d21 subclassinfo
Claus Gittinger <cg@exept.de>
parents: 13860
diff changeset
   490
    "Modified: / 06-12-2011 / 16:20:49 / cg"
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   491
! !
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   492
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   493
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   494
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   495
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   496
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   497
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   498
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
   499
    ^ self == (Class class) or:[self == Class]
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   500
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   501
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   502
    "Modified: 23.4.1996 / 15:56:58 / cg"
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   503
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   504
19119
3b1a284174e7 #DOCUMENTATION
mawalch
parents: 19109
diff changeset
   505
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   506
!Class methodsFor:'Compatibility-Dolphin'!
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   507
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   508
defaultCategoryForDolphinClasses
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   509
    "used only when filing in Dolphin classes (which do not provide a category in their inst creation message)"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   510
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   511
    ^ DefaultCategoryForDolphin ? 'Dolphin classes'.
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   512
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   513
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   514
guid
13716
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
   515
    ^ self getAttribute:#fGuid
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   516
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   517
    "Created: / 23-09-2011 / 10:24:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   518
!
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   519
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   520
guid:aUUID
13716
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
   521
    ^ self setAttribute:#fGuid to:aUUID
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   522
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   523
    "Created: / 23-09-2011 / 10:25:04 / cg"
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   524
!
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
   525
11162
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   526
stb_version
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   527
    ^ 0
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   528
!
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   529
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   530
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   531
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   532
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   533
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   534
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   535
    ^ self subclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   536
	   instanceVariableNames:f
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   537
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   538
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   539
	   category:(self defaultCategoryForDolphinClasses)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   540
	   classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   541
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   542
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   543
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   544
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   545
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   546
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   547
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   548
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   549
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   550
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   551
    ^ self variableSubclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   552
	   instanceVariableNames:f
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   553
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   554
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   555
	   category:(self defaultCategoryForDolphinClasses)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   556
	   classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   557
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   558
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   559
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   560
! !
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   561
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   562
!Class methodsFor:'Compatibility-ST/V and V''Age'!
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   563
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   564
defaultCategoryForSTVorVAGEClasses
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   565
    "used only when filing in ST/V and V'Age classes (which do not provide a category in their inst creation message)"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   566
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   567
    |cat app|
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   568
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   569
    DefaultApplicationQuerySignal isHandled ifTrue:[
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   570
        "/ while loading a package, this is answered...
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   571
        "/ put the new class into a category named after the app
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   572
        app := DefaultApplicationQuerySignal query.
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   573
        app notNil ifTrue:[
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   574
            cat := "'Applications-' ," app nameWithoutPrefix.
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   575
        ] ifFalse:[
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   576
            cat := DefaultCategoryForVAGE ? 'V''Age classes'.
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   577
        ].
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   578
    ] ifFalse:[
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
   579
        cat := DefaultCategoryForSTV ? 'ST/V classes'.
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   580
    ].
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   581
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   582
    ^ cat
14000
1b4fbb92d572 changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents: 13999
diff changeset
   583
1b4fbb92d572 changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents: 13999
diff changeset
   584
    "Modified: / 07-02-2012 / 17:40:35 / cg"
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   585
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   586
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   587
subclass:nm classInstanceVariableNames:cIV instanceVariableNames:iV classVariableNames:cV poolDictionaries:p
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   588
    "{ Pragma: +optSpace }"
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   589
14679
83d82683fb50 class: Class
Claus Gittinger <cg@exept.de>
parents: 14619
diff changeset
   590
    "this method allows fileIn of ST/V and V'Age classes"
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   591
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   592
    ^ self
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   593
	   subclass:nm
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   594
	   instanceVariableNames:iV
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   595
	   classVariableNames:cV
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   596
	   poolDictionaries:p
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   597
	   category:(self defaultCategoryForSTVorVAGEClasses)
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
   598
	   classInstanceVariableNames:cIV
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   599
!
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   600
24595
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   601
subclass:nm instanceVariableNames:iV classVariableNames:cV poolDictionaries:pD
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   602
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   603
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   604
    "this method allows fileIn of ST/V and V'Age classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   605
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   606
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   607
    ^ self
24595
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   608
           subclass:nm
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   609
           instanceVariableNames:iV
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   610
           classVariableNames:cV
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   611
           poolDictionaries:pD
43db2cd7858b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24374
diff changeset
   612
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   613
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   614
    "Modified: / 15.6.1998 / 21:31:34 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   615
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   616
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   617
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   618
variableByteSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   619
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   620
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   621
    "this method allows fileIn of ST/V and V'Age variable byte classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   622
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   623
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   624
    ^ self variableByteSubclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   625
	   instanceVariableNames:''
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   626
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   627
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   628
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   629
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   630
    "Modified: / 15.6.1998 / 21:31:38 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   631
    "Modified: / 18.3.1999 / 18:16:21 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   632
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   633
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   634
variableLongSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   635
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   636
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   637
    "this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   638
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   639
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   640
    ^ self variableLongSubclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   641
	   instanceVariableNames:''
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   642
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   643
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   644
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   645
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   646
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   647
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   648
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   649
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   650
    "this method allows fileIn of ST/V and V'Age variable pointer classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   651
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   652
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   653
    ^ self variableSubclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   654
	   instanceVariableNames:f
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   655
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   656
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   657
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   658
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   659
    "Modified: / 15.6.1998 / 21:31:41 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   660
    "Modified: / 18.3.1999 / 18:16:33 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   661
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   662
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   663
variableWordSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   664
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   665
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   666
    "this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   667
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   668
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   669
    ^ self variableWordSubclass:t
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   670
	   instanceVariableNames:''
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   671
	   classVariableNames:d
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   672
	   poolDictionaries:s
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   673
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   674
! !
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   675
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   676
!Class methodsFor:'Compatibility-ST80'!
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   677
14929
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   678
classPool
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   679
    "return something which allows access to my classVariables via
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   680
     #at: and #at:put: messages."
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   681
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   682
    ^ SimulatedClassPool new setClass:self
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   683
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   684
    "
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   685
     Button classPool
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   686
    "
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   687
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   688
    "Modified: 17.10.1997 / 12:12:14 / cg"
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   689
!
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
   690
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   691
fileOutSourceOn:aStream
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   692
    self fileOutOn:aStream withTimeStamp:false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   693
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   694
    "Created: 20.6.1997 / 17:18:14 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   695
    "Modified: 20.6.1997 / 17:18:26 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   696
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   697
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   698
rename:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   699
    "same as renameTo: - for ST80 compatibility"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   700
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   701
    ^ Smalltalk renameClass:self to:newName.
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   702
"/    ^ self renameTo:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   703
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   704
    "Created: / 18.6.1998 / 22:08:45 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   705
! !
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   706
17255
195c4cc07ee9 class: Class
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
   707
!Class methodsFor:'Compatibility-Squeak'!
195c4cc07ee9 class: Class
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
   708
22026
ec5d6fa4fb2c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21981
diff changeset
   709
classComment:comment stamp:commentStamp
ec5d6fa4fb2c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21981
diff changeset
   710
    self comment:comment
ec5d6fa4fb2c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21981
diff changeset
   711
!
ec5d6fa4fb2c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21981
diff changeset
   712
19641
1c3f10941516 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19166
diff changeset
   713
commentStamp:stampString prior:priorVersion
1c3f10941516 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19166
diff changeset
   714
    ^ SqueakCommentReader new
1c3f10941516 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19166
diff changeset
   715
        class:self stamp:stampString priorVersion:priorVersion
17255
195c4cc07ee9 class: Class
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
   716
! !
17252
37c4a7debbae class: Class
Claus Gittinger <cg@exept.de>
parents: 17161
diff changeset
   717
22035
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   718
!Class methodsFor:'Compatibility-VW'!
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   719
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   720
defineSharedVariable:name private:private constant:constant category:category initializer:initializer 
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   721
    self addClassVarName:name.
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   722
    initializer notNil ifTrue:[
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   723
        self shouldImplement
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   724
    ].
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   725
!
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   726
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   727
defineStatic:name private:private constant:constant category:category initializer:initializer attributes:annotations
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   728
    self addClassVarName:name.
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   729
    initializer notNil ifTrue:[
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   730
	self shouldImplement
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   731
    ].
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   732
! !
e5f116a882a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22026
diff changeset
   733
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   734
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   735
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   736
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   737
    "add a class variable if not already there and initialize it with nil.
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   738
     Also writes a change record and notifies dependents."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   739
13209
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   740
    self addClassVarNames:(Array with:aString).
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   741
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   742
    "Created: / 29-10-1995 / 19:40:51 / cg"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   743
    "Modified: / 23-01-1998 / 15:46:23 / stefan"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   744
    "Modified: / 15-01-2011 / 14:17:41 / cg"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   745
!
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   746
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   747
addClassVarNames:aCollectionOfStrings
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   748
    "add a number of class variables if not already there and initialize them with nil.
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   749
     Also writes a change record and notifies dependents."
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   750
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   751
    |newVariables|
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   752
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   753
    newVariables := aCollectionOfStrings reject:[:each | self classVarNames includes:each].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   754
    newVariables isEmpty ifTrue:[^ self].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   755
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   756
    newVariables := newVariables collect:[:each | each asSymbol].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   757
    self classVariableString:(self classVariableString , ' ' , (newVariables asStringWith:' ')).
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   758
    Class withoutUpdatingChangesDo:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   759
	self withAllSubclasses do:[:cls|
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   760
	    cls recompileMethodsAccessingAnyClassvarOrGlobal:newVariables
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   761
	].
13209
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   762
    ].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   763
    self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   764
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   765
    "Modified: / 23-01-1998 / 15:46:23 / stefan"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   766
    "Created: / 15-01-2011 / 14:17:21 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   767
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   768
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   769
allPrivateClasses
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   770
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   771
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   772
    "return a collection of all private classes and private-private classes.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   773
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   774
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   775
    ^ self privateClassesOrAll:true
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   776
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   777
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   778
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   779
category
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   780
    "return the category of the class.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   781
     The returned value may be a string or symbol."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   782
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   783
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   784
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   785
    (owner := self owningClass) notNil ifTrue:[^ owner category].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   786
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   787
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   788
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   789
     Point category
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   790
     Dictionary category
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   791
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   792
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   793
    "Modified: 15.10.1996 / 21:20:01 / cg"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   794
    "Created: 1.4.1997 / 15:23:47 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   795
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   796
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   797
category:aStringOrSymbol
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
   798
    "set the category of the class to be the argument, aStringOrSymbol.
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
   799
     Sends out change notifications, so browers can update"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   800
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   801
    |ns|
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   802
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
   803
    self setCategory:aStringOrSymbol.
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   804
    self addChangeRecordForClass:self.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   805
    ns := self nameSpace.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   806
    ns changed:#organization.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   807
    ns ~~ Smalltalk ifTrue:[
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
   808
        Smalltalk changed:#organization.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   809
    ]
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   810
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   811
    "Modified: / 23-11-2006 / 16:54:20 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   812
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   813
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   814
classBaseFilename
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   815
    "return the baseName of the file from which the class was compiled.
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   816
     In contrast to classFilename, this will always be a plain basename."
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   817
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   818
    ^ self classFilename asFilename baseName
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   819
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   820
    "
23178
9744ff458ba9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22847
diff changeset
   821
     Method classFilename
9744ff458ba9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22847
diff changeset
   822
     Method::MethodWhoInfo classFilename
9744ff458ba9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22847
diff changeset
   823
     
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   824
     Math::ClosedInterval classFilename
23178
9744ff458ba9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22847
diff changeset
   825
     Expecco::ExpeccoTestplan classFilename
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   826
    "
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   827
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   828
    "Created: / 12-10-2006 / 15:49:32 / cg"
23178
9744ff458ba9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22847
diff changeset
   829
    "Modified (comment): / 02-07-2018 / 14:29:04 / Claus Gittinger"
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   830
!
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   831
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   832
classFilename
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   833
    "return the name of the file from which the class was compiled.
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   834
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   835
     this will be an absolute path. Oherwise, it will be a basename only.
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   836
     See classBaseFilename for a method which always returns the basename."
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   837
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   838
    |owner info fn|
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   839
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   840
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
   841
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   842
"/  This was added as an extension of libsvn - should be no longer needed
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   843
"/    compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'.
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   844
"/    (compatQuery notNil
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   845
"/    and:[compatQuery isLoaded
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   846
"/    and:[(compatQuery query ? true) not]])
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   847
"/        ifTrue:[^SVN::Repository containerNameForClass: self].
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
   848
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   849
    classFilename notNil ifTrue:[ ^ classFilename ].
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   850
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   851
    (info := self revisionInfo) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   852
	fn := info fileName.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   853
	fn notNil ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   854
	    ^ fn
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   855
	].
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   856
    ].
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   857
    ^ (Smalltalk fileNameForClass:self), '.', self sourceFileSuffix
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   858
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   859
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   860
     SVN::Repository classFilename
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   861
     Array classFilename
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   862
    "
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   863
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   864
    "Modified: / 22-10-2008 / 20:58:21 / cg"
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   865
!
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   866
15095
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   867
classNamed:aClassNameStringOrSymbol
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   868
    "return a private class if present; nil otherwise.
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   869
     Added for protocol compatibilty with NameSpace and Smalltalk"
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   870
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   871
    "{ Pragma: +optSpace }"
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   872
    ^ self privateClassesAt:aClassNameStringOrSymbol
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   873
!
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
   874
24688
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   875
classVarAt:aSymbolOrNameString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   876
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   877
     Currently, this returns nil if there is no such classvar -
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   878
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   879
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   880
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   881
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   882
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   883
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   884
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   885
    "
24688
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   886
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbolOrNameString)
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   887
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   888
    "
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   889
     Object classVarAt:#UserInterruptSignal
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   890
     Object classVarAt:'UserInterruptSignal'
6d56c00efca5 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24671
diff changeset
   891
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   892
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   893
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   894
classVarAt:aSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   895
    "return the value of a class variable.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   896
     Currently, this returns nil if there is no such classvar -
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   897
     this may change."
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   898
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   899
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   900
     this hides the (current) implementation of classVariables
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   901
     from the outside world. Currently, classvars are stored in
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   902
     the Smalltalk dictionary with a funny name, since there are
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   903
     no classPools yet.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   904
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   905
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   906
!
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   907
13106
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   908
classVarAt:aSymbolOrString put:something
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   909
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   910
     Currently this creates a global with a funny name if no such
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   911
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   912
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   913
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   914
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   915
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   916
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   917
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   918
    "
13106
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   919
    Smalltalk at:(self globalKeyForClassVar:aSymbolOrString) put:something.
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   920
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   921
    "Modified: / 27-10-2010 / 16:35:17 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   922
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   923
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   924
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   925
    "return a collection of the class variable name-strings.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   926
     Only names of class variables defined in this class are included
16043
2066d12faf35 class: Class
Claus Gittinger <cg@exept.de>
parents: 16036
diff changeset
   927
     in the returned collection - use allClassVarNames, to get all known names.
2066d12faf35 class: Class
Claus Gittinger <cg@exept.de>
parents: 16036
diff changeset
   928
     Traditionally, this was called classVarNames, but newer versions of squeak
2066d12faf35 class: Class
Claus Gittinger <cg@exept.de>
parents: 16036
diff changeset
   929
     seem to have changed to use classVariableNames. 
2066d12faf35 class: Class
Claus Gittinger <cg@exept.de>
parents: 16036
diff changeset
   930
     So you probably should use the alias"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   931
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   932
    classvars isNil ifTrue:[
15032
5fbddc5403d3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 14929
diff changeset
   933
        ^ #()
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   934
    ].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   935
    classvars isString ifTrue:[
20517
33999880ee83 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 20404
diff changeset
   936
        classvars isEmpty ifTrue:[
33999880ee83 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 20404
diff changeset
   937
            classvars := #().
33999880ee83 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 20404
diff changeset
   938
        ] ifFalse:[
33999880ee83 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 20404
diff changeset
   939
            classvars := classvars asCollectionOfWords collect:[:varName| varName asSymbol] as:Array.
33999880ee83 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 20404
diff changeset
   940
        ].
15032
5fbddc5403d3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 14929
diff changeset
   941
        ^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   942
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   943
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   944
    ^ classvars
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   945
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   946
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   947
     Object classVarNames
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   948
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   949
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   950
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   951
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   952
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   953
    "return a string of the class variables names.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   954
     Only names of class variables defined in this class are in the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   955
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   956
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   957
    classvars isNil ifTrue:[^ ''].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   958
    classvars isString ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   959
	^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   960
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   961
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   962
    ^ classvars asStringWith:(Character space)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   963
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   964
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   965
     Object classVariableString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   966
     Float classVariableString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   967
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   968
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   969
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   970
classVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   971
    "set the classes classvarnames string;
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   972
     Initialize new class variables with nil, clear and remove old ones.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   973
     No change record is written and no classes are recompiled."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   974
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   975
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   976
7517
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   977
    (aString ~= self classVariableString) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   978
	prevVarNames := self classVarNames asOrderedCollection.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   979
	classvars := aString.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   980
	varNames := self classVarNames.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   981
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   982
	"new ones get initialized to nil;
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   983
	 - old ones are nilled and removed from Smalltalk"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   984
	any := false.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   985
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   986
	varNames do:[:aName |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   987
	    (prevVarNames includes:aName) ifFalse:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   988
		"a new one"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   989
		self classVarAt:aName put:nil.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   990
		any := true.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   991
	    ] ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   992
		prevVarNames remove:aName
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   993
	    ]
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   994
	].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   995
	"left overs are gone"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   996
	prevVarNames do:[:aName |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   997
	    any := true.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   998
	    self classVarAt:aName put:nil.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
   999
	    Smalltalk removeKey:(self globalKeyForClassVar:aName).
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1000
	].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1001
	any ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1002
	    Smalltalk changed:#classVariables with:self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1003
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1004
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1005
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1006
    "Modified: / 02-04-1997 / 00:16:05 / stefan"
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1007
    "Modified: / 18-11-2006 / 17:13:14 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1008
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1009
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1010
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1011
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1012
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1013
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1014
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1015
    "the comment is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1016
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1017
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1018
    comment isNumber ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1019
        classFilename notNil ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1020
            stream := self sourceStream.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1021
            stream notNil ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1022
                stream position:comment-1.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1023
                string := String readFrom:stream onError:''.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1024
                stream close.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1025
                ^ string
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1026
            ].
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1027
            ^ nil
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  1028
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1029
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1030
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1031
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1032
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1033
     Object comment
7054
685d359f9847 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  1034
     RunArray comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1035
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1036
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1037
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1038
comment:aStringOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1039
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1040
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1041
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1042
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1043
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  1044
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  1045
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1046
    newComment := aStringOrNil.
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1047
    (aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1048
	newComment := nil
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  1049
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  1050
    comment ~= newComment ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1051
	oldComment := self comment.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1052
	comment := newComment.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1053
	self addChangeRecordForClassComment:self.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1054
	self changed:#comment with:oldComment.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1055
	Smalltalk changed:#classComment with:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1056
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1057
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1058
14704
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1059
containingNameSpace
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1060
    "return the namespace I am really contained in;
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1061
     For private or anonymous classes, nil is returned -
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1062
     for public classes, Smalltalk is returned."
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1063
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1064
    "/ (self nameSpace at:self nameWithoutNamespacePrefix ifAbsent:nil)
14708
e79cbf6abb76 class: Class
Claus Gittinger <cg@exept.de>
parents: 14704
diff changeset
  1065
    "/ or
19166
22f1ee605c16 #BUGFIX
mawalch
parents: 19119
diff changeset
  1066
    (name isSymbol and:[(Smalltalk at:name) == self]) ifFalse:[
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1067
        ^ nil
14704
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1068
    ].
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1069
    ^ self nameSpace
14704
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1070
!
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1071
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1072
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1073
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1074
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1075
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1076
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
  1077
11866
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1078
generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1079
    "generate the expected filename for this class - without suffix.
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1080
     This may be different from the actual classFilename"
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1081
16763
612c1f29a936 class: Class
Claus Gittinger <cg@exept.de>
parents: 16622
diff changeset
  1082
    |nm|
612c1f29a936 class: Class
Claus Gittinger <cg@exept.de>
parents: 16622
diff changeset
  1083
612c1f29a936 class: Class
Claus Gittinger <cg@exept.de>
parents: 16622
diff changeset
  1084
    nm := self theNonMetaclass name.
612c1f29a936 class: Class
Claus Gittinger <cg@exept.de>
parents: 16622
diff changeset
  1085
    ^ nm copyReplaceAll:$: with:$_ ifNone:nm
11866
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1086
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1087
    "
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1088
     Complex generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1089
     HTML::AbstractElement generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1090
    "
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1091
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1092
    "Modified: / 06-10-2006 / 16:16:01 / cg"
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1093
!
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
  1094
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1095
getClassFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1096
    "return the name of the file from which the class was compiled.
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1097
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1098
     this will be an absolute path. Oherwise, it will be a basename only."
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1099
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1100
    |owner|
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1101
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1102
    (owner := self owningClass) notNil ifTrue:[^ owner getClassFilename].
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1103
    ^ classFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1104
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1105
    "Modified: / 06-10-2006 / 13:32:01 / cg"
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1106
!
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1107
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1108
getPackage
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1109
    "get the package or nil."
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1110
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1111
    ^ package
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1112
!
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1113
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1114
globalKeyForClassVar:aStringOrSymbol
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1115
    "this helps to encapsulate the (current) implementation of classVariables
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1116
     from the outside world. Currently, classvars are stored in
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1117
     the Smalltalk dictionary with a funny name, since there are
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1118
     no classPools yet.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1119
    "
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1120
    ^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1121
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1122
    "Modified: / 18-11-2006 / 17:13:39 / cg"
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1123
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1124
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1125
name
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1126
    "return the name of the class.
6657
a0fa5a821176 comment
Claus Gittinger <cg@exept.de>
parents: 6520
diff changeset
  1127
     This returns a symbol (but notice, that other smalltalks might return a string)."
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1128
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1129
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1130
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1131
    "Created: 1.4.1997 / 15:24:32 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1132
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1133
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1134
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  1135
    "return the namespace I am contained in;
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1136
     For public classes, Smalltalk is returned.
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1137
     For private classes, the owning class is returned.
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1138
     For anonymous classes, nil should be returned - but for now, this also returns Smalltalk;
14704
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1139
     but will change in the future to return nil then.
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1140
     This is left in for a while (because many users of this method expect a non-nil return value).
14704
9393f4343773 class: Class
Claus Gittinger <cg@exept.de>
parents: 14695
diff changeset
  1141
     In the meantime, use containingNameSpace, which provides the correct answer"
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  1142
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1143
    |idx nsName e restName|
7321
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1144
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1145
    "/ cached in environment
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1146
    environment isNil ifTrue:[
16020
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1147
        e := Smalltalk. "/ default
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1148
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1149
        name notNil ifTrue:[
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1150
            "/ due to the implementation, extract this from my name
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1151
            "/ (physically, all classes are found in Smalltalk)
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1152
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1153
            idx := name lastIndexOf:$:.
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1154
            idx ~~ 0 ifTrue:[
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1155
                (name at:idx-1) == $: ifTrue:[
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1156
                    nsName := name copyTo:(idx - 2).
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1157
                    e := Smalltalk at:nsName asSymbol ifAbsent:[^ Smalltalk "take care when asking an anon class"].
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1158
                ].
16020
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1159
            ].
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1160
        ].
fa71b75a7550 class: Class
Claus Gittinger <cg@exept.de>
parents: 15947
diff changeset
  1161
        environment := e.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1162
    ].
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1163
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1164
    (environment notNil and:[name notNil]) ifTrue:[
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1165
        [
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1166
            |tryE|    
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1167
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1168
            "/ sub namespace ?
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1169
            restName := name copyFrom:environment name size + 3.
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1170
            idx := restName indexOf:$:.
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1171
            (idx ~~ 0 and:[(restName at:idx+1) == $:]) ifTrue:[
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1172
                nsName := environment name , '::', (restName copyTo:idx-1).
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1173
                tryE := Smalltalk at:nsName asSymbol.
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1174
                tryE isNameSpace ifTrue:[
17651
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1175
                    "/ Transcript showCR:nsName.
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1176
                    "/ Transcript showCR:restName.
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1177
                    environment := tryE.
17651
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1178
                ].
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1179
            ].
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1180
            tryE == environment
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1181
        ] whileTrue.
17651
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1182
    ].
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1183
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1184
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1185
17651
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1186
    "
18208
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1187
     Expecco::KeyFile::Extension setEnvironment:nil. 
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1188
     Expecco::KeyFile::Extension nameSpace 
2860af6dfc2d class: Class
Stefan Vogel <sv@exept.de>
parents: 18206
diff changeset
  1189
     Expecco::KeyFile::Extension containingNameSpace 
17651
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1190
    "
23e5b2044601 class: Class
Claus Gittinger <cg@exept.de>
parents: 17470
diff changeset
  1191
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  1192
    "Modified: / 20.7.1998 / 14:21:36 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1193
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1194
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1195
package
14572
26d54a1674fc class: Class
Claus Gittinger <cg@exept.de>
parents: 14235
diff changeset
  1196
    "return the package-symbol of the class."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1197
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1198
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1199
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1200
    (owner := self owningClass) notNil ifTrue:[^ owner package].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  1201
    package isNil ifTrue:[^ PackageId noProjectID].
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1202
    ^ package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1204
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1205
     Object package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1206
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1207
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1208
    "Modified: / 29.12.1998 / 01:15:50 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1209
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1210
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1211
package:aSymbol
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1212
    "set the package-symbol of the class.
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1213
     Sends out change notifications, so browers can update"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1214
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1215
    |newPackage oldPackage|
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1216
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  1217
    aSymbol == PackageId noProjectID ifTrue:[
16273
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1218
        newPackage := nil
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1219
    ] ifFalse:[
16273
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1220
        newPackage := aSymbol
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1221
    ].
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1222
    package ~= newPackage ifTrue:[
16273
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1223
        oldPackage := package.
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1224
        (Smalltalk
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1225
                changeRequest:#packageOfClass
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1226
                with:(Array with:self with:oldPackage with:newPackage)) ifFalse:[
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1227
            ^ self
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1228
        ].
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1229
        package := newPackage.
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1230
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1231
        self changed:#package.
12bcc2e1b762 class: Class
Stefan Vogel <sv@exept.de>
parents: 16227
diff changeset
  1232
        Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage).
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1233
    ].
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1234
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1235
    "Modified: / 09-08-2006 / 17:58:53 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1236
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1237
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1238
poolDictionaries
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1239
    "this returns the concatenated pool name string"
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1240
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1241
    ^ self sharedPoolNames asStringWith:' '
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1242
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1243
    "Modified: / 18-01-2011 / 17:56:12 / cg"
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1244
!
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1245
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1246
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1247
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1248
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1249
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1250
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1251
    (self isPrivate) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1252
	self error:'private classes cannot have their own primitiveDefinitions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1253
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1254
    self setPrimitiveDefinitions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1255
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1256
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1257
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1258
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1259
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1260
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1261
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1262
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1263
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1264
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1265
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1266
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1267
    (owner := self owningClass) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1268
	^ owner primitiveDefinitionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1269
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1270
    ^ self getSourceChunkAttribute:#primitiveDefinitions
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1271
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1272
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1273
     Object primitiveDefinitionsString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1274
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1275
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1276
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1277
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1278
primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1279
    "return the primitiveDefinition string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1280
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1281
    ^ self primitiveDefinitionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1282
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1283
/*
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1284
 * includes, defines, structure definitions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1285
 * and typedefs come here.
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1286
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1287
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1288
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1289
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1290
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1291
     Object primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1292
     String primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1293
     ExternalStream primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1294
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1295
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1296
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1297
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1298
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1299
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1300
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1301
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1302
    (self isPrivate) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1303
	self error:'private classes cannot have their own primitiveFunctions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1304
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1305
    self setPrimitiveFunctions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1306
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1307
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1308
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1309
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1310
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1311
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1312
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1313
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1314
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1315
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1316
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1317
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1318
    (owner := self owningClass) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1319
	^ owner primitiveFunctionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1320
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1321
    ^ self getSourceChunkAttribute:#primitiveFunctions
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1322
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1323
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1324
primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1325
    "return the primitiveFunction string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1326
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1327
    ^ self primitiveFunctionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1328
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1329
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1330
 * any local C (helper) functions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1331
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1332
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1333
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1334
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1335
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1336
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1337
     Object primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1338
     String primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1339
     ExternalStream primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1340
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1341
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1342
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1343
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1344
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1345
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1346
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1347
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1348
    (self isPrivate) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1349
	self error:'private classes cannot have their own primitiveVariables'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1350
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1351
    self setPrimitiveVariables:aString.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1352
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1353
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1354
    "Created: 29.10.1995 / 19:41:58 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1355
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1356
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1357
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1358
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1359
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1360
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1361
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1362
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1363
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1364
    (owner := self owningClass) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1365
	^ owner primitiveVariablesString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1366
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1367
    ^ self getSourceChunkAttribute:#primitiveVariables
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1368
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1369
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1370
primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1371
    "return the primitiveVariable string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1372
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1373
    ^ self primitiveVariablesString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1374
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1375
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1376
 * any local C variables
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1377
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1378
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1379
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1380
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1381
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1382
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1383
     Object primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1384
     String primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1385
     ExternalStream primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1386
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1387
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1388
11137
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1389
privateClassNamed:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1390
    ^ self privateClassesAt:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1391
!
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1392
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1393
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1394
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1395
24663
186ce1b39d34 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24595
diff changeset
  1396
    "return a collection of my private classes (empty, if I have none).
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1397
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1398
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1399
    ^ self privateClassesOrAll:false
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1400
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1401
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1402
     Object privateClasses
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1403
     ObjectMemory privateClasses
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1404
     UILayoutTool privateClasses
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1405
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1406
3495
31ae10035c74 skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
  1407
    "Modified: / 29.5.1998 / 23:23:18 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1408
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1409
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1410
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1411
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1412
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1413
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1414
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1415
    |myName nmSym|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1416
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1417
    myName := self name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1418
    myName isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1419
	"/ no name - there cannot be a corresponding private class
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1420
	^ nil
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1421
    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1422
    nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1423
    nmSym isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1424
	"/ no such symbol - there cannot be a corresponding private class
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1425
	^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1426
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1427
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1428
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1429
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1430
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1431
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1432
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1433
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1434
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1435
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1436
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1437
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1438
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1439
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1440
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1441
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1442
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1443
privateClassesOrAll:allOfThem
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1444
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1445
4495
4804e3e33d76 tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents: 4400
diff changeset
  1446
    "return a collection of my direct private classes (if any)
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1447
     or direct plus indirect private classes (if allOfThem).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1448
     An empty collection if there are none.
13507
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1449
     The classes are in no particular order."
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1450
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1451
    |classes myName myNamePrefix myNamePrefixLen|
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1452
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1453
    myName := self name.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1454
    myNamePrefix := myName , '::'.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1455
    myNamePrefixLen := myNamePrefix size.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1456
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1457
    Smalltalk keysDo:[:nm |
25208
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1458
        |cls|
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1459
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1460
        (nm startsWith:myNamePrefix) ifTrue:[
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1461
            (allOfThem
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1462
            or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1463
                cls := Smalltalk at:nm.
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1464
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1465
                (cls isBehavior and:[cls isMeta not]) ifTrue:[
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1466
                    "/ ouch, must check for aliases
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1467
                    cls name = nm ifTrue:[
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1468
                        classes isNil ifTrue:[
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1469
                            classes := Set new:10.
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1470
                        ].
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1471
                        classes add:cls.
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1472
                    ]
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1473
                ]
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1474
            ]
864a5cfdbca8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 25181
diff changeset
  1475
        ]
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1476
    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1477
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  1478
    ^ classes ? #()
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1479
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1480
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1481
     UILayoutTool privateClassesOrAll:true
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1482
     UILayoutTool privateClassesOrAll:false
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1483
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1484
13507
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1485
    "Modified: / 29-05-1998 / 23:23:18 / cg"
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1486
    "Modified (comment): / 18-07-2011 / 09:15:39 / cg"
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1487
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1488
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1489
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1490
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1491
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1492
    "return a collection of my private classes (if any).
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1493
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1494
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1495
    |classes pivateClassesOf|
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1496
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1497
    classes := self privateClasses.
14146
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  1498
    classes notEmpty ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1499
	classes := classes asOrderedCollection.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1500
	classes sort:[:a :b | a name < b name].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1501
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1502
	pivateClassesOf := IdentityDictionary new.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1503
	classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1504
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1505
	classes topologicalSort:[:a :b |
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1506
	    "/ a must come before b iff:
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1507
	    "/    b is a subclass of a
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1508
	    "/    b has a private class which is a subclass of a
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1509
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1510
	    |mustComeBefore pivateClassesOfB|
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1511
	    mustComeBefore := b isSubclassOf:a.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1512
	    pivateClassesOfB := pivateClassesOf at:b.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1513
	    pivateClassesOfB do:[:eachClassInB |
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1514
		mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1515
	    ].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1516
	    mustComeBefore
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1517
	].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1518
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1519
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1520
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1521
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1522
     Object privateClassesSorted
14146
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  1523
     Class privateClassesSorted
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  1524
     Class privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1525
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1526
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1527
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1528
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1529
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1530
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1531
projectDefinition
12197
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1532
    <resource: #obsolete>
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1533
    "return the project definition of the classes package"
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1534
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1535
    self obsoleteMethodWarning.
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1536
    ^ self projectDefinitionClass
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1537
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1538
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1539
     Object projectDefinition productVersion
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1540
     DAPASX::DapasUI projectDefinition productVersion
12197
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1541
    "
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1542
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1543
    "Created: / 19-09-2006 / 22:02:06 / cg"
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1544
!
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1545
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1546
projectDefinitionClass
18559
2f3d69fc53f0 class: Class
Claus Gittinger <cg@exept.de>
parents: 18208
diff changeset
  1547
    "return the project definition of the classes' package.
2f3d69fc53f0 class: Class
Claus Gittinger <cg@exept.de>
parents: 18208
diff changeset
  1548
     Eg. for Array, this would return the stx_libbasic project definition class."
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1549
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1550
    ^ ProjectDefinition definitionClassForPackage: self package
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1551
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1552
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1553
     Object projectDefinitionClass productVersion
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1554
     DAPASX::DapasUI projectDefinitionClass productVersion
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1555
    "
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1556
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1557
    "Created: / 19-09-2006 / 22:02:06 / cg"
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1558
!
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1559
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1560
realSharedPoolNames
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1561
    "this returns the namespace aware pool names"
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1562
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1563
    |poolNames ns|
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1564
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1565
    poolNames := self sharedPoolNames.
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1566
    (ns := self topNameSpace) notNil ifTrue:[
17403
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1567
        ^ poolNames
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1568
                collect:[:nm |
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1569
                    |p|
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1570
                    (p := ns at:nm asSymbol) notNil ifTrue:[
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1571
                        p name
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1572
                    ] ifFalse:[
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1573
                        nm
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1574
                    ]].
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1575
    ].
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1576
    ^ poolNames
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1577
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1578
    "
17403
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1579
     HGCommand sharedPoolNames    
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1580
     HGCommand realSharedPoolsNames  
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1581
     HGCommand sharedPoolNames  
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1582
     Croquet::OpenGL sharedPools
17403
c5cfdcda7170 class: Class
Claus Gittinger <cg@exept.de>
parents: 17255
diff changeset
  1583
     Croquet::OpenGL sharedPools
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1584
    "
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1585
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1586
    "Created: / 18-01-2011 / 18:02:25 / cg"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1587
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1588
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1589
realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1590
    "this returns the namespace aware pools"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1591
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1592
    |ns|
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1593
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1594
    ns := self topNameSpace.
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1595
    ^ self sharedPoolNames collect:[:nm | ns at:nm]
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1596
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1597
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1598
     Croquet::OpenGL sharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1599
     Croquet::OpenGL realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1600
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1601
     Win32OperatingSystem realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1602
     Win32OperatingSystem realSharedPoolNames
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1603
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1604
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1605
    "Modified: / 18-01-2011 / 18:05:19 / cg"
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1606
!
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1607
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1608
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1609
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1610
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1611
    "remove a class variable if not already there.
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1612
     Also writes a change record and notifies dependents."
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1613
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1614
    |names newNames|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1615
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1616
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1617
    (names includes:aString) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1618
	newNames := ''.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1619
	names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1620
	self classVariableString:newNames withoutSpaces.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1621
	Class withoutUpdatingChangesDo:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1622
	    self withAllSubclasses do:[:cls|
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1623
		cls recompileMethodsAccessingAnyClassvarOrGlobal:
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1624
					(Array with:aString asSymbol)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1625
	    ].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1626
	].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1627
	self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1628
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1629
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1630
    "Created: / 29.10.1995 / 19:42:08 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1631
    "Modified: / 23.1.1998 / 15:46:33 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1632
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1633
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1634
setCategory:aStringOrSymbol
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1635
    "set the category of the class to be the argument, aStringOrSymbol.
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1636
     Does NOT send out change notifications (so browers will NOT update)"
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1637
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1638
    aStringOrSymbol isNil ifTrue:[
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1639
        category := aStringOrSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1640
    ] ifFalse:[
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1641
        category := aStringOrSymbol asSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1642
    ]
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1643
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1644
    "Created: 1.4.1997 / 15:24:04 / stefan"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1645
!
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1646
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1647
setClassFilename:aFilename
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1648
    "set the classes filename.
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1649
     This is a dangerous (low level) operation,
19109
mawalch
parents: 18936
diff changeset
  1650
     since the comment and primitiveSpecs may no longer be accessible,
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1651
     if a wrong filename is set here."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1652
18936
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1653
    |baseName|
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1654
    
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1655
    "/ cg: somewhere, the filename is set from a temporary (checkout) files name.
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1656
    "/ we MUST catch and FIX this.
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1657
    aFilename notNil ifTrue:[
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1658
        baseName := aFilename asFilename baseName. 
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1659
        (baseName startsWith:'st') ifTrue:[
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1660
            (baseName at:3) isDigit ifTrue:[
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1661
                self halt:'this should not be reached'
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1662
            ].
165de5f0f8e2 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 18599
diff changeset
  1663
        ].
10141
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1664
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1665
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1666
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1667
    "Modified: / 08-09-1995 / 14:16:48 / claus"
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1668
    "Modified: / 25-10-2006 / 13:50:42 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1669
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1670
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1671
setClassVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1672
    "set the classes classvarnames string.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1673
     This is a dangerous (low level) operation, since the
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1674
     classvariables are not really created or updated. Also,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1675
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1676
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1677
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1678
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1679
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1680
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1681
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1682
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1683
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1684
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1685
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1686
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1687
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1688
    "set the comment and category of the class;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1689
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1690
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1691
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1692
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1693
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1694
    categoryStringOrSymbol isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1695
	cat := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1696
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  1697
	cat := categoryStringOrSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1698
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1699
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1700
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1701
5248
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1702
setEnvironment:aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1703
    "set the namespace I am contained in; ST-80 compatible name"
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1704
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1705
    environment := aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1706
!
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1707
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1708
setPackage:aSymbol
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1709
    "set the package of the class.
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1710
     Does NOT send out change notifications (so browers will NOT update)"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1711
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1712
    package := aSymbol
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1713
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1714
    "Modified: / 09-08-2006 / 17:59:13 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1715
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1716
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1717
sharedPoolNames
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1718
    "this returns a collection of the plain (non-namespace aware) pool names.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1719
     Read the comment in sharedPools on why this is done."
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1720
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1721
    |pools|
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1722
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1723
    pools := self getAttribute:#sharedPools.
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1724
    pools isNil ifTrue:[
15032
5fbddc5403d3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 14929
diff changeset
  1725
        ^ #().
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1726
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1727
    pools isString ifTrue:[
15095
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1728
        pools := (pools asCollectionOfWords collect:[:varName| varName asSymbol]) as:Array.
15032
5fbddc5403d3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 14929
diff changeset
  1729
        self setAttribute:#sharedPools to:pools.
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1730
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1731
    ^ pools
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1732
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1733
    "
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1734
     ZipArchive sharedPoolNames
15095
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1735
     OSI::ASN1_Coder sharedPoolNames
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1736
     Croquet::OpenGL sharedPoolNames
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1737
     OpenGLRenderingContext sharedPoolNames
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1738
     Character sharedPoolNames
d456d6d25609 class: Class
Stefan Vogel <sv@exept.de>
parents: 15075
diff changeset
  1739
     Win32OperatingSystem sharedPoolNames
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1740
    "
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1741
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1742
    "Created: / 18-01-2011 / 17:55:42 / cg"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1743
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1744
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1745
sharedPoolNames:aStringOrCollection
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1746
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1747
18206
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1748
    "set the sharedPools string (no change notifications)
0a66d9385a70 class: Class
Claus Gittinger <cg@exept.de>
parents: 17651
diff changeset
  1749
     Does NOT send out change notifications (so browers will NOT update)"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1750
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  1751
    self setSharedPoolNames:aStringOrCollection.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1752
    self addChangeRecordForClass:self.
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1753
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1754
    "Created: / 18-01-2011 / 17:55:48 / cg"
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  1755
    "Modified: / 18-01-2011 / 20:41:17 / cg"
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1756
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1757
13762
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1758
sharedPools:aCollection
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1759
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1760
13762
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1761
    "set the sharedPools expects the real pools (i.e. the PoolDictionaries)"
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1762
15040
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1763
    "/ for backward compatibility, also allow a string arg..
13762
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1764
    aCollection isString ifTrue:[
15075
57e8939d96cc class: Class
Stefan Vogel <sv@exept.de>
parents: 15040
diff changeset
  1765
        Transcript show:self name; showCR:' [warning]: string passed to #sharedPools:'.
15040
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1766
        self sharedPoolNames:(aCollection asCollectionOfWords collect:[:each | each asSymbol]).
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1767
        ^ self.
13762
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1768
    ].
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1769
    self sharedPoolNames:
15040
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1770
        (aCollection
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1771
            collect:[:each |
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1772
                each isString
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1773
                    ifTrue:[ each asSymbol ]
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1774
                    ifFalse:[ each name ]
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1775
            ]
62372d55910f class: Class
Claus Gittinger <cg@exept.de>
parents: 15032
diff changeset
  1776
        ).
13762
29606a2c7ad0 changed:
Claus Gittinger <cg@exept.de>
parents: 13759
diff changeset
  1777
13766
4c3376c7dcb7 changed:
Claus Gittinger <cg@exept.de>
parents: 13764
diff changeset
  1778
    "Modified: / 03-10-2011 / 10:30:30 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1779
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1780
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1781
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1782
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1783
23725
39a32886f805 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 23401
diff changeset
  1784
    |aStream|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1785
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1786
" this is too slow for big classes (due to the emphasis stored)...
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1787
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1788
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1789
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1790
"
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1791
    [
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1792
        aStream := FileStream newTemporary.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1793
        aStream removeOnClose:true.
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1794
    ] on:OpenError do:[:ex|
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1795
        self warn:'Class>>#source: cannot create temporary file: ', ex description.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1796
        ^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1797
    ].
23725
39a32886f805 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 23401
diff changeset
  1798
    ^ [
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1799
        FileOutErrorSignal handle:[:ex |
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1800
            aStream nextPut:$" ; nextPutAll:ex description; nextPut:$".
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1801
            FileOutErrorSignal isHandled ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1802
                ex reject.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1803
            ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1804
        ] do:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1805
            self fileOutOn:aStream.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1806
        ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1807
        aStream reset.
23725
39a32886f805 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 23401
diff changeset
  1808
        aStream contents.
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1809
    ] ensure:[
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  1810
        aStream close.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1811
    ].
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1812
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1813
    "Modified: / 06-10-2006 / 13:34:18 / cg"
23725
39a32886f805 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 23401
diff changeset
  1814
    "Modified: / 12-02-2019 / 20:05:23 / Stefan Vogel"
385
claus
parents: 384
diff changeset
  1815
!
claus
parents: 384
diff changeset
  1816
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1817
sourceCodeManager
16815
0fa21cfaf70c comment/format in: Class>>sourceCodeManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16814
diff changeset
  1818
    "Return my (configured) source code manager."
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1819
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1820
    |owner|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1821
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1822
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1823
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1824
    "/ see if there is a package-specific manager
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1825
    AbstractSourceCodeManager notNil ifTrue:[
16814
20cb0799f5d3 Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16763
diff changeset
  1826
        ^ AbstractSourceCodeManager sourceCodeManagerForPackage: self package.
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1827
    ].
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1828
17154
eb99b0e1b9de class: Class
Claus Gittinger <cg@exept.de>
parents: 17045
diff changeset
  1829
    ^ Smalltalk at:#SourceCodeManager "/ nil if SCM is disabled
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1830
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1831
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1832
     Array sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1833
     foo_p1 sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1834
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1835
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1836
    "Created: / 07-12-1995 / 13:16:46 / cg"
10220
7332b36bc81e avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents: 10195
diff changeset
  1837
    "Modified: / 05-12-2006 / 22:04:26 / cg"
16815
0fa21cfaf70c comment/format in: Class>>sourceCodeManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16814
diff changeset
  1838
    "Modified (comment): / 04-08-2014 / 00:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1839
!
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1840
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1841
sourceCodeManagerFromBinaryRevision
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1842
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1843
    "Returns the source code manager that should be used for
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1844
     source code access based in class's binary revision.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1845
     If not binary revision is available, then configured source
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1846
     code manager is returned. If source code management
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1847
     is disabled or particular source code manager is not enabled,
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1848
     return nil.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1849
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1850
     Source code manager for source access may differ from
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1851
     configured source code manager:
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1852
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1853
     - #sourceCodeManager returns the manager use has configured for
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1854
       this class using preferences
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1855
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1856
     - #sourceCodeManagerForSourceAccess is the manager used when asking
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1857
       for class source code. It compares version_XXX methods with
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1858
       class's binary revision and. When method_XXX matches the
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1859
       binary revision string, XXX source code manager is returned,
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1860
       as this class has been likely compiled from a source checked out
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1861
       using returned source code manager
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1862
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1863
    CAVEAT: Now, the code expects that the revision string is in
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1864
    format '$revision ident$SCM'. It won't work for managers that
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1865
    does not use dollar expansion. For, only CVS, SVN and Perforce
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1866
    are used so this code should work
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1867
    "
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1868
19876
8d800ba2b60c #BUGFIX by sr
sr
parents: 19834
diff changeset
  1869
    AbstractSourceCodeManager isNil ifTrue:[^ nil]. "/ SCM package not yet loaded.
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1870
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1871
16814
20cb0799f5d3 Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16763
diff changeset
  1872
    revision isNil ifTrue:[^self sourceCodeManager].
20cb0799f5d3 Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16763
diff changeset
  1873
20cb0799f5d3 Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16763
diff changeset
  1874
    AbstractSourceCodeManager availableManagers do:[:mgr |
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1875
        (revision endsWith: mgr managerTypeNameShort) ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1876
            ^mgr
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1877
        ]
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1878
    ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1879
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1880
    "binary revision is not nil and we haven't found source code manager.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1881
     This may happen when (i) given source code manager is not available
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1882
     or (ii) source version methods are somehow corrupted.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1883
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1884
     Let's be strict about it for now and throw and error. More relaxed
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1885
     version may simply return nil"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1886
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1887
"/    self error:'Cannot find source code manager for source access ' ,
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1888
"/               '(manager yet not loaded or binary revision corrupted)'
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1889
"/        mayProceed: true.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1890
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1891
    ^nil
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1892
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1893
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1894
    "
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1895
        Object sourceCodeManager
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1896
        Object sourceCodeManagerForSourceAccess
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1897
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1898
        JavaVM sourceCodeManager
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1899
        JavaVM sourceCodeManagerForSourceAccess
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1900
    "
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1901
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1902
    "Created: / 06-10-2011 / 09:33:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
16814
20cb0799f5d3 Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16763
diff changeset
  1903
    "Modified (format): / 04-08-2014 / 00:32:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1904
!
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  1905
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1906
subclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1907
    "return a collection of the direct subclasses of the receiver"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1908
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1909
    "/ use cached information (to avoid class hierarchy search if possible)
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  1910
    (subclasses isNil
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  1911
    or:[ subclasses sequenceNumber ~= SubclassCacheSequenceNumber ]) ifTrue:[
22810
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1912
        self updateAllCachedSubclasses.
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1913
        "subclasses may still be nil - obsolete classes may not be updated"
16b2394f9b18 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22659
diff changeset
  1914
        ^ subclasses ? #().
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1915
    ].
12906
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1916
    ^ subclasses.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1917
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1918
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1919
     Class flushSubclassInfo.
12906
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1920
     Class subclasses.
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1921
     SmallInteger subclasses
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1922
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1923
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  1924
    "Modified: / 06-12-2011 / 16:05:16 / cg"
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1925
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1926
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1927
superclass:aClass
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1928
    "set the superclass - this actually creates a new class,
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1929
     recompiling all methods for the new one. The receiving class stays
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1930
     around anonymously to allow existing instances some life.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1931
     This may change in the future (adjusting existing instances)"
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1932
16622
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1933
    |owner ns nm|
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1934
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1935
    "must flush caches since lookup chain changes"
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1936
    ObjectMemory flushCaches.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1937
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1938
    "/ for correct recompilation, just create a new class ...
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1939
    "/ but care to avoid a nameSpace change, by giving my
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1940
    "/ full name and answering with Smalltalk to a nameSpace query.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1941
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1942
    (owner := self owningClass) notNil ifTrue:[
16622
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1943
        ns := owner.
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1944
        nm := self nameWithoutPrefix asSymbol
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1945
    ] ifFalse:[
16622
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1946
        ns := Smalltalk.
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1947
        nm := self name
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1948
    ].
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1949
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1950
    Class classRedefinitionNotification answer:#keep do:[
16622
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1951
        Class nameSpaceQuerySignal
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1952
            answer:ns
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1953
            do:[
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1954
                aClass
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1955
                    perform:(self definitionSelector)
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1956
                    withArguments:(Array with:nm
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1957
                                   with:(self instanceVariableString)
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1958
                                   with:(self classVariableString)
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1959
                                   with:(self sharedPoolNames asStringWith: ' ')
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1960
                                   with:(self category)).
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1961
            ]
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1962
    ]
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1963
16622
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1964
    "Modified: / 20-06-1998 / 18:17:37 / cg"
8f09bdc1c316 Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 16498
diff changeset
  1965
    "Modified: / 24-06-2014 / 17:02:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13507
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1966
!
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1967
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1968
withAllPrivateClasses
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1969
    "return a collection containing the receiver plus all of my private classes (if any).
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1970
     This also inclueds all private classes of private classes, recursively.
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1971
     Elements are in no particular order."
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1972
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1973
    |coll|
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1974
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1975
    coll := OrderedCollection new.
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1976
    self withAllPrivateClassesDo:[:cls | coll add:cls].
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1977
    ^ coll
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1978
8a63453a75ec added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
  1979
    "Created: / 18-07-2011 / 09:14:38 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1980
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1981
25211
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  1982
5257
a90fd9cb3c18 category rename
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
  1983
!Class methodsFor:'adding & removing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1984
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1985
removeFromSystem
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1986
    "ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1987
     remove myself from the system"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1988
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1989
    Smalltalk removeClass:self.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1990
    Smalltalk removeKey:name.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1991
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1992
    "Created: 6.2.1996 / 11:32:58 / stefan"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1993
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1994
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1995
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1996
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1997
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1998
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1999
     autoloaded. Can be used to get rid of no longer needed autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2000
     classes.
328
claus
parents: 326
diff changeset
  2001
     (maybe, autoloaded classes should unload themselfes when no
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2002
      longer needed - for example, after some delay when the last instance
328
claus
parents: 326
diff changeset
  2003
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2004
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  2005
    |nm newClass privateClasses|
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2006
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2007
    self wasAutoloaded ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2008
	"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2009
	 can it be done ?
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2010
	 (all of my methods must have a source)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2011
	"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2012
	self instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2013
	    aMethod source isNil ifTrue:[^false].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2014
	    aMethod hasPrimitiveCode ifTrue:[^ false].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2015
	].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2016
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2017
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  2018
    "/ cannot unload, if non-autoloaded subclasses exist ...
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  2019
    self allSubclassesDo:[:eachSubclass |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2020
	eachSubclass wasAutoloaded ifFalse:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2021
	    eachSubclass isPrivate ifFalse:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2022
		self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)').
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2023
		^ false.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2024
	    ]
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2025
	]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  2026
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  2027
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  2028
    self allSubclassesDo:[:eachSubclass |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2029
	eachSubclass wasAutoloaded ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2030
	    eachSubclass unload
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2031
	] ifFalse:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2032
	    eachSubclass removeFromSystem.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2033
	]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  2034
    ].
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  2035
    privateClasses := self privateClasses.
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  2036
    privateClasses notEmpty ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2037
	self withoutUpdatingChangesDo:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2038
	    privateClasses do:[:eachPrivateClass |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2039
		eachPrivateClass removeFromSystem.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2040
	    ].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2041
	].
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  2042
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2043
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  2044
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  2045
    "/ reinstall as autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2046
    Autoload removeClass:self.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2047
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2048
    Smalltalk at:nm put:nil.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  2049
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  2050
    ObjectMemory flushMethodCache.
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  2051
    newClass := Autoload addClass:nm inCategory:category.
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  2052
    newClass notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2053
	newClass package:package
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  2054
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2055
    Smalltalk flushCachedClasses.
12701
9ceabe94c8e1 changed: #unload
Claus Gittinger <cg@exept.de>
parents: 12694
diff changeset
  2056
    Class flushSubclassInfoFor:self.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2057
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2058
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2059
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2060
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2061
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2062
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2063
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  2064
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2065
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2066
    "Modified: 7.6.1996 / 09:15:05 / stefan"
2675
bb724aff9c75 stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
  2067
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2068
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2069
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  2070
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2071
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2072
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2073
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2074
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2075
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  2076
    "add a category change"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2077
14612
afcc0becdf7e class: Class
Stefan Vogel <sv@exept.de>
parents: 14597
diff changeset
  2078
    UpdateChangeFileQuerySignal query ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2079
	self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  2080
    ].
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  2081
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  2082
    "this test allows a smalltalk without Projects/ChangeSets"
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  2083
    Project notNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2084
	UpdateChangeListQuerySignal query ifTrue:[
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2085
	    Project addClassDefinitionChangeFor:self
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2086
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2087
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2088
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2089
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2090
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2091
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2092
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2093
    "add a class-definition-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2094
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2095
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2096
	self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2097
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2098
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2099
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2100
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2101
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2102
	    Project addClassDefinitionChangeFor:aClass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2103
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2104
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2105
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2106
    "Modified: / 24.1.1997 / 19:09:41 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2107
    "Modified: / 18.3.1999 / 18:14:04 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2108
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2109
14929
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2110
addChangeRecordForClass:aClass andNotifyChangeOf:aspect
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2111
    "writes a change record and notifies dependents."
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2112
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2113
    |namespace|
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2114
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2115
    self addChangeRecordForClass:aClass.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2116
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2117
    aClass changed:#definition.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2118
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2119
    namespace := aClass nameSpace.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2120
    namespace changed:#classDefinition with:aClass.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2121
    namespace ~~ Smalltalk ifTrue:[
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2122
	Smalltalk changed:#classDefinition with:aClass.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2123
    ].
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2124
    namespace changed:aspect with:aClass.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2125
    namespace ~~ Smalltalk ifTrue:[
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2126
	Smalltalk changed:aspect with:aClass.
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2127
    ].
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2128
!
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  2129
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2130
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2131
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2132
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2133
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2134
12052
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  2135
    |rv pkg|
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  2136
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2137
    UpdateChangeFileQuerySignal query ifTrue:[
19891
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2138
        rv := aClass revision.
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2139
        rv isNil ifTrue:[rv := '???'].
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2140
        pkg := aClass package.
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2141
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2142
        self
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2143
            writingChangeWithTimeStamp:false
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2144
            perform:#addInfoRecord:to:
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2145
            with:('checkin %1 (%2) into %3'
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2146
                    bindWith:aClass name
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2147
                    with:rv
5805c489e14f #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 19876
diff changeset
  2148
                    with:pkg).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2149
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2150
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2151
    "Created: / 18.11.1995 / 17:04:58 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2152
    "Modified: / 24.1.1997 / 19:11:55 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2153
    "Modified: / 18.3.1999 / 18:14:14 / stefan"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2154
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2155
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2156
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2157
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2158
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2159
    "add a class-comment-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2160
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2161
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2162
	self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2163
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2164
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2165
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2166
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2167
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2168
	    Project addClassCommentChangeFor:aClass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2169
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2170
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2171
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2172
    "Modified: / 24.1.1997 / 19:09:59 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2173
    "Modified: / 18.3.1999 / 18:14:23 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2174
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2175
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  2176
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2177
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2178
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  2179
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  2180
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2181
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2182
	self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2183
	    writingChangeWithTimeStamp:false
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2184
	    perform:#addInfoRecord:to:
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2185
	    with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2186
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2187
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2188
    "Created: / 11.9.1996 / 15:37:19 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2189
    "Modified: / 24.1.1997 / 19:12:05 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2190
    "Modified: / 18.3.1999 / 18:14:31 / stefan"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  2191
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  2192
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2193
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2194
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2195
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2196
    "append a class-was-filedOut-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2197
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2198
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2199
	self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2200
	    writingChangeWithTimeStamp:false
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2201
	    perform:#addInfoRecord:to:
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2202
	    with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2203
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2204
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2205
    "Modified: / 24.1.1997 / 19:12:14 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2206
    "Modified: / 18.3.1999 / 18:14:36 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2207
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2208
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2209
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2210
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2211
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2212
    "add a class-instvars-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2213
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2214
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2215
	self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2216
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2217
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2218
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2219
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2220
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2221
	    Project addInstVarDefinitionChangeFor:aClass class
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2222
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2223
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2224
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2225
    "Modified: / 24.1.1997 / 19:10:18 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2226
    "Modified: / 18.3.1999 / 18:14:43 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2227
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2228
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2229
addChangeRecordForClassRemove
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2230
    "{ Pragma: +optSpace }"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2231
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2232
    "add a class-remove-record to the changes file"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2233
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2234
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2235
	self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2236
    ].
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2237
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2238
    "this test allows a smalltalk without Projects/ChangeSets"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2239
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2240
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2241
	    Project addClassRemoveChange:self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2242
	]
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2243
    ]
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2244
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2245
    "Modified: / 24.1.1997 / 19:10:25 / cg"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2246
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2247
!
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2248
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2249
addChangeRecordForClassRemove:oldClassName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2250
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2251
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2252
    "add a class-remove-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2253
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2254
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2255
	self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2256
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2257
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2258
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2259
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2260
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2261
	    Project addClassRemoveChange:self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2262
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2263
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2264
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2265
    "Modified: / 24.1.1997 / 19:10:25 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2266
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2267
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2268
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2269
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2270
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2271
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2272
    "add a class-rename-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2273
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2274
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2275
	self writingChangeDo:[:aStream |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2276
	    self addChangeRecordForClassRename:oldName to:newName to:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2277
	]
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2278
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2279
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2280
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2281
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2282
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2283
	    Project addClassRenameChangeFrom:oldName to:newName
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2284
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  2286
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2287
    "Modified: / 24.1.1997 / 19:10:35 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2288
    "Modified: / 18.3.1999 / 18:14:59 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2289
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2290
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2292
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2293
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2294
    "add a primitiveDefinitions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2295
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2296
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2297
	self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2298
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2299
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2300
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2301
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2302
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2303
	    Project addPrimitiveDefinitionsChangeFor:aClass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2304
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2305
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2306
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2307
    "Modified: / 20.1.1997 / 12:36:10 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2308
    "Modified: / 18.3.1999 / 18:15:04 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2309
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2310
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2311
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2312
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2313
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2314
    "add a primitiveFunctions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2316
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2317
	self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2318
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2319
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2320
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2321
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2322
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2323
	    Project addPrimitiveFunctionsChangeFor:aClass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2324
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2325
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2326
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2327
    "Modified: / 20.1.1997 / 12:36:13 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2328
    "Modified: / 18.3.1999 / 18:15:09 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2329
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2330
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2331
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2332
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2333
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2334
    "add a primitiveVariables-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2335
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2336
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2337
	self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2338
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2339
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2340
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2341
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2342
	UpdateChangeListQuerySignal query ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2343
	    Project addPrimitiveVariablesChangeFor:aClass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2344
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2345
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2346
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2347
    "Modified: / 20.1.1997 / 12:36:16 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2348
    "Modified: / 18.3.1999 / 18:15:14 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2349
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2350
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2351
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2352
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2353
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2354
    "add a snapshot-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2355
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2356
    UpdateChangeFileQuerySignal query ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2357
	self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2358
	    writingChangeWithTimeStamp:false
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2359
	    perform:#addChangeRecordForSnapshot:to:
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2360
	    with:aFileName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2361
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2362
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2363
    "Modified: / 24.1.1997 / 19:12:25 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2364
    "Modified: / 18.3.1999 / 18:15:20 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2365
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2366
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2367
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2368
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2369
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2370
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2371
20618
bf447ad92afc #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 20574
diff changeset
  2372
    self addInfoRecord:('snapshot ' , aFileName asString) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2373
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2374
    "Modified: / 24.1.1997 / 19:11:08 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2375
    "Modified: / 18.3.1999 / 18:15:30 / stefan"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  2376
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  2377
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2378
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2379
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2380
allPrivateClassesDo:aBlock
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2381
    "evaluate aBlock on all of my private classes (if any).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2382
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2383
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2384
    self allPrivateClasses do:aBlock
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2385
!
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2386
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2387
privateClassesDo:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2388
    "evaluate aBlock on all of my (immediate) private classes (if any).
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2389
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2390
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2391
    self privateClasses do:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2392
!
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2393
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2394
subclassesDo:aBlock
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2395
    "evaluate the argument, aBlock for all immediate subclasses.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2396
     This will only enumerate globally known classes - for anonymous
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2397
     behaviors, you have to walk over all instances of Behavior."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2398
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  2399
    self subclasses do:aBlock
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2400
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2401
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2402
     Collection subclassesDo:[:c | Transcript showCR:(c name)]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2403
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2404
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  2405
    "Modified: / 06-12-2011 / 15:59:49 / cg"
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2406
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2407
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2408
withAllPrivateClassesDo:aBlock
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2409
    "evaluate aBlock on myself and all of my private classes (if any).
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2410
     This recurses into private classes of private classes.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2411
     Evaluation is in no particular order."
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2412
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2413
    aBlock value:self.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2414
    self allPrivateClasses do:aBlock
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2415
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2416
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2417
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2418
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2419
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2420
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2421
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2422
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2423
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2424
     Thus, although the definitions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2425
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2426
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2427
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2428
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2429
    "Modified: 10.2.1996 / 12:47:12 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2430
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2431
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2432
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2433
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2434
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2435
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2436
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2437
     Thus, although the functions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2438
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2439
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2440
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2441
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2442
    "Modified: 10.2.1996 / 12:47:07 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2443
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2444
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2445
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2446
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2447
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2448
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2449
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2450
     Thus, although the variables are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2451
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2452
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2453
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2454
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2455
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2456
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2457
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2458
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2459
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2460
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2461
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2462
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2463
    self
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2464
	basicFileOutDefinitionOn:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2465
	withNameSpace:forceNameSpace
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2466
	withPackage:true
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2467
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2468
!
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2469
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2470
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2471
    "append an expression on aStream, which defines myself."
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2472
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2473
    self class
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2474
	basicFileOutDefinitionOf:self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2475
	on:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2476
	withNameSpace:forceNameSpace withPackage:showPackage
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2477
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2478
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2479
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2480
    "append an expression on aStream, which defines myself."
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2481
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2482
    self class
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2483
	basicFileOutDefinitionOf:self
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2484
	on:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2485
	withNameSpace:forceNameSpace
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2486
	withPackage:showPackage
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2487
	syntaxHilighting:syntaxHilighting
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2488
!
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2489
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2490
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2491
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2492
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2493
    |isVar superclass|
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2494
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2495
    superclass := self superclass.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2496
    superclass isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2497
	isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2498
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2499
	"I cant remember what this is for ?"
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2500
	isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2501
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2502
3920
0c1b9b2fa23b added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents: 3788
diff changeset
  2503
    aStream nextPutAll:(self firstDefinitionSelectorPart).
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2504
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2505
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2506
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2507
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2508
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2509
    "create a file 'class.st' consisting of all methods in myself in
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2510
     sourceForm, from which the class can be reconstructed (by filing in).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2511
     If the current project is not nil, create the file in the projects
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2512
     directory. Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2513
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2514
     Also, since the classes methods need a valid sourcefile, the current
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2515
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2516
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2517
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2518
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2519
    nm := (Smalltalk fileNameForClass:self name),'.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2520
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2521
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2522
     this test allows a smalltalk to be built without Projects/ChangeSets
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2523
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2524
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2525
	dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2526
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2527
	dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2528
    ].
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2529
    fileName := (dirName asFilename construct:nm).
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2530
    fileName makeLegalFilename.
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2531
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2532
    self fileOutAs:fileName name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2533
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2534
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2535
"/     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2536
"/     since we can see in that changeBrowser, which changes have
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2537
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2538
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2539
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2540
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2541
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2542
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2543
    "Modified: / 06-10-2006 / 16:16:19 / cg"
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2544
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2545
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2546
fileOutAllMethodsOn:aStream
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2547
    self fileOutAllMethodsOn:aStream methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2548
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2549
    "Created: 15.10.1996 / 11:13:00 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2550
    "Modified: 22.3.1997 / 16:12:17 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2551
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2552
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2553
fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2554
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2555
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2556
    collectionOfCategories := self class methodCategories asSortedCollection.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2557
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2558
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2559
            self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2560
            aStream cr
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2561
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2562
    ].
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2563
    collectionOfCategories := self methodCategories asSortedCollection.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2564
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2565
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2566
            self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2567
            aStream cr
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2568
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2569
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2570
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2571
    self privateClassesSorted do:[:aClass |
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2572
        aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2573
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2574
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2575
    "Created: / 15-10-1996 / 11:13:00 / cg"
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  2576
    "Modified: / 05-07-2017 / 10:50:45 / cg"
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2577
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2578
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2579
fileOutAs:filenameString
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2580
    "create a file consisting of all methods in myself in
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2581
     sourceForm, from which the class can be reconstructed (by filing in).
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2582
     The given fileName should be a full path, including suffix.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2583
     Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2584
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2585
     Also, since the classes methods need a valid sourcefile, the current
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2586
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2587
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2588
    |filename fileExists needRename
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2589
     mySourceFileName sameFile s mySourceFileID anySourceRef outStream savFilename|
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2590
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2591
    self isLoaded ifFalse:[
15331
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2592
        ^ FileOutErrorSignal
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2593
            raiseRequestWith:self
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2594
                 errorString:' - will not fileOut unloaded class: ', self name
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2595
    ].
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2596
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2597
    filename := filenameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2598
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2599
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2600
     if file exists, copy the existing to a .sav-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2601
     create the new file as XXX.new-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2602
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2603
    "
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2604
    [
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2605
        fileExists := filename exists.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2606
        fileExists ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2607
            sameFile := false.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2608
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2609
            "/ check carefully - maybe, my source does not really come from that
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2610
            "/ file (i.e. all of my methods have their source as string)
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2611
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2612
            anySourceRef := false.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2613
            self instAndClassMethodsDo:[:m |
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2614
                m sourcePosition notNil ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2615
                    anySourceRef := true
15331
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2616
                ]
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2617
            ].
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2618
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2619
            anySourceRef ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2620
                s := self sourceStream.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2621
                s notNil ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2622
                    OperatingSystem isUNIXlike ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2623
                        mySourceFileID := s pathName asFilename info id.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2624
                        sameFile := (filename info id) == mySourceFileID.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2625
                    ] ifFalse:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2626
                        mySourceFileID := s pathName asFilename asAbsoluteFilename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2627
                        sameFile := (filename asFilename asAbsoluteFilename) = mySourceFileID.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2628
                    ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2629
                    s close.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2630
                ] ifFalse:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2631
                    classFilename notNil ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2632
                        "
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2633
                         check for overwriting my current source file
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2634
                         this is not allowed, since it would clobber my methods source
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2635
                         file ... you have to save it to some other place.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2636
                         This happens if you ask for a fileOut into the source-directory
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2637
                         (from which my methods get their source)
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2638
                        "
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2639
                        mySourceFileName := Smalltalk getSourceFileName:classFilename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2640
                        sameFile := (filenameString = mySourceFileName).
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2641
                        sameFile ifFalse:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2642
                            mySourceFileName notNil ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2643
                                OperatingSystem isUNIXlike ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2644
                                    sameFile := (filename info id) == (mySourceFileName asFilename info id)
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2645
                                ]
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2646
                            ]
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2647
                        ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2648
                    ]
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2649
                ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2650
            ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2651
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2652
            sameFile ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2653
                ^ FileOutErrorSignal
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2654
                    raiseRequestWith:filenameString
24671
e622818210bd #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24663
diff changeset
  2655
                    errorString:(c' - may not overwrite sourcefile: %1\ntry again after loading sources in the browser' bindWith:filenameString)
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2656
            ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2657
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2658
            outStream := FileStream newTemporaryIn:filename directory.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2659
            outStream fileName accessRights:filename accessRights.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2660
            needRename := true
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2661
        ] ifFalse:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2662
            "/ another possible trap: if my sourceFileName is
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2663
            "/ the same as the written one AND the new files directory
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2664
            "/ is along the sourcePath, we also need a temporary file
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2665
            "/ first, to avoid accessing the newly written file.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2666
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2667
            self instAndClassMethodsDo:[:m |
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2668
                |mSrc mSrcFilename|
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2669
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2670
                (anySourceRef isNil and:[(mSrc := m sourceFilename) notNil]) ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2671
                    mSrcFilename := mSrc asFilename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2672
                    (mSrcFilename baseName = filename baseName 
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2673
                     and:[mSrcFilename exists]) ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2674
                        anySourceRef := mSrcFilename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2675
                    ]
15331
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2676
                ]
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2677
            ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2678
            anySourceRef notNil ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2679
                outStream := FileStream newTemporaryIn:filename directory.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2680
                outStream fileName accessRights:anySourceRef accessRights.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2681
                needRename := true
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2682
            ] ifFalse:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2683
                outStream := filename writeStream.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2684
                needRename := false
15331
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2685
            ]
e333425b391e class: Class
Claus Gittinger <cg@exept.de>
parents: 15308
diff changeset
  2686
        ].
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2687
    ] on:OpenError do:[:ex|
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2688
        ^ FileOutErrorSignal
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2689
                raiseRequestWith:filename name
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2690
                errorString:(' - cannot create file:', filename name)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2691
    ].
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2692
    self fileOutOn:outStream.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2693
    outStream syncData; close.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2694
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2695
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2696
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2697
     be careful, if the old one is a symbolic link; in this case,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2698
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2699
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2700
    needRename ifTrue:[
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2701
        fileExists ifTrue:[
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2702
            savFilename := filename addSuffix:'.sav~'.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2703
            filename renameTo:savFilename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2704
        ].
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2705
        outStream fileName renameTo:filename.
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2706
        fileExists ifTrue:[
22659
1fe75ac33b44 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22558
diff changeset
  2707
            savFilename remove.
15466
922e035d4fde class: Class
Stefan Vogel <sv@exept.de>
parents: 15331
diff changeset
  2708
        ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2709
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2710
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2711
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2712
     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2713
     since we can see in that changeBrowser, which changes have
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2714
     already found their way into a sourceFile and which must be
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2715
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2716
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2717
    self addChangeRecordForClassFileOut:self
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2718
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2719
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2720
    "Created: / 16-04-1997 / 20:44:05 / cg"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2721
    "Modified: / 04-10-2006 / 17:26:23 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2722
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2723
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2724
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2725
    "append an expression to define my classInstanceVariables on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2726
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2727
    self class
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2728
	fileOutClassInstVarDefinitionOn:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2729
	withNameSpace:false
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2730
!
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2731
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2732
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2733
    "append an expression to define my classInstanceVariables on aStream"
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2734
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2735
    |anySuperClassInstVar|
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2736
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2737
    self isLoaded ifFalse:[
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2738
        ^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2739
    ].
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2740
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2741
    withNameSpace ifTrue:[
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2742
        self name printOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2743
    ] ifFalse:[
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2744
        self printClassNameOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2745
    ].
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2746
    aStream nextPutAll:' class instanceVariableNames:'''.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2747
    self class printInstVarNamesOn:aStream indent:8.
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2748
    aStream nextPut:$'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2749
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2750
    "mhmh - good idea; saw this in SmallDraw sourcecode ..."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2751
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2752
    anySuperClassInstVar := false.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2753
    self allSuperclassesDo:[:aSuperClass |
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2754
        aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2755
    ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2756
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2757
    aStream cr; cr; nextPut:(Character doubleQuote); cr; space.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2758
    anySuperClassInstVar ifFalse:[
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2759
        aStream
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2760
            nextPutLine:'No other class instance variables are inherited by this class.'.
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2761
    ] ifTrue:[
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2762
        aStream
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2763
            nextPutLine:'The following class instance variables are inherited by this class:'.
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2764
        aStream cr.
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2765
        self allSuperclassesDo:[:aSuperClass |
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2766
            aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2767
            aStream nextPutLine:(aSuperClass class instanceVariableString).
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2768
        ].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2769
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2770
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2771
    aStream nextPut:(Character doubleQuote); cr.
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2772
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2773
    "Created: / 10-12-1995 / 16:31:25 / cg"
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2774
    "Modified: / 03-02-2000 / 23:05:28 / cg"
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  2775
    "Modified: / 17-02-2017 / 10:55:44 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2776
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2777
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2778
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2779
    "append an expression on aStream, which defines my comment"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2780
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2781
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2782
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2783
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2784
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2785
    (comment := self comment) isNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2786
	s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2787
    ] ifFalse:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2788
	s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2789
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2790
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2791
    aStream nextPutChunkSeparator.
14597
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2792
    aStream cr.
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2793
    aStream cr.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2794
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2795
    "Modified: 21.12.1996 / 13:36:01 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2796
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2797
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2798
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2799
    "append an expression on aStream, which defines myself."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2800
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  2801
    ^ self basicFileOutDefinitionOn:aStream withNameSpace:true
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  2802
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  2803
    "Modified: / 04-01-1997 / 20:55:18 / cg"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  2804
    "Modified: / 04-02-2014 / 16:49:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2805
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2806
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2807
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2808
    "create a file 'class.st' consisting of all methods in self in
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2809
     directory aDirectoryName (ignoring any directory setting in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2810
     the current project).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2811
     This is not logged in that change file (should it be ?)."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2812
12297
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2813
    ^ self fileOutIn:aDirectoryName withTimeStamp:true
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2814
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2815
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2816
	self fileOutIn:'/tmp'
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2817
	self fileOutIn:'/tmp/doesNotExistBla'
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2818
	self fileOutIn:'/tmp' asFilename
12297
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2819
    "
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2820
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2821
    "Modified: / 19-09-1997 / 00:03:53 / stefan"
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2822
    "Modified: / 06-10-2006 / 16:16:13 / cg"
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2823
!
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2824
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2825
fileOutIn:aDirectoryName withTimeStamp:withTimeStamp
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2826
    "create a file 'class.st' consisting of all methods in self in
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2827
     directory aDirectoryName (ignoring any directory setting in
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2828
     the current project).
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2829
     This is not logged in that change file (should it be ?)."
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2830
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2831
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2832
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2833
    fileName := (Smalltalk fileNameForClass:self name),'.st'.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2834
    [
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2835
        aStream := (aDirectoryName asFilename construct:fileName) writeStream.
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2836
    ] on:OpenError do:[:ex|
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2837
        ^ FileOutErrorSignal
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2838
                raiseRequestWith:fileName
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2839
                errorString:(' - cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2840
    ].
12297
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2841
    self fileOutOn:aStream withTimeStamp:withTimeStamp.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2842
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2843
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2844
    "
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2845
        self fileOutIn:'/tmp'
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2846
        self fileOutIn:'/tmp/doesNotExistBla'
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  2847
        self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2848
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2849
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2850
    "Modified: / 19-09-1997 / 00:03:53 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2851
    "Modified: / 06-10-2006 / 16:16:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2852
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2853
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2854
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2855
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2856
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2857
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2858
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2859
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2860
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2861
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2862
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2863
fileOutOn:aStream withTimeStamp:stampIt
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2864
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2865
     If stampIt is true, a timeStamp comment is prepended."
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2866
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2867
    self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2868
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2869
    "Modified: / 13.3.1998 / 12:23:02 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2870
!
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2871
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2872
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2873
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2874
     If stampIt is true, a timeStamp comment is prepended.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2875
     If initIt is true, and the class implements a class-initialize method,
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2876
     append a corresponding doIt expression for initialization."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2877
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2878
    self
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2879
	fileOutOn:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2880
	withTimeStamp:stampIt
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2881
	withInitialize:initIt
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2882
	withDefinition:true
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2883
	methodFilter:nil
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2884
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2885
    "Created: / 15.11.1995 / 12:53:06 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2886
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2887
    "Modified: / 13.3.1998 / 12:23:59 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2888
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2889
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2890
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2891
    "file out my definition and all methods onto aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2892
     If stampIt is true, a timeStamp comment is prepended.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2893
     If initIt is true, and the class implements a class-initialize method,
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2894
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2895
     The order by which the fileOut is done is used to put the version string at the end.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2896
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2897
21469
f6b1c3eda60e #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21423
diff changeset
  2898
    |encoder needsUtf8Encoding|
8164
db7a658c7bfc fileout in utf8-format
ca
parents: 8149
diff changeset
  2899
24341
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2900
    aStream isExternalStream ifTrue:[
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2901
        "/ check if we need UTF8 encoding
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2902
        needsUtf8Encoding := 
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2903
            self withAllPrivateClasses contains:[:someClass |
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2904
                 someClass instAndClassMethods contains:[:someMethod |
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2905
                    (methodFilter isNil or:[methodFilter value:someMethod])
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2906
                    and:[ 
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2907
                        |src|
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2908
                        src := someMethod source.
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2909
                        src notNil and:[src containsNon7BitAscii]
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2910
                    ]
24340
8bad15eabbdc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24222
diff changeset
  2911
                ]
24341
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2912
            ].
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2913
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2914
        needsUtf8Encoding ifTrue:[
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2915
            encoder := CharacterEncoder encoderForUTF8.
24340
8bad15eabbdc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24222
diff changeset
  2916
        ].
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2917
    ].
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2918
    ^ self
15746
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2919
        fileOutOn:aStream
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2920
        withTimeStamp:stampIt
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2921
        withInitialize:initIt
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2922
        withDefinition:withDefinition
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2923
        methodFilter:methodFilter
c1fa82fb9e66 class: Class
Claus Gittinger <cg@exept.de>
parents: 15610
diff changeset
  2924
        encoder:encoder
13508
59531dc7d4e8 changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 13507
diff changeset
  2925
59531dc7d4e8 changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 13507
diff changeset
  2926
    "Modified: / 18-07-2011 / 09:17:17 / cg"
21469
f6b1c3eda60e #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 21423
diff changeset
  2927
    "Modified (format): / 16-02-2017 / 20:34:59 / stefan"
24341
64835f5d26af #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 24340
diff changeset
  2928
    "Modified: / 22-06-2019 / 17:27:46 / Claus Gittinger"
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2929
!
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2930
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2931
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2932
    "file out my definition and all methods onto aStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2933
     If stampIt is true, a timeStamp comment is prepended.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2934
     If initIt is true, and the class implements a class-initialize method,
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2935
     append a corresponding doIt expression for initialization.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2936
     The order by which the fileOut is done is used to put the version string at the end.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2937
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2938
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2939
    self class
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2940
	fileOutOn:outStreamArg
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2941
	withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2942
	methodFilter:methodFilter encoder:encoderOrNil
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2943
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2944
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2945
    "Created: / 15.11.1995 / 12:53:06 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2946
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2947
    "Modified: / 13.3.1998 / 12:23:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2948
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2949
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2950
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2951
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2952
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2953
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2954
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2955
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2956
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2957
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2958
    (s := self primitiveDefinitionsString) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2959
	aStream nextPutChunkSeparator.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2960
	self printClassNameOn:aStream.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2961
	aStream nextPutAll:' primitiveDefinitions';
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2962
		nextPutChunkSeparator;
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2963
		cr.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2964
	aStream nextPutAll:s.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2965
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2966
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2967
    (s := self primitiveVariablesString) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2968
	aStream nextPutChunkSeparator.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2969
	self printClassNameOn:aStream.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2970
	aStream nextPutAll:' primitiveVariables';
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2971
		nextPutChunkSeparator;
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2972
		cr.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2973
	aStream nextPutAll:s.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  2974
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2975
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2976
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2977
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2978
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2979
14597
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2980
fileOutPrimitiveFunctionsOn:aStream
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2981
    |s|
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2982
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2983
    "
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2984
     primitive functions - if any
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2985
    "
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2986
    (s := self primitiveFunctionsString) notNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2987
	aStream nextPutChunkSeparator.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2988
	self printClassNameOn:aStream.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2989
	aStream nextPutAll:' primitiveFunctions';
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2990
		nextPutChunkSeparator;
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2991
		cr.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2992
	aStream nextPutAll:s.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  2993
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
14597
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2994
    ].
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2995
!
c58a70145463 class: Class
Claus Gittinger <cg@exept.de>
parents: 14579
diff changeset
  2996
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2997
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2998
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2999
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3000
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3001
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3002
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3003
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3004
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3005
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3006
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3007
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3008
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3009
    (s := self primitiveFunctionsString) notNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3010
	self fileOutPrimitiveFunctionsOn:aStream
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3011
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3012
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3013
    "Modified: 8.1.1997 / 17:45:51 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3014
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3015
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3016
!Class methodsFor:'fileOut-binary'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3017
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3018
binaryFileOut
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3019
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3020
     consisting of all methods in myself in a portable binary format.
22364
62c8c34ccc2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22210
diff changeset
  3021
     The methods sources are saved by reference
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3022
     to the classes sourceFile if there is any.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3023
     That sourcefile needs to be present after reload in order to be
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3024
     browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3025
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3026
    self binaryFileOutWithSourceMode:#reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3027
22364
62c8c34ccc2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22210
diff changeset
  3028
    "Modified: / 05-01-1997 / 15:40:05 / cg"
62c8c34ccc2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22210
diff changeset
  3029
    "Modified (comment): / 21-11-2017 / 12:58:26 / cg"
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3030
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3031
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3032
binaryFileOutOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3033
    "append a binary representation of myself to aStream"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3034
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3035
    self binaryFileOutOn:aStream sourceMode:#reference
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3036
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3037
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3038
binaryFileOutOn:aStream sourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3039
    "append a binary representation of myself to aStream in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3040
     a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3041
     The argument controls how sources are to be saved:
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3042
        #keep - include the source
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3043
        #reference - include a reference to the sourceFile
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3044
        #discard - don't save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3045
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3046
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3047
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3048
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3049
    |bos|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3050
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3051
    bos := BinaryObjectStorage onNew:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3052
    bos sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3053
    bos nextPutClasses:(Array with:self).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3054
    bos close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3055
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3056
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3057
binaryFileOutWithSourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3058
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3059
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3060
     The argument controls how sources are to be saved:
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3061
        #keep - include the source
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3062
        #reference - include a reference to the sourceFile
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3063
        #discard - don't save sources.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3064
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3065
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3066
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3067
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  3068
    |fileName dirName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  3069
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  3070
    fileName := (Smalltalk fileNameForClass:self name), '.cls'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3071
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3072
    Project notNil ifTrue:[
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3073
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3074
    ] ifFalse:[
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3075
        dirName := '.'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3076
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3077
    fileName := dirName asFilename construct:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3078
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3079
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3080
    self binaryFileOutWithSourceMode:sourceMode as:fileName.
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  3081
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  3082
    "Modified: / 06-10-2006 / 16:16:29 / cg"
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3083
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3084
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3085
binaryFileOutWithSourceMode:sourceMode as:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3086
    "create a file fileNameString,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3087
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3088
     The argument controls how sources are to be saved:
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3089
        #keep - include the source
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3090
        #reference - include a reference to the sourceFile
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3091
        #discard - don't save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3092
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3093
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3094
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3095
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3096
    |fileName aStream|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3097
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3098
    fileName := fileNameString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3099
    fileName makeLegalFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  3100
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  3101
    [
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3102
        aStream := fileName newReadWriteStream.
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3103
    ] on:OpenError do:[:ex|
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3104
        ^ FileOutErrorSignal
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3105
                raiseRequestWith:fileName name
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3106
                errorString:(' - cannot create file:', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3107
    ].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3108
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3109
    aStream binary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3110
    self binaryFileOutOn:aStream sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3111
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3112
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3113
    "Created: / 29.12.1998 / 21:38:38 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3114
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3115
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3116
!Class methodsFor:'fileOut-xml'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3117
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3118
fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3119
    "create a file 'class.xml' consisting of all methods in myself in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3120
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3121
     If the current project is not nil, create the file in the projects
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3122
     directory. Care is taken, to not clobber any existing file in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3123
     case of errors (for example: disk full)"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3124
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  3125
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  3126
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  3127
    nm := (Smalltalk fileNameForClass:self name) , '.xml'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3128
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3129
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3130
     this test allows a smalltalk to be built without Projects/ChangeSets
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3131
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3132
    Project notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3133
	dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3134
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3135
	dirName := Filename currentDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3136
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3137
    fileName := (dirName asFilename construct:nm).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3138
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3139
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3140
    self fileOutXMLAs:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3141
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3142
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3143
     Class fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3144
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3145
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3146
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3147
fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3148
    "append xml expressions on aStream, which defines myself and all of my private classes."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3149
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3150
    self fileOutXMLDefinitionOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3151
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3152
    "/ here, the full nameSpace prefixes are output,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3153
    "/ to avoid confusing stc
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3154
    "/ (which otherwise could not find the correct superclass)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3155
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3156
    FileOutNameSpaceQuerySignal answer:true do:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3157
	self privateClassesSorted do:[:aClass |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3158
	    aClass fileOutXMLAllDefinitionsOn:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3159
	]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3160
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3161
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3162
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3163
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3164
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3165
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3166
    |collectionOfCategories|
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3167
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3168
    collectionOfCategories := self class methodCategories asSortedCollection.
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3169
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3170
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3171
            self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3172
            aStream cr
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3173
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3174
    ].
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3175
    collectionOfCategories := self methodCategories asSortedCollection.
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3176
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3177
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3178
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3179
            aStream cr
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3180
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3181
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3182
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3183
    self privateClassesSorted do:[:aClass |
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3184
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3185
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3186
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3187
    "Modified: / 05-07-2017 / 10:50:49 / cg"
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3188
!
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3189
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3190
fileOutXMLAs:fileNameOrString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3191
    "create a file consisting of all methods in myself in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3192
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3193
     The given fileName should be a full path, including suffix."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3194
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3195
    |aStream fileName|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3196
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3197
    self isLoaded ifFalse:[
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3198
        ^ FileOutErrorSignal
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3199
            raiseRequestWith:self
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3200
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3201
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3202
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3203
    fileName := fileNameOrString asFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  3204
    [
25181
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3205
        aStream := fileName writeStream.
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3206
    ] on:OpenError do:[:ex|
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3207
        ^ FileOutErrorSignal
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3208
                raiseRequestWith:fileName name
03beca66ef4d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 24688
diff changeset
  3209
                errorString:(' - cannot create file: ', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3210
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3211
    self fileOutXMLOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3212
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3213
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3214
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3215
     Class fileOutXMLAs:'test.xml'
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  3216
     Class fileOutXMLAs:'/blaDoesNotExist/test.xml'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3217
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3218
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3219
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3220
fileOutXMLDefinitionOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3221
    "append an xml expression on aStream, which defines myself."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3222
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  3223
    |varNames|
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3224
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3225
    aStream nextPutLine:'<class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3226
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3227
    aStream nextPutAll:'  <name>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3228
    aStream nextPutAll:(self nameWithoutPrefix).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3229
    aStream nextPutLine:'</name>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3230
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3231
    aStream nextPutAll:'  <environment>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3232
    aStream nextPutAll:(self nameSpace name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3233
    aStream nextPutLine:'</environment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3234
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3235
    aStream nextPutAll:'  <super>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3236
    aStream nextPutAll:(self theNonMetaclass superclass name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3237
    aStream nextPutLine:'</super>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3238
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3239
    aStream nextPutAll:'  <private>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3240
    aStream nextPutAll:(self isPrivate printString).
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3241
    aStream nextPutLine:'</private>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3242
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3243
    aStream nextPutAll:'  <indexed-type>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3244
    aStream nextPutAll:'none'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3245
    aStream nextPutLine:'</indexed-type>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3246
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3247
    aStream nextPutAll:'  <inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3248
    varNames := self instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3249
    varNames size > 0 ifTrue:[
23825
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3250
        aStream cr.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3251
        varNames do:[:nm |
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3252
            aStream nextPutAll:'    <name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3253
            aStream nextPutAll:nm.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3254
            aStream nextPutLine:'</name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3255
        ].
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3256
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3257
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3258
    aStream nextPutLine:'</inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3259
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3260
    aStream nextPutAll:'  <class-inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3261
    varNames := self class instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3262
    varNames size > 0 ifTrue:[
23825
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3263
        aStream cr.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3264
        varNames do:[:nm |
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3265
            aStream nextPutAll:'    <name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3266
            aStream nextPutAll:nm.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3267
            aStream nextPutLine:'</name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3268
        ].
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3269
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3270
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3271
    aStream nextPutLine:'</class-inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3272
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3273
    aStream nextPutAll:'  <imports>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3274
    aStream nextPutAll:''.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3275
    aStream nextPutLine:'</imports>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3276
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3277
    aStream nextPutAll:'  <category>'.
23825
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3278
    aStream nextPutAll:(self category ? '* no category *').
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3279
    aStream nextPutLine:'</category>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3280
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3281
    aStream nextPutLine:'</class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3282
14146
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  3283
    self classVarNames do:[:nm |
23825
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3284
        aStream nextPutLine:'<static>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3285
        aStream nextPutAll:' <name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3286
        aStream nextPutAll:nm.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3287
        aStream nextPutLine:'</name>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3288
        aStream nextPutAll:' <environment>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3289
        aStream nextPutAll:self name.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3290
        aStream nextPutLine:'</environment>'.
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3291
        aStream nextPutLine:'</static>'.
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3292
    ].
23825
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3293
8debffbe8eac #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 23734
diff changeset
  3294
    "Modified: / 03-03-2019 / 22:26:08 / Claus Gittinger"
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3295
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3296
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3297
fileOutXMLOn:aStream
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3298
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3299
     file out my definition and all methods onto aStream in XML format."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3300
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3301
    self
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3302
	fileOutXMLOn:aStream
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3303
	withTimeStamp:true
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3304
	withInitialize:true
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3305
	withDefinition:true
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3306
	methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3307
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3308
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3309
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3310
fileOutXMLOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3311
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3312
     file out my definition and all methods onto aStream in XML format.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3313
     If stampIt is true, a timeStamp comment is prepended.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3314
     If initIt is true, and the class implements a class-initialize method,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3315
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3316
     The order by which the fileOut is done is used to put the version string at the end.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3317
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3318
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3319
    |collectionOfCategories copyrightMethod copyrightText comment meta|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3320
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3321
    self isLoaded ifFalse:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3322
        ^ FileOutErrorSignal
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3323
            raiseRequestWith:self
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3324
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3325
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3326
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3327
    meta := self class.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3328
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3329
    aStream nextPutLine:'<?xml version="1.0"?>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3330
    aStream nextPutLine:'<st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3331
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3332
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3333
     if there is a copyright method, add a copyright element at the beginning,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3334
     taking the string from the copyright method.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3335
     We cannot do this unconditionally - that would lead to my copyrights
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3336
     being put on your code ;-).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3337
     On the other hand: I want every file created by myself to have the
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3338
     copyright string at the beginning be preserved .... even if the
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3339
     code was edited in the browser and filedOut.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3340
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3341
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3342
        "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3343
         get the copyright methods source,
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3344
         and insert at beginning.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3345
        "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3346
        copyrightText := copyrightMethod source.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3347
        copyrightText isNil ifTrue:[
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3348
            "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3349
             no source available - trigger an error
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3350
            "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3351
            FileOutErrorSignal
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3352
                raiseRequestWith:' - no source for class: '.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3353
            ^ self
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3354
        ].
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3355
        "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3356
         strip off the selector-line
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3357
        "
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3358
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3359
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3360
        [copyrightText last isEmpty] whileTrue:[
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3361
            copyrightText := copyrightText copyButLast:1.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3362
        ].
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3363
        (copyrightText first = '"') ifTrue:[
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3364
            (copyrightText last = '"') ifTrue:[
25288
d308ef18be52 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 25216
diff changeset
  3365
                copyrightText := copyrightText withoutQuotes.
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3366
            ]
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3367
        ].
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3368
        copyrightText := copyrightText asString.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3369
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3370
        aStream nextPutAll:'<copyright>'.
15789
958c778d759e class: Class
Stefan Vogel <sv@exept.de>
parents: 15746
diff changeset
  3371
        copyrightText printXmlTextQuotedOn:aStream.
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3372
        aStream nextPutLine:'</copyright>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3373
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3375
    stampIt ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3376
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3377
        "/ first, a timestamp
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3378
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3379
        aStream nextPutAll:'<time-stamp>'.
15789
958c778d759e class: Class
Stefan Vogel <sv@exept.de>
parents: 15746
diff changeset
  3380
        Smalltalk timeStampString printXmlTextQuotedOn:aStream.
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3381
        aStream nextPutLine:'</time-stamp>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3382
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3383
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3384
    withDefinition ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3385
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3386
        "/ then the definition
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3387
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3388
        self fileOutXMLAllDefinitionsOn:aStream.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3389
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3390
        "/ a comment - if any
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3391
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3392
        (comment := self comment) notNil ifTrue:[
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3393
            aStream nextPutLine:'<comment>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3394
            aStream nextPutAll:'<class-id>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3395
            aStream nextPutAll:(self name).
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3396
            aStream nextPutLine:'</class-id>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3397
            aStream nextPutLine:'</comment>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3398
        ].
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3399
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3400
        "/ primitive definitions - if any
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3401
        "/
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3402
"/        self fileOutPrimitiveSpecsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3403
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3404
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3405
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3406
    "/ methods from all categories in metaclass (i.e. class methods)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3407
    "/ EXCEPT: the version method is placed at the very end, to
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3408
    "/         avoid sourcePosition-shifts when checked out later.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3409
    "/         (RCS expands this string, so its size is not constant)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3410
    "/
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3411
    collectionOfCategories := meta methodCategories asSortedCollection.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3412
    collectionOfCategories notNil ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3413
        collectionOfCategories do:[:aCategory |
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3414
            meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3415
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3416
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3417
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3418
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3419
    "/ methods from all categories in myself
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3420
    "/
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3421
    collectionOfCategories := self methodCategories asSortedCollection.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3422
    collectionOfCategories notNil ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3423
        collectionOfCategories do:[:aCategory |
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3424
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3425
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3426
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3427
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3428
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3429
    "/ any private classes' methods
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3430
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3431
    self privateClassesSorted do:[:aClass |
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3432
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3433
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3434
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3435
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3436
    initIt ifTrue:[
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3437
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3438
        "/ optionally an initialize message
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3439
        "/
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3440
        (meta includesSelector:#initialize) ifTrue:[
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3441
            aStream nextPutLine:'<initialize>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3442
            aStream nextPutAll:'<class-id>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3443
            aStream nextPutAll:(self name).
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3444
            aStream nextPutLine:'</class-id>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3445
            aStream nextPutLine:'</initialize>'.
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3446
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3447
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3448
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3449
    aStream nextPutLine:'</st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3450
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3451
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3452
     Class
15160
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3453
        fileOutXMLOn:'test.xml' asFilename writeStream
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3454
        withTimeStamp:true
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3455
        withInitialize:true
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3456
        withDefinition:true
a936839c7675 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 15104
diff changeset
  3457
        methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3458
    "
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3459
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3460
    "Modified: / 05-07-2017 / 10:50:57 / cg"
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3461
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3462
22659
1fe75ac33b44 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 22558
diff changeset
  3463
23373
9d9354d2634d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23248
diff changeset
  3464
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3465
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3466
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3467
htmlDocumentation
8356
96c5195d52c7 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8285
diff changeset
  3468
    <resource: #obsolete>
7227
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3469
    self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'.
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3470
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3471
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3472
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3473
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3474
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3475
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3476
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3477
    "print the class variable names indented and breaking at line end"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3478
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3479
    self printNameArray:(self classVarNames) on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3480
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3481
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3482
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3483
    "print myself and all subclasses on aStream.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3484
     recursively calls itself to print subclasses.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3485
     Can be used to print hierarchy on the printer."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3486
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3487
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3488
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3489
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3490
    aStream spaces:indent; bold; nextPutAll:nm; normal; nextPutAll:' ('.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3491
    self printInstVarNamesOn:aStream indent:(indent + nm size + 2).
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3492
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3493
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3494
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3495
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3496
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3497
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3498
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3499
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3500
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3501
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3502
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3503
    "Modified: 13.12.1996 / 14:13:06 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3504
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3505
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3506
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3507
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3508
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3509
    |comment s superclass|
333
claus
parents: 328
diff changeset
  3510
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3511
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3512
    aPrintStream nextPutAll:'superclass           '.
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3513
    superclass := self superclass.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3514
    superclass isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3515
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3516
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3517
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3518
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3519
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3520
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3521
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3522
    self printInstVarNamesOn:aPrintStream indent:21.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3523
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3524
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3525
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3526
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3527
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3528
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3529
    category notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3530
	aPrintStream nextPutAll:'category             ';
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3531
		     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3532
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3533
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3534
    (comment := self comment) notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3535
	aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3536
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3537
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3538
    "Created: 10.12.1995 / 16:30:47 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3539
    "Modified: 9.11.1996 / 00:13:37 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3540
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3541
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3542
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3543
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3544
    "print out all methods on aPrintStream which should be a printStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3545
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3546
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3547
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3548
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3549
    aPrintStream cr.
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3550
    collectionOfCategories := self class methodCategories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3551
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3552
        aPrintStream nextPutLine:'class protocol'.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3553
        aPrintStream cr.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3554
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3555
            self class printOutCategory:aCategory on:aPrintStream
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3556
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3557
    ].
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3558
    collectionOfCategories := self methodCategories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3559
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3560
        aPrintStream nextPutLine:'instance protocol'.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3561
        aPrintStream cr.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3562
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3563
            self printOutCategory:aCategory on:aPrintStream
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3564
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3565
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3566
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3567
    "Modified: / 05-07-2017 / 10:51:01 / cg"
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3568
!
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3569
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3570
printOutProtocolOn:aPrintStream
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3571
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3572
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3573
    |collectionOfCategories|
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3574
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3575
    self printOutDefinitionOn:aPrintStream.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3576
    aPrintStream cr.
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3577
    collectionOfCategories := self class methodCategories asSortedCollection.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3578
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3579
        aPrintStream nextPutLine:'class protocol'.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3580
        aPrintStream cr.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3581
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3582
            self class printOutCategoryProtocol:aCategory on:aPrintStream
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3583
        ]
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3584
    ].
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3585
    collectionOfCategories := self methodCategories asSortedCollection.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3586
    collectionOfCategories notNil ifTrue:[
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3587
        aPrintStream nextPutLine:'instance protocol'.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3588
        aPrintStream cr.
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3589
        collectionOfCategories do:[:aCategory |
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3590
            self printOutCategoryProtocol:aCategory on:aPrintStream
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3591
        ]
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3592
    ]
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3593
21981
e9d55847a18c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21841
diff changeset
  3594
    "Modified: / 05-07-2017 / 10:51:07 / cg"
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3595
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3596
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3597
printSharedPoolNamesOn:aStream indent:indent
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3598
    "print the pool names indented and breaking at line end"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3599
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3600
    self printNameArray:(self sharedPoolNames) on:aStream indent:indent
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3601
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3602
    "Modified: / 18-01-2011 / 17:56:16 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3603
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3604
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3605
storeOn:aStream
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3606
    "append my name only - expects class to be there, when restoring"
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3607
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3608
    aStream nextPutAll:self name
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3609
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3610
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3611
!Class methodsFor:'private-accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3612
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3613
attributes
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3614
    "return the extra class attributes or nil"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3615
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3616
    attributes isNil ifTrue:[^ nil].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3617
    ^ self classAttributes
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3618
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3619
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3620
attributes:aClassAttributesObject
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3621
    "set the extra class attributes"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3622
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3623
    self classAttributes:aClassAttributesObject
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3624
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3625
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3626
classAttributes
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3627
    "return the extra class attributes or create them if nil.
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3628
     Notice that the stc-compiler is too stupid to generate instances of ClassAttributes directly;
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3629
     therefore, it generates arrays which are converted here, when we first access the attribute."
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3630
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3631
    attributes isNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3632
	attributes := ClassAttributes new.
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3633
    ] ifFalse:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3634
	attributes isArray ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3635
	    attributes := ClassAttributes new fromSTCPrimitiveArray:attributes.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3636
	].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3637
    ].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3638
    ^ attributes
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3639
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3640
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3641
classAttributes:aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3642
    "set the extra class attributes"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3643
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3644
    attributes := aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3645
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3646
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3647
flushSubclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3648
    subclasses := nil
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3649
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3650
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3651
getAttribute:aKey
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3652
    "get an attribute (by symbolic key)"
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3653
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3654
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3655
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3656
    attributes isNil ifTrue:[ ^ nil].
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  3657
    ^ self classAttributes valueFor:aKey
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  3658
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  3659
    "Modified: / 23-09-2011 / 10:23:45 / cg"
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3660
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3661
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3662
getSourceChunkAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3663
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3664
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3665
    |pos stream string|
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3666
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3667
    pos := self getAttribute:aKey.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3668
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3669
    "the attribute is either a string, or an integer specifying the
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3670
     position within the classes sourcefile ..."
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3671
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3672
    pos isNumber ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3673
"/        classFilename notNil ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3674
            stream := self sourceStream.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3675
            stream notNil ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3676
                stream position:pos.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3677
                string := stream nextChunk.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3678
                stream close.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3679
                ^ string
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3680
            ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3681
"/        ].
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  3682
        ^ nil
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3683
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3684
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3685
    ^ pos
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3686
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3687
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3688
setAttribute:key to:aValue
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3689
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3690
16227
a910414add83 class: Class
Claus Gittinger <cg@exept.de>
parents: 16049
diff changeset
  3691
    self classAttributes perform:key asMutator with:aValue
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3692
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3693
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3694
setName:aString
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3695
    "set the classes name - be careful, it will be still
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3696
     in the Smalltalk dictionary - under another key.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3697
     This is NOT for general use - see renameTo:"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3698
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3699
    environment := nil.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3700
    name := aString
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3701
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3702
    "Created: 1.4.1997 / 15:46:01 / stefan"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3703
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3704
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3705
setPrimitiveDefinitions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3706
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3707
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3708
    "set the primitiveDefinition string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3709
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3710
    ^ self setAttribute:#primitiveDefinitions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3711
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3712
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3713
setPrimitiveFunctions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3714
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3715
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3716
    "set the primitiveFunction string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3717
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3718
    ^ self setAttribute:#primitiveFunctions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3719
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3720
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3721
setPrimitiveVariables:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3722
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3723
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3724
    "set the primitiveVariable string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3725
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3726
    ^ self setAttribute:#primitiveVariables to:aString
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3727
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3728
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3729
setSharedPoolNames:aStringOrCollection
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3730
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3731
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3732
    "set the sharedPools string (no change notifications)"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3733
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3734
    ^ self setAttribute:#sharedPools to:aStringOrCollection
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3735
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3736
    "Created: / 18-01-2011 / 20:41:09 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3737
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3738
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3739
setSubclasses:aCollection
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3740
    subclasses := aCollection
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3741
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3742
    "Created: / 28-04-2010 / 08:48:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3743
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3744
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3745
updateAllCachedSubclasses
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3746
    |subclassesPerClass seqNr makeNewSet|
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3747
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3748
    makeNewSet := [Set new].
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3749
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3750
    subclassesPerClass := Dictionary new.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3751
    Smalltalk allClassesDo:[:each |
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3752
	|cls superclass|
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3753
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3754
	cls := each theNonMetaclass.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3755
	(superclass := each superclass) notNil ifTrue:[
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3756
	    (subclassesPerClass at:superclass ifAbsentPut:makeNewSet) add:cls
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3757
	].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3758
	subclassesPerClass at:cls ifAbsentPut:makeNewSet.
12689
834adbd43cc1 comment/format in: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12633
diff changeset
  3759
    ].
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3760
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3761
    SubclassCacheSequenceNumber isNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3762
	SubclassCacheSequenceNumber := 0.
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3763
    ].
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  3764
    seqNr := SubclassCacheSequenceNumber.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3765
    subclassesPerClass keysAndValuesDo:[:cls :subclasses |
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3766
	|coll|
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3767
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3768
	coll := ArrayWithSequenceNumberValidation withAll:subclasses.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3769
	coll sequenceNumber:seqNr.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3770
	cls setSubclasses:coll.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3771
    ].
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3772
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3773
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3774
     Class updateAllCachedSubclasses
13861
9630807c9d21 subclassinfo
Claus Gittinger <cg@exept.de>
parents: 13860
diff changeset
  3775
     Array subclasses
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3776
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3777
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3778
    "Created: / 28-04-2010 / 08:47:20 / cg"
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3779
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3780
7258
9ccdbee7d1ad method category rename
Claus Gittinger <cg@exept.de>
parents: 7227
diff changeset
  3781
!Class methodsFor:'private-changes management'!
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3782
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3783
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3784
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3785
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3786
    "append a category change record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3787
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3788
    self printClassNameOn:aStream.
14146
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  3789
    aStream nextPutAll:' category:'.
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  3790
    category storeOn:aStream.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3791
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3792
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3793
    "Created: 3.12.1995 / 13:43:33 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3794
    "Modified: 3.12.1995 / 14:10:34 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3795
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3796
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3797
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3798
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3799
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3800
    "append a class-definition-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3801
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3802
    aClass isLoaded ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3803
	aClass basicFileOutDefinitionOn:aStream withNameSpace:true.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3804
	aStream nextPutChunkSeparator.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3805
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3806
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3807
    "Created: 3.12.1995 / 13:57:44 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3808
    "Modified: 3.12.1995 / 14:11:26 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3809
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3810
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3811
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3812
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3813
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3814
    "append a class-comment-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3815
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3816
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3817
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3818
    "Modified: 4.3.1996 / 16:49:08 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3819
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3820
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3821
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3822
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3823
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3824
    "append an instvars-record to aStream"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3825
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  3826
    aClass class fileOutClassInstVarDefinitionOn:aStream withNameSpace:true.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3827
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3828
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3829
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3830
addChangeRecordForClassRemove:oldClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3831
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3832
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3833
    "append a class-remove-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3834
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3835
    aStream
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3836
	nextPutAll:'Smalltalk removeClass:';
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3837
	nextPutAll:oldClass name;
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3838
	nextPutChunkSeparator.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3839
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3840
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3841
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3842
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3843
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3844
    "append a class-rename-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3845
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  3846
    aStream
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3847
        nextPutAll:'Smalltalk renameClass:';
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3848
        nextPutAll:oldName;
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3849
        nextPutAll:' to:''';
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3850
        nextPutAll:newName;
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3851
        nextPut:$';
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3852
        nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3853
14149
9e1500b191f7 changed: #addChangeRecordForClassRename:to:to:
Claus Gittinger <cg@exept.de>
parents: 14147
diff changeset
  3854
    "Modified: / 01-06-2012 / 09:44:04 / cg"
21485
160832bf80c3 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 21469
diff changeset
  3855
    "Modified: / 17-02-2017 / 10:54:03 / stefan"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3856
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3857
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3858
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3859
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3860
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3861
    "append a primitiveDefinitions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3862
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3863
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:''';
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3864
	    nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3865
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3866
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3867
    "Modified: 9.11.1996 / 00:09:54 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3868
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3869
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3870
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3871
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3872
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3873
    "append a primitiveFunctions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3874
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3875
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:''';
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3876
	    nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3877
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3878
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3879
    "Modified: 9.11.1996 / 00:10:02 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3880
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3881
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3882
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3883
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3884
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3885
    "append a primitiveVariables-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3886
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3887
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:''';
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3888
	    nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3889
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3890
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3891
    "Modified: 9.11.1996 / 00:10:10 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3892
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3893
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3894
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3895
9815
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3896
canHaveExtensions
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3897
    "return true, if this class allows extensions from other packages.
20784
649cf068fc09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20618
diff changeset
  3898
     Private classes, namespaces and projectDefinitions don't allow this"
9815
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3899
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3900
    ^ self isPrivate not
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3901
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3902
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3903
     Smalltalk allClasses select:[:each | each canHaveExtensions not]
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3904
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3905
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3906
    "Created: / 30-08-2006 / 15:27:53 / cg"
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3907
!
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3908
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3909
classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3910
    self isPrivate ifTrue:[
24222
191f8e252c9b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24119
diff changeset
  3911
        ^ self owningClass classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3912
    ].
24222
191f8e252c9b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24119
diff changeset
  3913
    "/ thisContext isRecursive ifTrue:[^ ResourcePack new].
9930
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3914
    ^ ResourcePack for:self cached:true.
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3915
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3916
    "Modified: / 18-09-2006 / 20:37:16 / cg"
24222
191f8e252c9b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24119
diff changeset
  3917
    "Modified: / 28-05-2019 / 19:08:12 / Claus Gittinger"
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3918
!
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3919
16036
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3920
defaultCategoryForUncategorizedClasses
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3921
    "used only when the short scripting class creation messages are used"
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3922
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3923
    ^ DefaultCategoryForUncategorizedClasses ? 'Uncategorized classes'.
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3924
!
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3925
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3926
defaultCategoryForUndeclaredClasses
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3927
    ^ DefaultCategoryForUndeclaredClasses ? '* undeclared classes *'
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3928
!
5f52c6b43b70 class: Class
Claus Gittinger <cg@exept.de>
parents: 16020
diff changeset
  3929
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3930
extensions
17470
563daf06d3a5 class: Class
Claus Gittinger <cg@exept.de>
parents: 17403
diff changeset
  3931
    "return a collection of extension-methods (both class and inst) from any other package, 
563daf06d3a5 class: Class
Claus Gittinger <cg@exept.de>
parents: 17403
diff changeset
  3932
     or empty if there are none.
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3933
     Unassigned methods are ignored"
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3934
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3935
    |classPackage defaultPkg|
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3936
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3937
    classPackage := self package.
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3938
    defaultPkg := PackageId noProjectID.
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3939
    ^ self methodsForWhich:[:mthd | mthd package ~= classPackage and:[ mthd package ~= defaultPkg ]]
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3940
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3941
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3942
     CType extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3943
     Rectangle extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3944
     Rectangle hasExtensions
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3945
     Object extensions
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3946
     Object hasExtensions
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3947
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3948
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3949
    "Created: / 12-10-2006 / 18:29:51 / cg"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3950
    "Modified: / 05-03-2007 / 17:12:04 / cg"
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3951
!
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3952
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3953
extensionsFrom:aPackageID
17470
563daf06d3a5 class: Class
Claus Gittinger <cg@exept.de>
parents: 17403
diff changeset
  3954
    "return the set of extension-methods (both class and inst) from the given package."
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3955
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3956
    aPackageID = self package ifTrue:[^ #() ].
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3957
    ^ self methodsForWhich:[:mthd | mthd package = aPackageID]
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3958
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3959
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3960
     CType extensionsFrom:#'bosch:dapasx'
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3961
     Rectangle extensionsFrom:#'bosch:dapasx/support'
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3962
     Rectangle extensions
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3963
     Class extensions
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3964
     Class extensionsFrom:#'stx:libboss'
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3965
    "
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3966
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3967
    "Created: / 07-08-2006 / 22:02:15 / fm"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3968
    "Modified: / 06-03-2007 / 11:54:53 / cg"
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3969
!
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3970
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3971
hasExtensions
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3972
    "return true, if there are methods in the receiver, which belong to
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3973
     a different package (i.e. package of class ~= package of method).
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3974
     Those are class extensions, which must be treated specially when checking classes
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3975
     into the sourceCode repository. (extensions are stored separate).
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3976
     Unassigned extensions are ignored here (i.e. as yet unpackaged changes)"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3977
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3978
    |clsPkg defaultPkg|
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3979
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3980
    defaultPkg := PackageId noProjectID.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3981
    clsPkg := self package.
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3982
    self instAndClassMethodsDo:[:mthd |
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3983
        |mthdPkg|
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3984
        (((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ].
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3985
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3986
    ^ false
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3987
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3988
    "
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3989
     Time millisecondsToRun:[
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3990
        Smalltalk allClasses select:[:each | each hasExtensions]
17252
37c4a7debbae class: Class
Claus Gittinger <cg@exept.de>
parents: 17161
diff changeset
  3991
     ].   
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3992
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  3993
     Dictionary
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3994
        withAssociations:
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3995
            (Smalltalk allClasses
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3996
                select:[:each | each hasExtensions]
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  3997
                thenCollect:[:each | each -> each extensions])
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3998
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3999
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  4000
    "Modified: / 05-03-2007 / 17:06:20 / cg"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  4001
!
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  4002
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4003
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4004
    "return true, if there are methods in the receiver, which belong to
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4005
     the package with aPackageID (i.e. package of class ~= package of method).
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4006
     Those are class extensions, which must be treated specially when checking classes
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4007
     into the sourceCode repository. (extensions are stored separate)"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4008
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  4009
    |clsPkg|
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  4010
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  4011
    clsPkg := self package.
14146
94acb9d1afc8 changed:9 methods - lint
Stefan Vogel <sv@exept.de>
parents: 14000
diff changeset
  4012
    aPackageID = clsPkg ifTrue:[^ false].
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  4013
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4014
    self instAndClassMethodsDo:[:mthd |
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4015
	mthd package = aPackageID ifTrue:[ ^ true].
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  4016
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  4017
    ^ false
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4018
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4019
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4020
     Smalltalk allClasses
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4021
	select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser']
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4022
     Smalltalk allClasses
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4023
	select:[:each | each hasExtensionsFrom:'stx:libboss']
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4024
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  4025
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  4026
    "Modified: / 06-03-2007 / 11:55:39 / cg"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4027
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  4028
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4029
hasUnassignedExtensions
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4030
    "return true, if there are methods in the receiver, which have not been
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4031
     assigned to any package."
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4032
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4033
    ^ self unassignedExtensions notEmpty
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4034
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4035
    "
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4036
     Time millisecondsToRun:[
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4037
        Smalltalk allClasses select:[:each | each hasUnassignedExtensions]
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4038
     ]. 190 130 260
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4039
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4040
     Dictionary
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4041
        withAssociations:
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4042
            (Smalltalk allClasses
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4043
                select:[:each | each hasUnassignedExtensions]
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4044
                thenCollect:[:each | each -> each unassignedExtensions])
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4045
    "
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4046
!
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4047
12415
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4048
hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4049
    "return true, if there are changes for this class in the current changeSet"
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4050
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4051
    ^ ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:self
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4052
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4053
    "
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4054
     Class hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4055
     Array hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4056
    "
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4057
!
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  4058
10042
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4059
isBrowserStartable
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4060
    "return true, if this is an application class,
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4061
     which can be started from the browser"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4062
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4063
    ^ self isVisualStartable or:[self isStartableWithStart or:[ self isStartableWithMain ]]
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4064
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4065
    "Created: / 06-10-2006 / 11:34:28 / cg"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4066
!
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  4067
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4068
isClass
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4069
    "return true, if the receiver is some kind of class
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4070
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4071
     true is returned here - the method is redefined from Object.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4072
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4073
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4074
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4075
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4076
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4077
     Point isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4078
     1 isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4079
     Behavior new isBehavior
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4080
     Behavior new isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4081
     Class new isBehavior
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4082
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4083
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4084
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4085
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  4086
isJavaScriptClass
8936
e098919f2f79 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8933
diff changeset
  4087
    ^ self class isJavaScriptMetaclass
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  4088
!
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  4089
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4090
isStartableWithMain
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4091
    "return true, if this is an application class,
20574
0826ff286ea3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20517
diff changeset
  4092
     which can be started via #main / #main:"
0826ff286ea3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20517
diff changeset
  4093
0826ff286ea3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20517
diff changeset
  4094
    ^ (self theMetaclass includesSelector:#main)
0826ff286ea3 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20517
diff changeset
  4095
     or:[ self theMetaclass includesSelector:#main: ]
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4096
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4097
    "Created: / 2.11.2001 / 09:37:01 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4098
    "Modified: / 2.11.2001 / 09:48:05 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4099
!
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  4100
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4101
isStartableWithStart
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4102
    "return true, if this is an application class,
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4103
     which can be started via #start"
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4104
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4105
    ^ self theMetaclass includesSelector:#start
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4106
!
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  4107
21606
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4108
logFacility
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4109
    "the 'log facility';
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4110
     this is used by the Logger both as a prefix to the log message, 
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4111
     and maybe (later) used to filter and/or control per-facility log thresholds.
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4112
     The default here is to base the facility on the package:
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4113
     if the class is anywhere in the base ST/X system, 'STX' is returned as facility.
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4114
     Otherwise, the last component of the package name is returned."
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4115
     
25211
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4116
    |pkg facility|
21606
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4117
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4118
    ((pkg := self package ? '???') startsWith:'stx:') ifTrue:[
25216
5f46112b670b #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 25211
diff changeset
  4119
        facility := 'STX'
25211
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4120
    ] ifFalse:[
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4121
        facility :=  pkg copyFrom:((pkg lastIndexOf:$:) + 1)
21606
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4122
    ].
25216
5f46112b670b #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 25211
diff changeset
  4123
    ^ facility "/ ,'.',self nameWithoutPrefix
25211
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4124
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4125
    "
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4126
     Array logFacility           
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4127
     Array class logFacility     
21606
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4128
     Class new logFacility
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4129
     Behavior new logFacility
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4130
25211
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4131
     Expecco::Browser logFacility  
755d30f833cb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 25208
diff changeset
  4132
     Workflow::Executor logFacility 
21606
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4133
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4134
     Array package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4135
     Array class package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4136
     Class new package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4137
     Behavior new package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4138
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4139
     Expecco::Browser package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4140
     Workflow::Executor package
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4141
    "
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4142
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4143
    "Created: / 01-03-2017 / 10:32:39 / cg"
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4144
!
d8639d4653d5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21485
diff changeset
  4145
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4146
methodsForWhich:aFilter
17470
563daf06d3a5 class: Class
Claus Gittinger <cg@exept.de>
parents: 17403
diff changeset
  4147
    "return a collection of methods (both class and inst) for which aFilter returns true"
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4148
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4149
    |matching|
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4150
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4151
    self instAndClassMethodsDo:[:mthd |
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4152
        (aFilter value:mthd) ifTrue:[
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4153
            matching isNil ifTrue:[
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4154
                matching := OrderedCollection new.
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4155
            ].
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4156
            matching add:mthd
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4157
        ].
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4158
    ].
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4159
    ^ matching ? #()
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4160
!
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4161
16465
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4162
methodsWithAnyResource:aResourceSymbolCollection
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4163
    |methods|
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4164
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4165
    methods := OrderedCollection new.
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4166
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4167
    self withAllSuperclassesDo:[:eachClass|
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4168
        eachClass instAndClassMethodsDo:[:eachMethod|
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4169
            (eachMethod hasAnyResource:aResourceSymbolCollection) ifTrue:[
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4170
                methods add:eachMethod.
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4171
            ].
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4172
        ].
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4173
    ].
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4174
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4175
    ^ methods
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4176
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4177
    "
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4178
        ApplicationModel methodsWithAnyResource:#(fontSpec)
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4179
    "
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4180
!
c3666f7943af class: Class
Stefan Vogel <sv@exept.de>
parents: 16273
diff changeset
  4181
11382
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4182
packageDirectory
11413
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  4183
    "return the packageDirectory of this classes package.
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  4184
     That is usually the directory where my source is, and where package specific additional
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  4185
     files (bitmaps, resources etc.) are found."
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  4186
11382
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4187
    ^ Smalltalk getPackageDirectoryForPackage:self package.
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4188
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4189
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4190
      self packageDirectory
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4191
      stx_libbasic3 packageDirectory
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4192
      Array packageDirectory
11382
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4193
    "
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4194
!
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  4195
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4196
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4197
    "return a collection of classes which have a nil superclass"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4198
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4199
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4200
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4201
    set := IdentitySet new.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4202
    Smalltalk allClassesDo:[:aClass |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4203
	aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4204
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4205
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4206
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4207
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4208
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4209
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4210
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4211
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4212
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  4213
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4214
unassignedExtensions
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4215
    "return a collection of methods which have not been assigned to any
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4216
     any package, or empty if there are none."
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4217
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4218
    |noPackage|
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4219
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4220
    noPackage := PackageId noProjectID.
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4221
    ^ self methodsForWhich:[:mthd | mthd package == noPackage ]
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4222
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4223
    "
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4224
     SchemeBoolean unassignedExtensions
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4225
    "
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4226
!
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  4227
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4228
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4229
    "return true, if this class came into the system via an
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4230
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4231
     This is not an attribute of the class, but instead remembered in
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4232
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4233
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4234
    ^ Autoload wasAutoloaded:self
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4235
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4236
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4237
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4238
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4239
whichClassDefinesClassVar:aVariableName
19834
b9fe049ed8c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19641
diff changeset
  4240
    "return the class which defines the class variable named aVariableName."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4241
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4242
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4243
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4244
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4245
    [cls notNil] whileTrue:[
19834
b9fe049ed8c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19641
diff changeset
  4246
        (cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
b9fe049ed8c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19641
diff changeset
  4247
        cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4248
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4249
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4250
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4251
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4252
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4253
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4254
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4255
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4256
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4257
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4258
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4259
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4260
    "make a private class of newOwner from the receiver;
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  4261
     the receiver must be a public class.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4262
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4263
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4264
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4265
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4266
    self owningClass notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4267
	^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4268
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4269
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4270
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4271
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4272
    newClass := self superclass
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4273
	perform:sel
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4274
	withArguments:(Array
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4275
			with:(self nameWithoutPrefix asSymbol)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4276
			with:(self instanceVariableString)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4277
			with:(self classVariableString)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4278
			with:''
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4279
			with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4280
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4281
    "/ copy over methods ...
6023
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  4282
    ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  4283
    ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4284
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4285
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4286
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4287
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4288
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4289
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4290
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4291
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4292
3494
23a6cf28b3a6 fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents: 3407
diff changeset
  4293
    "Modified: / 29.5.1998 / 19:03:49 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4294
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4295
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4296
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4297
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4298
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4299
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4300
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4301
    ^ self makePublicIn:Smalltalk
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4302
!
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4303
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4304
makePublicIn:newNameSpace
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4305
    "make a public class from the receiver.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4306
     The receiver must be a private class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4307
     Returns the new public class."
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4308
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4309
    |sel owner baseName newName newClass|
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4310
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4311
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4312
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4313
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4314
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4315
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4316
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4317
    Class nameSpaceQuerySignal answer:newNameSpace
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  4318
    do:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4319
	baseName := self nameWithoutPrefix.
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4320
"/        (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4321
"/            newName := baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4322
"/        ] ifFalse:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4323
"/            newName := newNameSpace name , '::' , baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4324
"/        ].
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4325
	newName := baseName.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4326
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4327
	newClass := self superclass
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4328
	    perform:sel
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4329
	    withArguments:(Array
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4330
			    with:(newName asSymbol)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4331
			    with:(self instanceVariableString)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4332
			    with:(self classVariableString)
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4333
			    with:''
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4334
			    with:(owner category)).
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4335
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4336
	"/ copy over methods ...
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4337
	ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4338
	ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4339
	newClass class recompileInvalidatedMethods.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4340
	newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  4341
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4342
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4343
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4344
    Smalltalk changed:#newClass with:newClass.
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4345
    (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4346
	newNameSpace changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  4347
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4348
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4349
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4350
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4351
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4352
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4353
    "Created: / 23-06-1997 / 13:28:52 / cg"
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  4354
    "Modified: / 04-07-2006 / 16:27:12 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4355
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  4356
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4357
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4358
    "change the name of the class. This does not write a change record."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4359
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  4360
    <resource:#obsolete>
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  4361
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4362
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4363
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4364
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4365
    "/ classVariables, private classes and does not
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  4366
    "/ recompile other classes in order to care for namespace
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4367
    "/ changes.
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  4368
    "/ Please use Smalltalk>>renameClass:to:,
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  4369
    "/ which deals with all of that.
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  4370
    self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'.
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  4371
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4372
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4373
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4374
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4375
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4376
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4377
    Smalltalk removeKey:oldSym.             "26.jun 93"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4378
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4379
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  4380
    "Created: / 1.4.1997 / 15:27:53 / stefan"
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  4381
    "Modified: / 31.7.1998 / 15:21:34 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4382
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4383
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4384
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4385
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4386
classinstSizeFromSignature:aSignature
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4387
    "for checking class compatibility: return some number based on
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4388
     the classinstSize from a signature key (not always the real classinstsize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4389
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4390
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4391
12840
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4392
    "
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4393
     Class classinstSizeFromSignature:16r100. 2
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4394
     Class classinstSizeFromSignature:16r180. 3
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4395
    "
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4396
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4397
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4398
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4399
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4400
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4401
    "for checking class compatibility: return a number based on the
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4402
     names and order of the instance variables from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4403
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4404
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4405
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4406
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4407
     Point instNameKeyFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4408
     Association instNameKeyFromSignature:Association signature.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4409
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4410
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4411
    "Created: 1.4.1997 / 15:23:07 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4412
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4413
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4414
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4415
    "for checking class compatibility: return the some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4416
     the instSize from a signature key (not always the real instSize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4417
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4418
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4419
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4420
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4421
     Class instSizeFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4422
     Class instSizeFromSignature:Association signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4423
     Class instSizeFromSignature:Dictionary signature.
12840
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4424
     Class instSizeFromSignature:16r100.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4425
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4426
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4427
    "Created: 1.4.1997 / 15:23:15 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4428
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4429
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4430
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4431
    "for checking class compatibility: return some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4432
     the instType (i.e. variableBytes/Pointers etc.) from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4433
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4434
    ^ (aSignature bitShift:-10) bitAnd:(Class maskIndexType)
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4435
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4436
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4437
     Class instTypeFromSignature:Object signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4438
     Class instTypeFromSignature:Array signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4439
     Class instTypeFromSignature:String signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4440
     Class instTypeFromSignature:OrderedCollection signature.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4441
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4442
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4443
    "Created: 1.4.1997 / 15:23:20 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4444
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4445
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4446
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4447
    "return a signature number - this number is useful for a quick
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4448
     check for changed classes, and is done in the binary-object loader,
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4449
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4450
     Do NOT change the algorithm here - others may depend on it.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4451
     Also, the algorithm may change - so never interpret the returned value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4452
     (if at all, use the access #XXXFromSignature: methods)"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4453
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4454
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4455
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4456
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4457
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4458
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4459
    value := self flags bitAnd:(Class maskIndexType).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4460
    value := (value bitShift:3) + ((self class instSize - Class instSize) bitAnd:7).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4461
    value := (value bitShift:7) + (self instSize bitAnd:16r7F).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4462
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4463
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4464
    self allInstVarNames do:[:name |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4465
	nameKey := nameKey bitShift:1.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4466
	(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4467
	    nameKey := nameKey bitXor:1.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4468
	    nameKey := nameKey bitAnd:16rFFFF.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4469
	].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4470
	nameKey := (nameKey + (name at:1) codePoint) bitAnd:16rFFFF.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4471
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4472
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4473
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4474
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4475
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4476
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4477
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4478
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4479
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4480
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4481
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4482
    "Created: 1.4.1997 / 15:23:24 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4483
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4484
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4485
!Class methodsFor:'source management'!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4486
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4487
binaryRevision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4488
    "return the revision-ID from which the class was stc-compiled;
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  4489
     nil if it's an autoloaded or filedIn class.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4490
     If a classes binary is up-to-date w.r.t. the source repository,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4491
     the returned string is the same as the one returned by #revision."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4492
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4493
    |owner manager info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4494
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4495
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4496
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4497
    revision notNil ifTrue:[
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4498
        c := revision first.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4499
        c == $$ ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4500
            manager := self sourceCodeManagerFromBinaryRevision.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4501
            manager notNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4502
                info := manager revisionInfoFromString:revision.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4503
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4504
            info isNil ifTrue:[^ '0'].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4505
            ^ (info revision) ? '0'.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4506
        ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4507
        c isDigit ifFalse:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4508
            ^ '0'
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4509
        ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4510
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4511
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4512
    ^ revision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4513
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4514
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4515
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4516
     Object class binaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4517
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4518
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4519
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4520
     to find all classes which are not up-to-date:
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4521
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4522
     |classes|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4523
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4524
     classes := Smalltalk allClasses
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4525
                    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4526
     SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4527
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4528
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4529
    "Created: / 07-12-1995 / 10:58:47 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4530
    "Modified: / 01-04-1997 / 23:33:01 / stefan"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4531
    "Modified: / 22-10-2008 / 20:37:05 / cg"
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4532
    "Modified: / 23-01-2012 / 19:38:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  4533
    "Modified (comment): / 13-02-2017 / 19:57:40 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4534
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4535
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4536
binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4537
    "return the revision-ID from which the class was stc-compiled;
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  4538
     nil if it's an autoloaded or filedIn class.
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4539
     If a classes binary is up-to-date w.r.t. the source repository,
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4540
     the returned string is the same as the one returned by #revision."
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4541
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4542
    ^ revision
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4543
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4544
    "
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4545
     Object binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4546
     Object class binaryRevisionString
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4547
    "
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4548
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4549
    "
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4550
     to find all classes which are not up-to-date:
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4551
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4552
     |classes|
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4553
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4554
     classes := Smalltalk allClasses
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  4555
                    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4556
     SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4557
    "
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4558
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4559
    "Modified: / 01-04-1997 / 23:33:01 / stefan"
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4560
    "Modified: / 22-10-2008 / 20:37:05 / cg"
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4561
    "Created: / 01-07-2011 / 10:55:03 / cg"
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  4562
    "Modified (comment): / 13-02-2017 / 19:57:44 / cg"
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4563
!
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  4564
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4565
currentSourceStream
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4566
    "return an open stream on the current source of the receiver"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4567
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4568
    |theWriteStream theCurrentSource|
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4569
8222
f2c454a9a038 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 8212
diff changeset
  4570
    theWriteStream := String writeStream.
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4571
    Method flushSourceStreamCache.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4572
    self fileOutOn:theWriteStream withTimeStamp:false.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4573
    theCurrentSource := theWriteStream contents asString.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4574
    theWriteStream close.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4575
    ^ theCurrentSource
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4576
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4577
    "Modified: 15.10.1996 / 18:59:40 / cg"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4578
    "Modified: 1.4.1997 / 14:33:12 / stefan"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4579
!
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4580
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4581
findVersionMethod
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4582
    "{ Pragma: +optSpace }"
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4583
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4584
    "return my revision method. Either this is the sourceCodeManager-specific versionMethod,
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4585
     or the fallBack (for backward compatibility)"
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4586
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4587
    |owner|
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4588
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4589
    (owner := self owningClass) notNil ifTrue:[^ owner findVersionMethod].
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4590
    ^ self findVersionMethodOfManager:self sourceCodeManagerFromBinaryRevision
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4591
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4592
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4593
     Smalltalk allClassesDo:[:cls |
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4594
        Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4595
     ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4596
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4597
     Number findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4598
     FileDirectory findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4599
     Metaclass findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4600
     Class findVersionMethod
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4601
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4602
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4603
    "Modified: / 19-04-2011 / 13:30:42 / cg"
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  4604
    "Modified: / 19-07-2013 / 22:11:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4605
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4606
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4607
findVersionMethodOfManager:aSourceCodemanagerOrNil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4608
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4609
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4610
    "return my revision method. Either this is the sourceCodeManager-specific versionMethod,
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4611
     or the fallBack (for backward compatibility)"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4612
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4613
    |owner cls meta allVersionMethodNames nameOfVersionMethodForManager nameOfOldVersionMethod
14228
48b79a50c1e7 changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents: 14149
diff changeset
  4614
     tryVersionFromVersionMethod prefixOfVersionMethodSelector|
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4615
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4616
    (owner := self owningClass) notNil ifTrue:[^ owner findVersionMethodOfManager:aSourceCodemanagerOrNil].
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4617
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4618
    tryVersionFromVersionMethod :=
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4619
	[:versionMethodsName |
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4620
	    |aVersionMethod val|
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4621
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4622
	    aVersionMethod := meta compiledMethodAt:versionMethodsName.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4623
	    (aVersionMethod notNil and:[aVersionMethod isExecutable]) ifTrue:[
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4624
		"/
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4625
		"/ if it's a method returning the version string,
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4626
		"/ that's the returned value
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4627
		"/
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4628
		val := cls perform:versionMethodsName.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4629
		val isString ifTrue:[^ aVersionMethod].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4630
	    ].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4631
	].
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4632
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4633
    meta := self theMetaclass.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4634
    cls := self theNonMetaclass.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4635
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4636
    prefixOfVersionMethodSelector :=
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4637
	AbstractSourceCodeManager notNil
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4638
	    ifTrue: [AbstractSourceCodeManager prefixOfVersionMethodSelector ]
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4639
	    ifFalse:[ 'version_' ].     "/ sigh - for standalone apps without libbasic3
14228
48b79a50c1e7 changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents: 14149
diff changeset
  4640
48b79a50c1e7 changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents: 14149
diff changeset
  4641
    allVersionMethodNames := meta methodDictionary keys select:[:sel | sel startsWith:prefixOfVersionMethodSelector].
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4642
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4643
    aSourceCodemanagerOrNil notNil ifTrue:[
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4644
	nameOfVersionMethodForManager := aSourceCodemanagerOrNil nameOfVersionMethodInClasses.
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4645
	(allVersionMethodNames includes:nameOfVersionMethodForManager) ifTrue:[
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4646
	    tryVersionFromVersionMethod value:nameOfVersionMethodForManager
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4647
	].
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4648
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4649
	"/ only trust the oldVersion method, iff there is no other scv-version
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4650
	"/ (i.e. do not misuse an svn-checked-in #version as a version_cvs)
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4651
	(allVersionMethodNames copyWithout:nameOfVersionMethodForManager) notEmpty ifTrue:[
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4652
	    ^ nil
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4653
	].
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4654
    ].
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4655
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4656
    nameOfOldVersionMethod := self nameOfOldVersionMethod.
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4657
    tryVersionFromVersionMethod value:nameOfOldVersionMethod.
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  4658
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4659
    ^ nil.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4660
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4661
    "
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4662
     Smalltalk allClassesDo:[:cls |
14837
a3ae2a20224b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 14708
diff changeset
  4663
	Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4664
     ].
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4665
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4666
     Number findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4667
     FileDirectory findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4668
     Metaclass findVersionMethod
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  4669
     Class findVersionMethod
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4670
    "
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4671
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4672
    "Created: / 19-04-2011 / 13:30:05 / cg"
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4673
!
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4674
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4675
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4676
    "return an open stream on a local sourcefile, nil if that is not available"
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4677
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  4678
    |fileName info module dir fn package packageDir zar entry|
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4679
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4680
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4681
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4682
    "/ this is still kept in order to find user-private
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4683
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4684
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4685
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4686
    fileName notNil ifTrue:[
22558
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4687
        ^ fileName asFilename readStreamOrNil.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4688
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4689
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4690
    (package := self package) notNil ifTrue:[
22558
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4691
        "/ newest scheme ...
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4692
        packageDir := Smalltalk findPackageDirectoryForPackage:package.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4693
        packageDir notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4694
            "/ present there ?
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4695
            packageDir := packageDir asFilename.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4696
            (fn := packageDir construct:sourceFile) exists ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4697
                ^ fn readStreamOrNil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4698
            ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4699
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4700
            "/ a source subdirectory ?
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4701
            fn := (packageDir construct:'source') construct:sourceFile.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4702
            fn exists ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4703
                ^ fn readStreamOrNil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4704
            ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4705
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4706
            "/ a zip-file ?
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4707
            fn := (packageDir construct:'source.zip').
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4708
            fn exists ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4709
                zar := ZipArchive oldFileNamed:fn.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4710
                zar notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4711
                    entry := zar extract:sourceFile asString:true.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4712
                    entry notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4713
                        ^ entry readStream
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4714
                    ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4715
                ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4716
            ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4717
        ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4718
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4719
        "/ will vanish ...
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4720
        (package includes:$:) ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4721
            package := package asString copyReplaceAll:$: with:$/
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4722
        ] ifFalse:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4723
            package := 'stx/' , package
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4724
        ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4725
        fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4726
        fileName notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4727
            ^ fileName asFilename readStreamOrNil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4728
        ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4729
        (package startsWith:'stx/') ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4730
            fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4731
            fileName notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4732
                ^ fileName asFilename readStreamOrNil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4733
            ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4734
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4735
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4736
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4737
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4738
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4739
    "/ this makes the symbolic links to (or copy of) the source files
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4740
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4741
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4742
    info notNil ifTrue:[
22558
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4743
        module := info at:#module ifAbsent:nil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4744
        module notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4745
            dir := info at:#directory ifAbsent:nil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4746
            dir notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4747
                fn := (module asFilename construct:dir) construct:sourceFile.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4748
                fileName := Smalltalk getSourceFileName:(fn name).
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4749
                fileName notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4750
                    ^ fileName asFilename readStreamOrNil.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4751
                ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4752
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4753
                "/ brand new: look for source/<module>/package.zip
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4754
                "/ containing an entry for <filename>
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4755
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4756
                fn := (module asFilename construct:dir) withSuffix:'zip'.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4757
                fileName := Smalltalk getSourceFileName:(fn name).
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4758
                fileName notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4759
                    zar := ZipArchive oldFileNamed:fileName.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4760
                    zar notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4761
                        entry := zar extract:sourceFile asString:true.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4762
                        entry notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4763
                            ^ entry readStream
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4764
                        ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4765
                    ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4766
                ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4767
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4768
                "/ and also in source/source.zip ...
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4769
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4770
                fileName := Smalltalk getSourceFileName:'source.zip'.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4771
                fileName notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4772
                    zar := ZipArchive oldFileNamed:fileName.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4773
                    zar notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4774
                        entry := zar extract:sourceFile asString:true.
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4775
                        entry notNil ifTrue:[
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4776
                            ^ entry readStream
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4777
                        ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4778
                    ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4779
                ].
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4780
            ]
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4781
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4782
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4783
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4784
22558
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4785
    "Modified: / 18-07-1998 / 22:53:19 / cg"
2b3bb4038438 #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 22374
diff changeset
  4786
    "Modified: / 27-02-2018 / 14:22:18 / stefan"
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4787
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4788
13461
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4789
nameOfOldVersionMethod
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4790
    "this is now more or less obsolete, as multiple sourceCodeManagers might use
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4791
     different version_XXX methods. Currently, we keep this for backward compatibility.
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4792
     As classes are checked in, using the new source code manager, these methods will
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4793
     be removed and replaced by version_XXX methods (one per manager)."
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4794
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4795
    ^ #version
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4796
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4797
    "Modified: / 19-04-2011 / 13:42:18 / cg"
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4798
!
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4799
13461
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4800
nameOfVersionMethod
21327
69016b4e8952 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 20991
diff changeset
  4801
    <resource: #obsolete>
13461
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4802
    "this is now more or less obsolete, as multiple sourceCodeManagers might use
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4803
     different version_XXX methods. Keep this for backward compatibility.
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4804
     As classes are checked in using the new source code manager, these methods will
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4805
     be removed and replaced by version_XXX methods (one per manager)."
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4806
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4807
    self obsoleteMethodWarning.
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4808
    ^ self nameOfOldVersionMethod
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4809
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4810
    "Modified: / 19-04-2011 / 13:42:18 / cg"
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4811
!
ec9713586014 added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13418
diff changeset
  4812
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4813
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4814
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4815
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4816
    "return the sourceCodeInfo, which defines the module and the subdirectory
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4817
     in which the receiver class was built.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4818
     This info is extracted from the package id (which is added to stc-compiled classes).
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4819
     This method is to be obsoleted soon, since the same info is now found
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4820
     in the versionString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4821
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4822
     The info returned consists of a dictionary
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4823
     filled with (at least) values at: #module, #directory and #library.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4824
     If no such info is present in the class, nil is returned.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4825
     (this happens with autoloaded and filed-in classes)
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4826
     Auotloaded classes set their package from the revisionInfo, if present.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4827
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4828
     By convention, this info is encoded in the classes package
20219
09b5f466f6c2 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20108
diff changeset
  4829
     string (which is given as argument to stc) as the last word in parentheses.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4830
     The info consists of 1 to 3 subcomponents, separated by colons.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4831
     The first defines the classes module (i.e. some application identifier),
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4832
     the second defines the subdirectory within that module, the third
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4833
     defines the name of the class library.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4834
     If left blank, the module info defaults to 'stx',
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4835
     the directory info defaults to library name.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4836
     The library name may not be left blank.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4837
     (this is done for backward compatibility,)
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4838
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4839
     For example:
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4840
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4841
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4842
        '....(stx:foo:libbfoo)'                  -> module: stx directory: foo library: libfoo
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4843
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4844
        '....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4845
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4846
     The way how the sourceCodeManager uses this to find the source location
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4847
     depends on the scheme used. For CVS, the module is taken as the -d arg,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4848
     while the directory is prepended to the file name.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4849
     Other schemes may do things differently - these are not yet specified.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4850
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4851
     Caveat:
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4852
        Encoding this info in the package string seems somewhat kludgy.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4853
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4854
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4855
    |owner sourceInfo packageString idx1 idx2
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4856
     moduleString directoryString libraryString components component1 component2 dirComponents mgr|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4857
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4858
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4859
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4860
    package isNil ifTrue:[^ nil].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  4861
    package == (PackageId noProjectID) ifTrue:[^ nil].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4862
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4863
    packageString := package asString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4864
    idx1 := packageString lastIndexOf:$(.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4865
    idx1 ~~ 0 ifTrue:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4866
        idx2 := packageString indexOf:$) startingAt:idx1+1.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4867
        idx2 ~~ 0 ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4868
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4869
        ]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4870
    ] ifFalse:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4871
        sourceInfo := packageString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4872
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4873
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4874
    sourceInfo isNil ifTrue:[^ nil].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4875
    components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:.
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4876
    components isEmpty ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4877
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4878
"/        directoryString := libraryString := ''.
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4879
        ^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4880
    ].
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4881
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4882
    component1 := components at:1.
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4883
    components size == 1 ifTrue:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4884
        "/ a single name given - the module becomes 'stx' or
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4885
        "/ the very first directory component (if such a module exists).
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4886
        "/ If the component includes slashes, its the directory
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4887
        "/ otherwise the library.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4888
        "/
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4889
        dirComponents := Filename components:component1.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4890
        (dirComponents size > 1
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4891
        and:[(mgr := self sourceCodeManager) notNil
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4892
        and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4893
            moduleString := dirComponents first.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4894
            directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4895
        ] ifFalse:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4896
            "/ non-existing; assume directory under the stx package.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4897
            moduleString := 'stx'.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4898
            (component1 startsWith:'stx/') ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4899
                component1 := component1 copyFrom:5
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4900
            ].
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4901
            directoryString := libraryString := component1.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4902
        ].
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4903
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4904
        (libraryString includes:$/) ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4905
            libraryString := libraryString asFilename baseName
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4906
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4907
    ] ifFalse:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4908
        moduleString := component1.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4909
        component2 := components at:2.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4910
        directoryString := component2.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4911
        components size == 2 ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4912
            "/ two components - assume its the module and the directory;
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4913
            "/ the library is assumed to be named after the directory
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4914
            "/ except, if slashes are in the name; then the libraryname
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4915
            "/ is the last component.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4916
            "/
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4917
            libraryString := component2.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4918
            (libraryString includes:$/) ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4919
                libraryString := libraryString asFilename baseName
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4920
            ]
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4921
        ] ifFalse:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4922
            "/ all components given
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4923
            libraryString := components at:3.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4924
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4925
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4926
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4927
    libraryString isEmpty ifTrue:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4928
        directoryString notEmpty ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4929
            libraryString := directoryString asFilename baseName
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4930
        ].
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4931
        libraryString isEmpty ifTrue:[
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4932
            "/ lets extract the library from the liblist file ...
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4933
            libraryString := Smalltalk libraryFileNameOfClass:self.
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4934
            libraryString isNil ifTrue:[^ nil].
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4935
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4936
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4937
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4938
    moduleString isEmpty ifTrue:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4939
        moduleString := 'stx'.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4940
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4941
    directoryString isEmpty ifTrue:[
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4942
        directoryString := libraryString.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4943
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4944
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4945
    ^ IdentityDictionary
15517
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4946
        with:(#module->moduleString)
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4947
        with:(#directory->directoryString)
123a9fc5c713 class: Class
Claus Gittinger <cg@exept.de>
parents: 15466
diff changeset
  4948
        with:(#library->libraryString)
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4949
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4950
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4951
     Object packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4952
     View packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4953
     Model packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4954
     BinaryObjectStorage packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4955
     MemoryMonitor packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4956
     ClockView packageSourceCodeInfo
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4957
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4958
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4959
    "Created: 4.11.1995 / 20:36:53 / cg"
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4960
    "Modified: 19.9.1997 / 10:42:25 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4961
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4962
8770
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4963
projectDirectory
16498
ba6344475657 class: Class
Claus Gittinger <cg@exept.de>
parents: 16465
diff changeset
  4964
    "return my package's/project's directory - that's where the sources, binaries, classLib,
8770
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4965
     resources etc. are typically found."
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4966
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4967
    ^ Smalltalk projectDirectoryForClass:self
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4968
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4969
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4970
     Object projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4971
     View projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4972
     ApplicationModel projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4973
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4974
!
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4975
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4976
resourceDirectory
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4977
    "return the directory where my resource file is supposed to live.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4978
     Here, take the package and assume that a directory named 'resources' exists
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4979
     in my package directory.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4980
     Return nil, if no such directory exists."
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4981
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4982
    ^ Smalltalk resourceDirectoryForPackage:(self package)
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4983
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4984
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4985
     Object resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4986
     View resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4987
     ApplicationModel resourceDirectory
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4988
    "
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4989
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4990
    "Modified: / 19-10-2006 / 23:08:37 / cg"
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4991
!
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4992
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4993
resourcePackName
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4994
    "return the name which is used as the fileNameBase of my resource file.
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4995
     Notice, that this will undergo the same name translation process as
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4996
     done with class-source file names. (see ResourcePack).
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4997
     The default here is the classes name - this can be redefined in classes
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4998
     which want to use another classes resources (NewLauncher -> Launcher)."
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4999
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  5000
    ^ self name
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  5001
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  5002
    "Created: / 29-01-1998 / 22:20:12 / cg"
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  5003
    "Modified: / 19-10-2006 / 23:11:57 / cg"
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  5004
!
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  5005
8267
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5006
resourcePackage
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5007
    "return the package from where my resources are loaded.
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5008
     By default, that is the classes package."
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5009
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5010
    ^ self package
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5011
!
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  5012
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5013
revision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5014
    "return the revision-ID of the class which corresponds to the
13474
Claus Gittinger <cg@exept.de>
parents: 13461
diff changeset
  5015
     scm-version-id of the source to which this class is equivalent.
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5016
     The class's default source code manager is asked here.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5017
     Initially, this is the same as #binaryRevision; however, once changes have
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5018
     been checked into a source repository, the binary continues to remain based upon
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5019
     the old revision, while logically, the class has the new (checked-in) revision.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5020
     To check if a source corresponds to a compiled binary, compare this
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5021
     ID with the one returned by #binaryRevision."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5022
22374
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5023
    |mgr|
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5024
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5025
    mgr := self sourceCodeManager.
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5026
    mgr isNil ifTrue:[
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5027
        AbstractSourceCodeManager notNil ifTrue:[
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5028
            mgr := AbstractSourceCodeManager defaultManager.
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5029
        ].    
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5030
        mgr isNil ifTrue:[
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5031
            mgr := CVSSourceCodeManager.
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5032
        ].    
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5033
    ].    
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5034
    ^ self revisionOfManager:mgr
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5035
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5036
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5037
     Object revision
22374
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5038
     Expecco::ReportParameterEditorForProjects revision
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5039
     Expecco::ReportParameterEditorForProjects sourceCodeManager
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5040
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5041
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5042
    "Created: / 11-11-1995 / 14:27:20 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5043
    "Modified: / 26-03-1997 / 00:14:00 / stefan"
22374
21349f18c5f9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22364
diff changeset
  5044
    "Modified: / 21-11-2017 / 18:34:08 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5045
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5046
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5047
revisionDate
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5048
    "return the revision-Date of the class as date or nil.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5049
     This is extracted from the version string."
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5050
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5051
    |info dateString date|
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5052
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5053
    info := self revisionInfo.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5054
    info isNil ifTrue:[^ nil].
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5055
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5056
    dateString := info date.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5057
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5058
    ('[12][7890][0-9][0-9]/[0-1][0-9]/[0-3][0-9]' match:dateString) ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5059
        date := Date readFrom:dateString format:'%y/%m/%d'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5060
    ] ifFalse:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5061
        ('[12][7890][0-9][0-9]-[0-1][0-9]-[0-3][0-9]' match:dateString) ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5062
            date := Date readFrom:dateString format:'%y-%m-%d'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5063
        ] ifFalse:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5064
            self halt:'unrecognized date'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5065
            ^ nil
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5066
        ].    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5067
    ].    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5068
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5069
    ^ date
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5070
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5071
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5072
     Object revisionDate
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5073
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5074
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5075
    "verify readability:
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5076
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5077
     Smalltalk allClassesDo:[:cls | (cls revisionDate)]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5078
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5079
     Smalltalk allClasses 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5080
        select:[:cls | 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5081
                    (cls revisionDate isNil) 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5082
                    and:[cls isLoaded
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5083
                    and:[cls isNameSpace not]]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5084
        ]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5085
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5086
     Smalltalk allClasses 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5087
        select:[:cls | cls isLoaded and:[cls isNameSpace not]]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5088
        thenCollect:[:cls | cls -> cls revisionDate]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5089
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5090
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5091
    "classes stable for more than 10 years:
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5092
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5093
     (Smalltalk allClasses 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5094
        select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5095
        select:[:cls | cls revisionDate < (Timestamp now - (TimeDuration years:10))]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5096
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5097
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5098
    "classes changed within the last 2 days:
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5099
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5100
     (Smalltalk allClasses 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5101
        select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5102
        select:[:cls | cls revisionDate > (Timestamp now - 2 days)]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5103
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5104
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5105
    "Created: / 08-05-2019 / 12:12:21 / Claus Gittinger"
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5106
!
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5107
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5108
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5109
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5110
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5111
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5112
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5113
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5114
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5115
    info notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5116
	^ (info date) ? '??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5117
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5118
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5119
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5120
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5121
     Object revisionDateString
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5122
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5123
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5124
    "Created: / 23-04-1997 / 12:29:21 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5125
    "Modified: / 22-10-2008 / 20:38:25 / cg"
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5126
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  5127
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5128
revisionInfo
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5129
    "return an object filled with revision info.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5130
     This extracts the relevant info from the revisionString.
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5131
     For private classes, the revisionInfo of the owning class is returned.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5132
     The revisionInfo contains all or a subset of:
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5133
        binaryRevision - the revision upon which the binary of this class is based
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5134
        revision       - the revision upon which the class is based logically
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5135
                          (different, if a changed class was checked in, but not yet recompiled)
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5136
        user           - the user who checked in the logical revision
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5137
        date           - the date when the logical revision was checked in (as string)
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5138
        time           - the time when the logical revision was checked in (as string)
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5139
        fileName       - the classes source file name
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5140
        repositoryPath - the classes source container
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5141
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5142
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5143
    self isPrivate ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5144
        ^ self owningClass revisionInfo
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5145
    ].    
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5146
    ^ self revisionInfoOfManager:self sourceCodeManagerFromBinaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5147
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5148
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5149
     Object revisionString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5150
     Object revisionInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5151
     Image revisionInfo
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5152
     Method::MethodWhoInfo revisionInfo
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5153
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5154
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5155
    "Created: / 11-11-1995 / 14:27:20 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5156
    "Modified: / 26-03-1997 / 00:13:17 / stefan"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5157
    "Modified: / 19-04-2011 / 13:41:24 / cg"
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5158
    "Modified (comment): / 08-05-2019 / 12:22:25 / Claus Gittinger"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5159
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5160
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5161
revisionInfoOfManager:aSourceCodemanagerOrNil
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5162
    "return an object filled with revision info for a given scm manager (or the default manager, if nil)
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5163
     This extracts the relevant info from the revisionString.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5164
     The revisionInfo contains all or a subset of:
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5165
        binaryRevision - the revision upon which the binary of this class is based
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5166
        revision       - the revision upon which the class is based logically
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5167
                          (different, if a changed class was checked in, but not yet recompiled)
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5168
        user           - the user who checked in the logical revision
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5169
        date           - the date when the logical revision was checked in
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5170
        time           - the time when the logical revision was checked in
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5171
        fileName       - the classes source file name
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5172
        repositoryPath - the classes source container
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5173
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5174
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5175
    |vsnString info|
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5176
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5177
    aSourceCodemanagerOrNil notNil ifTrue:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5178
        vsnString := self revisionStringOfManager:aSourceCodemanagerOrNil.
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5179
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5180
    vsnString isNil ifTrue:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5181
        "/ cg: I am not sure if this is the correct thing to do, iff the passed in scm-manager
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5182
        "/ was not nil. It will return another manager's revision info. Please check.
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5183
        vsnString := self revisionStringOfManager:nil.
17161
3c0beb9bedd1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17160
diff changeset
  5184
        vsnString isNil ifTrue:[^ nil].
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5185
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5186
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5187
    aSourceCodemanagerOrNil notNil ifTrue:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5188
        info := aSourceCodemanagerOrNil revisionInfoFromString:vsnString inClass:self
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5189
    ] ifFalse:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5190
        info := Class revisionInfoFromString:vsnString.
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5191
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5192
    info notNil ifTrue:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5193
        info binaryRevision:self binaryRevision.
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5194
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5195
    ^ info
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5196
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5197
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5198
     Object revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5199
     Object revisionInfo
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5200
     Image revisionInfo
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5201
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5202
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5203
    "Modified: / 26-03-1997 / 00:13:17 / stefan"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5204
    "Created: / 19-04-2011 / 13:41:13 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5205
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5206
13622
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5207
revisionOfManager:aSourceCodemanagerOrNil
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5208
    "return the revision-ID of the class which corresponds to the
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5209
     scm-version-id of the source to which this class is equivalent.
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5210
     The passed in source code manager (or the default manager, if nil) is asked here.
13622
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5211
     Initially, this is the same as #binaryRevision; however, once changes have
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5212
     been checked into a source repository, the binary continues to remain based upon
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5213
     the old revision, while logically, the class has the new (checked-in) revision.
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5214
     To check if a source corresponds to a compiled binary, compare this
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5215
     ID with the one returned by #binaryRevision."
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5216
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5217
    |info|
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5218
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5219
    info := self revisionInfoOfManager:aSourceCodemanagerOrNil.
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5220
    info notNil ifTrue:[
17160
bf601ce121a1 class: Class
Claus Gittinger <cg@exept.de>
parents: 17154
diff changeset
  5221
        ^ info revision
13622
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5222
    ].
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5223
    ^ nil "/ ^ self binaryRevision
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5224
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5225
    "
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5226
     Object revision
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5227
    "
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5228
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5229
    "Modified: / 26-03-1997 / 00:14:00 / stefan"
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5230
    "Modified (comment): / 01-07-2011 / 10:57:16 / cg"
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5231
    "Created: / 04-09-2011 / 11:03:34 / cg"
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5232
!
e4a8162bc7bc added: #revisionOfManager:
Claus Gittinger <cg@exept.de>
parents: 13508
diff changeset
  5233
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5234
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5235
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5236
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5237
    "return my revision string; that one is extracted from the
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5238
     classes #version method. Either this is a method returning that string,
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5239
     or it's a comment-only method and the comment defines the version.
19119
3b1a284174e7 #DOCUMENTATION
mawalch
parents: 19109
diff changeset
  5240
     If the receiver is unloaded, or the source is not accessible,
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5241
     or no such method exists, then nil is returned."
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5242
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5243
    ^ self revisionStringOfManager:nil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5244
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5245
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5246
     Smalltalk allClassesDo:[:cls |
19119
3b1a284174e7 #DOCUMENTATION
mawalch
parents: 19109
diff changeset
  5247
        Transcript show:cls name; show:' -> '; showCR:cls revisionString
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5248
     ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5249
24009
b32acf21c0e9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23825
diff changeset
  5250
     Number revision
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5251
     Number revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5252
     FileDirectory revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5253
     Metaclass revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5254
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5255
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5256
    "Created: / 29-10-1995 / 19:28:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5257
    "Modified: / 01-04-1997 / 23:37:25 / stefan"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5258
    "Modified: / 07-02-2001 / 18:03:39 / ps"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5259
    "Modified: / 19-04-2011 / 13:38:07 / cg"
24009
b32acf21c0e9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23825
diff changeset
  5260
    "Modified (comment): / 28-03-2019 / 15:20:00 / Claus Gittinger"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5261
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5262
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5263
revisionStringOfManager:aSourceCodeManagerOrNil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5264
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5265
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5266
    "return my revision string; that one is extracted from the
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5267
     classes #version method. Either this is a method returning that string,
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5268
     or it's a comment-only method and the comment defines the version.
19109
mawalch
parents: 18936
diff changeset
  5269
     If the receiver is unloaded, or the source is not accessible,
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5270
     or no such method exists, then nil is returned."
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5271
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5272
    |owner versionMethod|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  5273
23734
8fc7d08c2743 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23725
diff changeset
  5274
    (owner := self owningClass) notNil ifTrue:[^ owner revisionStringOfManager:aSourceCodeManagerOrNil].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5275
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5276
    versionMethod := self findVersionMethodOfManager:aSourceCodeManagerOrNil.
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5277
    versionMethod notNil ifTrue:[
19109
mawalch
parents: 18936
diff changeset
  5278
        ^ versionMethod valueWithReceiver:(self theNonMetaclass) arguments:#()
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5279
    ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5280
    ^ nil.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5281
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5282
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5283
     Smalltalk allClassesDo:[:cls |
19109
mawalch
parents: 18936
diff changeset
  5284
        Transcript show:cls name; show:' -> '; showCR:cls revisionString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5285
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5286
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5287
     Number revisionString
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  5288
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  5289
     Metaclass revisionString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5290
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5291
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5292
    "Modified: / 01-04-1997 / 23:37:25 / stefan"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5293
    "Modified: / 07-02-2001 / 18:03:39 / ps"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  5294
    "Created: / 19-04-2011 / 13:37:42 / cg"
23734
8fc7d08c2743 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 23725
diff changeset
  5295
    "Modified: / 13-02-2019 / 19:44:45 / Claus Gittinger"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5296
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5297
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5298
revisionTimestamp
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5299
    "return the revision-Date of the class as timestamp or nil.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5300
     This is extracted from the version string."
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5301
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5302
    |info timeString time date|
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5303
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5304
    info := self revisionInfo.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5305
    info isNil ifTrue:[^ nil].
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5306
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5307
    date := self revisionDate.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5308
    timeString := info time.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5309
    timeString notEmptyOrNil ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5310
        ('[0-2][0-9]:[0-5][0-9]:[0-5][0-9]' match:timeString) ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5311
            time := Time readFrom:timeString format:'%h:%m:%s'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5312
        ] ifFalse:[    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5313
            ('[0-2][0-9]:[0-5][0-9]' match:timeString) ifTrue:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5314
                time := Time readFrom:timeString format:'%h:%m'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5315
            ] ifFalse:[
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5316
                self halt:'unrecognized time'.
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5317
            ].    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5318
        ].
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5319
    ].
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5320
    time isNil ifTrue:[^ date].
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5321
    ^ Timestamp fromDate:date andTime:time
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5322
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5323
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5324
     Object revisionTimestamp
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5325
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5326
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5327
    "verify readability:
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5328
    
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5329
     Smalltalk allClassesDo:[:cls | (cls revisionTimestamp)]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5330
 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5331
     Smalltalk allClasses 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5332
        select:[:cls | 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5333
                    (cls revisionTimestamp isNil) 
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5334
                    and:[cls isLoaded
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5335
                    and:[cls isNameSpace not]]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5336
        ]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5337
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5338
     Smalltalk allClasses 
24119
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5339
        select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]]
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5340
        thenCollect:[:cls | cls -> cls revisionTimestamp]
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5341
    "
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5342
24119
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5343
    "classes changed within the last 2 hours:
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5344
    
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5345
     (Smalltalk allClasses 
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5346
        select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5347
        select:[:cls | cls revisionTimestamp > (Timestamp now - 2 hours)]
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5348
    "
458b88178b7c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24114
diff changeset
  5349
24114
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5350
    "Created: / 08-05-2019 / 12:33:24 / Claus Gittinger"
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5351
!
9d503e21996b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24009
diff changeset
  5352
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5353
setBinaryRevision:aString
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5354
    "set the revision-ID.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5355
     This should normally not be done in the running system, as the source-manager
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5356
     will need this to validate sourcefiles being correct for a given binary
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5357
     (and optionally: extracting the required sourcefile from the rcs source)"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5358
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5359
    revision := aString
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5360
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5361
    "Created: 9.12.1995 / 17:05:17 / cg"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5362
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5363
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5364
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5365
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5366
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5367
    "set my package from the info found in the revisionString if present.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5368
     This is used to set some useful packageInfo after autoloading
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5369
     (otherwise, autoloaded classes/methods would go into your current
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5370
      package - which is probably not a good idea)"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5371
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5372
    |info mgr dir lib mod p|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5373
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  5374
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  5375
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5376
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5377
    mgr notNil ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5378
	info := mgr sourceInfoOfClass:self.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5379
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5380
	info notNil ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5381
	    mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5382
	    dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5383
	    lib := info at:#library ifAbsent:dir.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5384
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5385
	    p := ''.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5386
	    mod notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  5387
"/            mod ~= 'stx' ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5388
		    p := p , mod
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  5389
"/            ]
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5390
	    ].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5391
	    dir notNil ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5392
		p notEmpty ifTrue:[p := p , ':'].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5393
		p := p , dir.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5394
	    ] ifFalse:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5395
		lib notNil ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5396
		    p notEmpty ifTrue:[p := p , ':'].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5397
		    p := p , lib.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5398
		].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5399
	    ].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5400
	    (p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  5401
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  5402
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  5403
"/            ].
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5404
		package := p.
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5405
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5406
		self methodDictionary do:[:aMethod |
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5407
		    aMethod package isNil ifTrue:[
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5408
			aMethod setPackage:p
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5409
		    ]
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5410
		]
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5411
	    ].
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5412
	].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5413
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5414
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5415
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5416
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5417
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5418
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5419
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5420
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  5421
    "Modified: / 12-06-1996 / 11:49:31 / stefan"
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  5422
    "Modified: / 12-09-2006 / 14:15:47 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5423
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  5424
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  5425
sourceFileSuffix
24374
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5426
    "Answers a default suffix for source files, i.e.
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5427
     'st' for Smalltalk, 'js' for JavaScript or 'rb' for Ruby', etc."
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5428
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5429
     ^ self class sourceFileSuffix
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5430
3dc0c43b3900 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24341
diff changeset
  5431
    "Modified (comment): / 27-06-2019 / 12:34:16 / Claus Gittinger"
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  5432
!
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  5433
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5434
sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5435
    "return an open stream on my sourcefile, nil if that is not available"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5436
11429
b863adcf4b12 refactored
Claus Gittinger <cg@exept.de>
parents: 11413
diff changeset
  5437
    |owner source stream|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  5438
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  5439
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStream].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5440
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5441
    classFilename notNil ifTrue:[
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5442
        source := classFilename
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5443
    ] ifFalse:[
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5444
        source := (Smalltalk fileNameForClass:self) , '.st'
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5445
    ].
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  5446
    stream := self sourceStreamFor:source.
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  5447
    stream notNil ifTrue:[
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5448
        "/ see if it's utf8 encoded...
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5449
        stream := EncodedStream decodedStreamFor:stream.
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  5450
    ].
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  5451
    ^ stream.
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5452
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5453
    "Modified (format): / 13-02-2017 / 19:57:50 / cg"
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  5454
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  5455
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  5456
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  5457
    "return an open stream on a sourcefile, nil if that is not available"
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  5458
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5459
    |owner sourceStream sourceCodeManager validated guessedFileName 
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5460
     sep mod dir sourceCodeManagerIsGuess|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  5461
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  5462
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  5463
    validated := false.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5464
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5465
    "/
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5466
    "/ if there is no SourceCodeManager,
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  5467
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  5468
    "/ look in standard places first
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5469
    "/
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5470
    "JV@2011-12-08:
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5471
        (i) first check TryLocalSourceFirst, this avoids useless call to
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5472
            #sourceCodeManagerFromBinaryRevision when TryLocalSourceFirst is
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5473
            set (for whatever reason)
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5474
        (ii) do NOT ask source code manager during system startup - source code
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5475
            managers are not configured anyway!! Also, avoids hangups during
20108
cceae1cc949e #DOCUMENTATION by mawalch
mawalch
parents: 19891
diff changeset
  5476
            startup when CVSROOT is set, but server is unreacheable.
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5477
    CAVEAT: When somebody modifies the code after compilation and methods
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5478
        are recompiled during startup (for whatever reason), a bad code may
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5479
        used, compilation may fail. However, it may happen anyway as SCM's
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5480
        are not yet configured so the system may use wrong one. Moreover,
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5481
        the source from which the class is compiled may not be the one in
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5482
        repository. I (JV) think this is a good, less confusing compromise.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5483
    "
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5484
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5485
    sourceCodeManagerIsGuess := false.
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5486
    
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5487
    (TryLocalSourceFirst == true
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5488
      or:[ Smalltalk isInitialized not
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5489
      or:[ (sourceCodeManager := self sourceCodeManagerFromBinaryRevision) isNil
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5490
    ]]) ifTrue:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5491
        sourceStream := self localSourceStreamFor:source.
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5492
    ].
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5493
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5494
    sourceStream isNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5495
        "/ mhmh - still no source file.
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5496
        "/ If there is a sourceCodeManager, ask it to acquire the
20108
cceae1cc949e #DOCUMENTATION by mawalch
mawalch
parents: 19891
diff changeset
  5497
        "/ source for my class and return an open stream on it.
cceae1cc949e #DOCUMENTATION by mawalch
mawalch
parents: 19891
diff changeset
  5498
        "/ If that one does not know about the source, look in
cceae1cc949e #DOCUMENTATION by mawalch
mawalch
parents: 19891
diff changeset
  5499
        "/ standard places.
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5500
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5501
        sourceCodeManager notNil ifTrue:[
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5502
            "/ remember iff sourceCodeManager is not the configured one 
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5503
            sourceCodeManagerIsGuess := (sourceCodeManager == SourceCodeManager).
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5504
            
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5505
            classFilename ~= source ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5506
                package notNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5507
                    sep := package indexOfAny:'/\:'.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5508
                    sep ~~ 0 ifTrue:[
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5509
                        |revisionInfo revision|
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5510
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5511
                        mod := package copyTo:sep - 1.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5512
                        dir := package copyFrom:sep + 1.
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5513
                        revision :=
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5514
                            (self isProjectDefinition 
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5515
                                ifTrue:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5516
                                    revisionInfo := self extensionsRevisionInfoForManager:sourceCodeManager.
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5517
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5518
                                        (revisionInfo notNil and:[ source = revisionInfo fileName ]) ifTrue:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5519
                                            revisionInfo revision
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5520
                                        ] ifFalse:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5521
                                            self binaryRevision
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5522
                                        ]
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5523
                                ]
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5524
                                ifFalse:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5525
                                    self binaryRevision
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5526
                                ]
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5527
                            ).
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5528
                        sourceCodeManagerIsGuess ifTrue:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5529
                            SourceCodeManagerError ignoreIn:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5530
                                sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:revision directory:dir module:mod cache:true.
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5531
                            ]
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5532
                        ] ifFalse:[    
23401
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5533
                            SourceCodeManagerError handle:[:ex |
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5534
                                Transcript showCR:'SourceCodeManagerError: ',ex description.
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5535
                            ] do:[
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5536
                                sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:revision directory:dir module:mod cache:true.
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5537
                            ]
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5538
                        ]
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5539
                    ]
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5540
                ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5541
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5542
            sourceStream isNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5543
                classFilename isNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5544
                    guessedFileName := (Smalltalk fileNameForClass:self) , '.st'.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5545
                ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5546
                source asFilename baseName = (classFilename ? guessedFileName) asFilename baseName ifTrue:[
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5547
                    sourceCodeManagerIsGuess ifTrue:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5548
                        SourceCodeManagerError ignoreIn:[
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5549
                            sourceStream := sourceCodeManager getSourceStreamFor:self.
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5550
                        ]
23401
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5551
                    ] ifFalse:[
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5552
                        SourceCodeManagerError handle:[:ex |
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5553
                            Transcript showCR:'SourceCodeManagerError: ',ex description.
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5554
                        ] do:[
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5555
                            sourceStream := sourceCodeManager getSourceStreamFor:self.
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5556
                        ]
23248
ae46b8e2500d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23178
diff changeset
  5557
                    ]
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5558
                ]
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5559
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5560
            sourceStream notNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5561
                (self validateSourceStream:sourceStream) ifFalse:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5562
                    ('Class [info]: repositories source for "%1" is invalid.' bindWith:self theNonMetaclass name) errorPrintCR.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5563
                    sourceStream close.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5564
                    sourceStream := nil
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5565
                ] ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5566
                    validated := true.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5567
                ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5568
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5569
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5570
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5571
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5572
    sourceStream isNil ifTrue:[
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5573
        "/
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5574
        "/ hard case - there is no source file for this class
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5575
        "/ (in the source-dir-path).
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5576
        "/
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5577
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5578
        "/
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5579
        "/ look if my binary is from a dynamically loaded module,
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5580
        "/ and, if so, look in the modules directory for the
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5581
        "/ source file.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5582
        "/
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5583
        ObjectFileLoader notNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5584
            ObjectFileLoader loadedObjectHandlesDo:[:h |
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5585
                |f classes|
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5586
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5587
                sourceStream isNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5588
                    (classes := h classes) notEmptyOrNil ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5589
                        (classes includes:self) ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5590
                            f := h pathName.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5591
                            f := f asFilename directory.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5592
                            f := f construct:source.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5593
                            f exists ifTrue:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5594
                                sourceStream := f readStreamOrNil.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5595
                            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5596
                        ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5597
                    ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5598
                ]
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5599
            ].
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5600
        ].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5601
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5602
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5603
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5604
    "/ try along sourcePath
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5605
    "/
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5606
    sourceStream isNil ifTrue:[
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5607
        sourceStream := self localSourceStreamFor:source.
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5608
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5609
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5610
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5611
    "/ final chance: try current directory
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  5612
    "/
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5613
    sourceStream isNil ifTrue:[
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5614
        sourceStream := source asFilename readStreamOrNil.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5615
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5616
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5617
    (sourceStream notNil and:[validated not]) ifTrue:[
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5618
        (self validateSourceStream:sourceStream) ifFalse:[
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5619
            ('Class [warning]: source for "%1" is invalid or stripped. Take care.' bindWith:self theNonMetaclass name) errorPrintCR.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5620
            sourceStream close.
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5621
            sourceStream := nil
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5622
        ].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  5623
    ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5624
"/    (sourceStream notNil and:[sourceStream isFileStream]) ifTrue:[
9610
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  5625
"/        guessedFileName notNil ifTrue:[
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  5626
"/            self setClassFilename:(aStream pathName asFilename baseName).
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  5627
"/        ]
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5628
"/    ].
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  5629
    ^ sourceStream
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5630
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5631
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5632
     Object sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5633
     Clock sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5634
     Autoload sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5635
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5636
15947
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5637
    "Created: / 10-11-1995 / 21:05:13 / cg"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5638
    "Modified: / 22-04-1998 / 19:20:50 / ca"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5639
    "Modified: / 05-11-2001 / 16:36:30 / cg"
edce1c1a0ab9 class: Class
Claus Gittinger <cg@exept.de>
parents: 15821
diff changeset
  5640
    "Modified: / 08-12-2011 / 19:16:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
21617
8f9da8c59145 #BUGFIX by mawalch
mawalch
parents: 21616
diff changeset
  5641
    "Modified: / 01-03-2017 / 14:57:22 / mawalch"
23401
6b1a81de23a4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23373
diff changeset
  5642
    "Modified: / 04-10-2018 / 17:04:26 / Claus Gittinger"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5643
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5644
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5645
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5646
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  5647
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5648
    "helper for the checkin procedure.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5649
     Update my #version method, to now return newRevisionString."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5650
12044
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  5651
    "/ for backward compatibility - however, please change callers...
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  5652
    ^ self sourceCodeManager updateVersionMethodOf:self for:newRevisionString
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5653
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5654
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5655
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5656
    "check if aStream really contains my source.
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  5657
     This is done by checking the version method's return value
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5658
     against the version string as contained in the version method.
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5659
     This helps to detect mangled source code."
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5660
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  5661
    |cls meta cannotCheckReason versionMethod info
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5662
     versionFromCode versionFromSource oldPos pos src rev|
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5663
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5664
    ValidateSourceOnlyOnce == true ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5665
        ValidatedClasses notNil ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5666
            (ValidatedClasses includes:self) ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5667
                Transcript showCR:'trust validated'.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5668
                ^ true
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5669
            ].
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5670
        ] ifFalse:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5671
            ValidatedClasses := WeakIdentitySet new.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5672
        ].
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5673
    ].
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5674
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5675
    meta := self theMetaclass.
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  5676
    cls := self theNonMetaclass.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5677
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  5678
    cannotCheckReason := nil.
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5679
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5680
    versionMethod := self findVersionMethod.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  5681
    versionMethod isNil ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5682
        cannotCheckReason := 'no valid version method'.
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  5683
    ] ifFalse:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5684
        "/
21423
59c8f4af2fce #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21327
diff changeset
  5685
        "/ if it's a method returning the string,
20404
40e90e26013e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20219
diff changeset
  5686
        "/ that's the returned value
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5687
        "/
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5688
        versionFromCode := versionMethod valueWithReceiver:cls arguments:#().
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5689
        versionFromCode isString ifFalse:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5690
            cannotCheckReason := 'version method does not return a string'
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5691
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5692
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5693
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5694
    versionMethod notNil ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5695
        pos := versionMethod sourcePosition.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5696
        pos isInteger ifFalse:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5697
            "/ mhmh - either no version method,
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5698
            "/ or updated due to a checkin.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5699
            "/ in any case, this should be a good source.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5700
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5701
            ^ true.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5702
            "/ cannotCheckReason := 'no source position for version-method'
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5703
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5704
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5705
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  5706
    cannotCheckReason notNil ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5707
        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5708
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5709
        ^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5710
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5711
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5712
    oldPos := aStream position.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5713
    Stream positionErrorSignal handle:[:ex |
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5714
        ('Class [info]: position error when accessing source for ',self name) infoPrintCR.
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5715
        ^ false
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5716
    ] do:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5717
        aStream position:pos-1.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5718
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5719
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5720
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5721
9063
953b305e35d6 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5722
    (src isEmptyOrNil) ifTrue:[
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5723
        ('Class [info]: empty source for version-method in ',self name) infoPrintCR.
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5724
        ^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5725
    ].
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5726
    (src startsWith:'version') ifFalse:[
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5727
        ('Class [info]: corrupted source (source does not correspond to binary) in ',self name) infoPrintCR.
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5728
        ^ false
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5729
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5730
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5731
    versionFromSource := Class revisionStringFromSource:src.
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5732
    versionFromSource = versionFromCode ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5733
        ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5734
        ^ true
13755
14b7144013d4 class definition
Claus Gittinger <cg@exept.de>
parents: 13716
diff changeset
  5735
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5736
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  5737
    versionFromSource isNil ifTrue:[
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5738
        ('Class [info]: version-from source is nil in ',self name) infoPrintCR.
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5739
        ^ false
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  5740
    ].
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  5741
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5742
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5743
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5744
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5745
    info notNil ifTrue:[
15610
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5746
        rev := info at:#revision.
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5747
        rev = self binaryRevision ifTrue:[
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5748
            ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5749
            ^ true
cdec81bdc7a7 class: Class
Stefan Vogel <sv@exept.de>
parents: 15517
diff changeset
  5750
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5751
    ].
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5752
    ('Class [info]: source-version is different from binaryRevision in ',self name) infoPrintCR.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5753
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5754
21841
4b2dd2321f5a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 21617
diff changeset
  5755
    "Modified: / 19-06-2017 / 17:30:17 / cg"
12015
fm
parents: 12014
diff changeset
  5756
!
fm
parents: 12014
diff changeset
  5757
fm
parents: 12014
diff changeset
  5758
versionMethodTemplateForSourceCodeManager:aSourceCodeManager
fm
parents: 12014
diff changeset
  5759
fm
parents: 12014
diff changeset
  5760
    ^self class versionMethodTemplateForSourceCodeManager:aSourceCodeManager
fm
parents: 12014
diff changeset
  5761
fm
parents: 12014
diff changeset
  5762
    "Created: / 16-08-2009 / 12:57:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5763
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5764
13860
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5765
!Class::ArrayWithSequenceNumberValidation methodsFor:'accessing'!
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5766
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5767
sequenceNumber
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5768
    ^ sequenceNumber
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5769
!
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5770
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5771
sequenceNumber:something
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5772
    sequenceNumber := something.
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5773
! !
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5774
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5775
!Class::ArrayWithSequenceNumberValidation methodsFor:'checking'!
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5776
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5777
checkIfValidFor:aSequenceNumber
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5778
    ^ aSequenceNumber ~= sequenceNumber
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5779
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5780
    "Created: / 06-12-2011 / 16:01:16 / cg"
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5781
! !
8ee904492c9a class definition
Claus Gittinger <cg@exept.de>
parents: 13766
diff changeset
  5782
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5783
!Class::ClassAttributes class methodsFor:'documentation'!
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5784
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5785
documentation
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5786
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5787
    Instances hold additional attributes of a class.
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5788
    Currently, these are primitive definitions and sharedPools information.
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5789
    As these are seldom needed, they are only present as object in some classes
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5790
    thus saving us from mostly empty additional slots in the class object itself for most classes
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5791
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5792
! !
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5793
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5794
!Class::ClassAttributes methodsFor:'accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5795
13716
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5796
fGuid
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5797
    ^ fGuid
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5798
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5799
    "Created: / 23-09-2011 / 10:28:25 / cg"
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5800
!
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5801
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5802
fGuid:something
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5803
    fGuid := something.
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5804
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5805
    "Created: / 23-09-2011 / 10:28:28 / cg"
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5806
!
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5807
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5808
localSelectors
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5809
    ^ localSelectors
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5810
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5811
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5812
localSelectors:something
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5813
    localSelectors := something.
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5814
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5815
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5816
primitiveDefinitions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5817
    ^ primitiveDefinitions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5818
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5819
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5820
primitiveDefinitions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5821
    primitiveDefinitions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5822
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5823
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5824
primitiveFunctions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5825
    ^ primitiveFunctions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5826
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5827
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5828
primitiveFunctions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5829
    primitiveFunctions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5830
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5831
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5832
primitiveVariables
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5833
    ^ primitiveVariables
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5834
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5835
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5836
primitiveVariables:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5837
    primitiveVariables := something.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5838
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5839
14579
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5840
projectDirectory
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5841
    ^ projectDirectory
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5842
!
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5843
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5844
projectDirectory:something
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5845
    projectDirectory := something.
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5846
!
177a885c9a92 added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents: 14572
diff changeset
  5847
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5848
sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5849
    ^ sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5850
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5851
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5852
sharedPools:something
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5853
    sharedPools := something.
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5854
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5855
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5856
traitComposition
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5857
    ^ traitComposition
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5858
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5859
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5860
traitComposition:something
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5861
    traitComposition := something.
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5862
!
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5863
13716
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5864
vGuid
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5865
    ^ vGuid
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5866
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5867
    "Created: / 23-09-2011 / 10:28:41 / cg"
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5868
!
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5869
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5870
vGuid:something
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5871
    vGuid := something.
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5872
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5873
    "Created: / 23-09-2011 / 10:28:34 / cg"
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5874
!
f34e5a31ed8e changed:
Claus Gittinger <cg@exept.de>
parents: 13715
diff changeset
  5875
13715
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5876
valueFor:aKey
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5877
    ^ self perform:aKey asSymbol
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5878
Claus Gittinger <cg@exept.de>
parents: 13680
diff changeset
  5879
    "Created: / 23-09-2011 / 10:23:26 / cg"
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5880
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5881
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5882
!Class::ClassAttributes methodsFor:'conversion'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5883
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5884
fromSTCPrimitiveArray:anArray
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5885
    "for now, the stc compiler generates a 3- or 4-element primitive spec array
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5886
     (it does not know anything about the ClassAttributes class).
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5887
     This method is invoked to convert."
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5888
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5889
    primitiveDefinitions := anArray at:1.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5890
    primitiveVariables := anArray at:2.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5891
    primitiveFunctions := anArray at:3.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5892
    anArray size > 3 ifTrue:[
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5893
	sharedPools := anArray at:4.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5894
    ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5895
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5896
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5897
!Class::SimulatedClassPool class methodsFor:'documentation'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5898
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5899
documentation
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5900
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5901
    in contrast to other smalltalks, ST/X does not keep the classVariables
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5902
    in a dictionary; instead, classVariables are stored as special globals,
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5903
    with the className as prefix (colon-separated).
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5904
    The reason is that stc-compiled code should be allowed to access classVars
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5905
    in a similar fashion to globals.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5906
17045
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5907
    Whenever a classes classPool is requested (by code imported from visualworks), 
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5908
    an instance of myself is created, which forwards at: and at:put: messages 
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5909
    to the original class. 
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5910
    Notice that classPools are never asked for by smalltalk/x
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5911
    code - especially not by the browser. However, imported code (like the refactory browser)
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5912
    may do so.
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5913
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5914
    This is an additional goody class; therefore:
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5915
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5916
    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5917
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5918
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5919
    ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5920
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5921
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5922
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5923
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5924
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5925
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5926
    SUCH DAMAGE.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5927
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5928
    [author:]
17045
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  5929
        Claus Gittinger
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5930
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5931
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5932
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5933
!Class::SimulatedClassPool methodsFor:'accessing'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5934
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5935
associationAt:aName
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5936
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5937
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5938
    ^ SimulatedVariableBinding key:aName value:(class classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5939
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5940
    "Modified: / 4.2.2000 / 00:27:40 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5941
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5942
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5943
associationAt:aName ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5944
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5945
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5946
    |internalName cls|
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5947
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5948
    cls := class theNonMetaclass.
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5949
    internalName := (cls name , ':' , aName) asSymbol.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5950
    ^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5951
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5952
    "Created: / 3.2.2000 / 23:30:07 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5953
    "Modified: / 4.2.2000 / 01:58:56 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5954
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5955
13680
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5956
associations
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5957
    |assocs|
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5958
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5959
    assocs := OrderedCollection new.
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5960
    self associationsDo:[:eachAssoc |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5961
	assocs add:eachAssoc
13680
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5962
    ].
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5963
    ^ assocs
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5964
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5965
    "Created: / 12-09-2011 / 10:15:11 / cg"
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5966
!
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5967
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5968
associationsDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5969
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5970
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5971
    class classVarNames do:[:eachName |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5972
	aBlock value:(self associationAt:eachName)
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5973
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5974
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5975
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5976
at:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5977
    ^ class classVarAt:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5978
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5979
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5980
at:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5981
    ^ class classVarAt:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5982
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5983
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5984
at:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5985
    ^ class classVarAt:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5986
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5987
13680
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5988
bindingOf:aKey
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5989
    ^ self associationAt:aKey
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5990
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5991
    "Created: / 12-09-2011 / 09:41:18 / cg"
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5992
!
2c07a05644f1 added: #bindingOf:
Claus Gittinger <cg@exept.de>
parents: 13622
diff changeset
  5993
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5994
keys
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5995
    ^ class classVarNames collect:[:nm | nm asSymbol]
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5996
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5997
    "
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  5998
     Button classPool keys
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5999
     Button classPool at:#ReturnForm
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6000
    "
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6001
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6002
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6003
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6004
keysAndValuesDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6005
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6006
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6007
    class classVarNames do:[:eachName |
13756
3ee6a0a23256 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13755
diff changeset
  6008
	aBlock value:eachName value:(class classVarAt:eachName)
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6009
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6010
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6011
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6012
!Class::SimulatedClassPool methodsFor:'accessing-private'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6013
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6014
setClass:aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6015
    class := aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6016
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6017
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6018
!Class::SimulatedClassPool::SimulatedVariableBinding class methodsFor:'documentation'!
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6019
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6020
documentation
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6021
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6022
    Instances are returned from the simulated classPool for VW compatibility.
17045
efdffe319da3 comments only
Claus Gittinger <cg@exept.de>
parents: 16815
diff changeset
  6023
    See the documentation in SimulatedClassPool for more info.
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6024
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6025
! !
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  6026
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6027
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6028
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6029
isVariableBinding
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6030
     ^ true
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6031
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6032
    "Created: / 4.2.2000 / 00:27:20 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6033
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  6034
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  6035
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  6036
13508
59531dc7d4e8 changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 13507
diff changeset
  6037
version
18559
2f3d69fc53f0 class: Class
Claus Gittinger <cg@exept.de>
parents: 18208
diff changeset
  6038
    ^ '$Header$'
13508
59531dc7d4e8 changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 13507
diff changeset
  6039
!
59531dc7d4e8 changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 13507
diff changeset
  6040
12044
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  6041
version_CVS
18559
2f3d69fc53f0 class: Class
Claus Gittinger <cg@exept.de>
parents: 18208
diff changeset
  6042
    ^ '$Header$'
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  6043
!
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  6044
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  6045
version_SVN
15258
0c70e2163eaf class: Class
Claus Gittinger <cg@exept.de>
parents: 15160
diff changeset
  6046
    ^ '$ Id: Class.st 10643 2011-06-08 21:53:07Z vranyj1  $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  6047
! !
14929
7eccf58ccfab class: Class
Claus Gittinger <cg@exept.de>
parents: 14837
diff changeset
  6048