SystemOrganizer.st
author Claus Gittinger <cg@exept.de>
Thu, 16 Nov 2000 17:22:00 +0100
changeset 994 fdfd49f4dc25
parent 969 3f3e9552e78b
child 1061 b48afe9c91b1
permissions -rw-r--r--
caching
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     1
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     2
 COPYRIGHT (c) 1998 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     3
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     4
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     5
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     6
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     8
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
     9
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    10
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    11
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    12
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    13
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    14
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
    15
"{ Package: 'stx:libbasic3' }"
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
    16
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
Object subclass:#SystemOrganizer
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    18
	instanceVariableNames:'categoryArray nameSpace'
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    19
	classVariableNames:'AllCategories CachedOrganizerForSmalltalk'
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Kernel-Support'
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    24
!SystemOrganizer class methodsFor:'documentation'!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    25
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    26
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    27
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    28
 COPYRIGHT (c) 1998 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    29
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    30
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    31
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    32
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    34
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    35
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    36
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    37
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    38
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    39
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    40
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    41
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    42
documentation
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    43
"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    44
     In ST80, there is a systemOrganization, which groups classes
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    45
     to categories.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    46
     All of this here is mimicri - ST/X keeps the category in the class.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    47
     This class simulates the ST80 behavior.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    48
"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    49
! !
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!SystemOrganizer class methodsFor:'instance creation'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
for:aNameSpace
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    54
    "create & return a new instance of myself, to organize aNameSpace.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    55
     All of this here is mimicri - ST/X keeps the category in the class."
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    57
    (aNameSpace isNil or:[aNameSpace == Smalltalk]) ifTrue:[
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    58
        CachedOrganizerForSmalltalk isNil ifTrue:[
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    59
            CachedOrganizerForSmalltalk := self new nameSpace:aNameSpace.
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    60
        ].
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    61
        ^ CachedOrganizerForSmalltalk
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    62
    ].
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    63
    ^ self new nameSpace:aNameSpace.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    65
    "Modified: / 6.2.2000 / 20:25:50 / cg"
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!SystemOrganizer methodsFor:'accessing'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    70
addCategory:aCategory before:someOtherCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    71
    (categoryArray isNil
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    72
    or:[(categoryArray includes:aCategory) not]) ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    73
        categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    74
        AllCategories add:aCategory.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    75
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    76
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    77
    "Created: / 6.2.2000 / 20:42:20 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    78
    "Modified: / 6.2.2000 / 20:44:34 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    79
!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    80
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
categories
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "return a collection of my classes class-categories.
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
     If my nameSpace is nil, all classes' categories are included;
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     otherwise, only the categories of that particular namespace."
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    86
    |addClassAction categorySet searchedNamespace allNames|
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    88
    categoryArray notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    89
        ^ categoryArray
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    90
    ].
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    92
    addClassAction := [:aClass |
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    93
        |cat|
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    95
        aClass isMeta ifFalse:[
925
95dda78c41a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
    96
            (aClass isNameSpace not) ifTrue:[
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    97
                cat := aClass category.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    98
                cat isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    99
                    cat := '* no category *'
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   100
                ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   101
                cat ~= 'obsolete' ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   102
                    categorySet add:cat
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
                ]
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
            ]
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
        ].
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   106
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   107
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   108
    AllCategories isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   109
        categorySet := Set new.
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   110
        Smalltalk allClassesDo:addClassAction.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   111
        AllCategories := categorySet.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    ].
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   113
        
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   114
    (searchedNamespace := nameSpace) isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   115
        allNames := true.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   116
        searchedNamespace := Smalltalk.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   117
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   118
    searchedNamespace == Smalltalk ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   119
        categorySet := AllCategories.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   120
    ] ifFalse:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   121
        categorySet := Set new.
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   122
        searchedNamespace allClassesDo:addClassAction.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   123
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   124
    categoryArray := categorySet asArray sort.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    ^ categoryArray
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
     (SystemOrganizer for:nil) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
     (SystemOrganizer for:Smalltalk) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
     (SystemOrganizer for:Demos) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   133
    "Modified: / 6.2.2000 / 20:33:42 / cg"
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   134
!
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   135
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   136
categoryOfElement:aClassName
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   137
    "return a classes category;
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   138
     the argument is the classes name"
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   139
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   140
    |cls|
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   141
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   142
    cls := Smalltalk at:aClassName ifAbsent:nil.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   143
    cls notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   144
        ^ cls category
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   145
    ].
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   146
    self error:'no such class'.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   147
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   148
    "Modified: / 6.2.2000 / 20:12:10 / cg"
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   149
!
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   150
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   151
classify:aClassName under:newCategory
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   152
    "change a classes category;
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   153
     the argument is the classes name"
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   154
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   155
    |cls cats|
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   156
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   157
    cls := Smalltalk at:aClassName ifAbsent:nil.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   158
    cls notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   159
        (AllCategories includes:newCategory) ifFalse:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   160
            cats := AllCategories asOrderedCollection.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   161
            cats add:newCategory.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   162
            cats sort.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   163
            AllCategories := cats.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   164
        ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   165
        (categoryArray notNil and:[categoryArray includes:newCategory]) not
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   166
        ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   167
            categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   168
        ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   169
        ^ cls category:newCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   170
    ].
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   171
    self error:'no such class'.
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   172
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   173
    "Created: / 4.2.2000 / 18:30:11 / cg"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   174
    "Modified: / 6.2.2000 / 20:36:30 / cg"
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   175
!
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   176
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   177
listAtCategoryNamed:aCategory
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   178
    "return a collection of classes in aCategory."
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   179
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   180
    |set classSet searchedNamespace allNames|
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   181
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   182
    classSet := IdentitySet new.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   183
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   184
    (searchedNamespace := nameSpace) isNil ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   185
        allNames := true.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   186
        searchedNamespace := Smalltalk.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   187
    ].
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   188
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   189
    searchedNamespace allClassesDo:[:aClass |
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   190
        |cat|
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   191
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   192
        aClass isMeta ifFalse:[
925
95dda78c41a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   193
            (aClass isNameSpace not 
95dda78c41a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   194
            or:[aClass == NameSpace 
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   195
            or:[aClass == Smalltalk]]) ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   196
                (allNames or:[aClass nameSpace == nameSpace]) ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   197
                    cat := aClass category.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   198
                    cat = aCategory ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   199
                        classSet add:aClass name
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   200
                    ]
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   201
                ]
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   202
            ]
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   203
        ]
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   204
    ].
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   205
    ^ classSet asArray sort.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   206
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   207
    "
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   208
     (SystemOrganizer for:nil) listAtCategoryNamed:'Collections-Abstract' 
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   209
     (SystemOrganizer for:Smalltalk) listAtCategoryNamed:'Collections-Abstract' 
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   210
     (SystemOrganizer for:Demos) listAtCategoryNamed:'Collections-Abstract' 
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   211
    "
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   212
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   213
    "Modified: / 20.6.1998 / 13:34:19 / cg"
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   216
!SystemOrganizer methodsFor:'change and update'!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   217
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   218
update:something with:anArgument from:changedObject
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   219
    "/ flush cached categories ...
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   220
    categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   221
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   222
    "Created: / 6.2.2000 / 20:08:52 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   223
    "Modified: / 6.2.2000 / 20:10:21 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   224
! !
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   225
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   226
!SystemOrganizer methodsFor:'private accessing'!
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
nameSpace:aNameSpace
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    "set the nameSpace - nil is allowed and stands for: any"
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   231
    nameSpace := aNameSpace ? Smalltalk.
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   232
    nameSpace addDependent:self.
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   233
    nameSpace ~~ Smalltalk ifTrue:[Smalltalk addDependent:self].
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
     (SystemOrganizer for:nil) organization
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
     (SystemOrganizer for:Demos) organization
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    "Modified: / 20.6.1998 / 12:35:34 / cg"
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
!SystemOrganizer class methodsFor:'documentation'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
version
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   246
    ^ '$Header: /cvs/stx/stx/libbasic3/SystemOrganizer.st,v 1.9 2000-11-16 16:22:00 cg Exp $'
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
! !