SystemOrganizer.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 22 Mar 2013 11:11:55 +0000
branchjv
changeset 3128 87750af738dc
parent 3125 08d6603c4fe9
parent 3121 19723298dd2c
child 3838 474d8ec95b33
permissions -rw-r--r--
Merged heads
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
"
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
    13
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#SystemOrganizer
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    15
	instanceVariableNames:'categoryArray nameSpace'
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    16
	classVariableNames:'AllCategories CachedOrganizerForSmalltalk'
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Kernel-Support'
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    21
!SystemOrganizer class methodsFor:'documentation'!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    22
906
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    23
copyright
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    24
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    25
 COPYRIGHT (c) 1998 eXept Software AG
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    26
              All Rights Reserved
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    27
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    28
 This software is furnished under a license and may be used
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    29
 only in accordance with the terms of that license and with the
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    31
 be provided or otherwise made available to, or used by, any
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    32
 other person.  No title to or ownership of the software is
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    33
 hereby transferred.
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    34
"
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    35
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    36
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    37
!
862b6903fbf3 copyrights
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
    38
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    39
documentation
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    40
"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    41
     In ST80, there is a systemOrganization, which groups classes
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    42
     to categories.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    43
     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
    44
     This class simulates the ST80 behavior.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    45
"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    46
! !
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
!SystemOrganizer class methodsFor:'instance creation'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
    50
for:aNameSpaceOrNil
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    51
    "create & return a new instance of myself, to organize aNameSpace.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    52
     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
    53
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
    54
    (aNameSpaceOrNil isNil or:[aNameSpaceOrNil == Smalltalk]) ifTrue:[
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    55
        CachedOrganizerForSmalltalk isNil ifTrue:[
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
    56
            CachedOrganizerForSmalltalk := self new nameSpace:aNameSpaceOrNil.
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    57
        ].
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    58
        ^ CachedOrganizerForSmalltalk
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
    59
    ].
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
    60
    ^ self new nameSpace:aNameSpaceOrNil.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
    62
    "Modified: / 21.8.2001 / 15:22:20 / cg"
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!SystemOrganizer methodsFor:'accessing'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    67
addCategory:aCategory before:someOtherCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    68
    (categoryArray isNil
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    69
    or:[(categoryArray includes:aCategory) not]) ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    70
        categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    71
        AllCategories add:aCategory.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    72
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    73
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    74
    "Created: / 6.2.2000 / 20:42:20 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    75
    "Modified: / 6.2.2000 / 20:44:34 / cg"
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
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
categories
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    "return a collection of my classes class-categories.
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
     If my nameSpace is nil, all classes' categories are included;
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     otherwise, only the categories of that particular namespace."
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    83
    |addClassAction categorySet searchedNamespace allNames|
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    85
    categoryArray notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    86
        ^ categoryArray
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    87
    ].
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    89
    addClassAction := [:aClass |
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    90
        |cat|
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
        aClass isMeta ifFalse:[
2251
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
    93
            aClass isNameSpace ifFalse:[
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    94
                cat := aClass category.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    95
                cat isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    96
                    cat := '* no category *'
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    97
                ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    98
                cat ~= 'obsolete' ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
    99
                    categorySet add:cat
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
                ]
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
            ]
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
        ].
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   103
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   104
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   105
    AllCategories isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   106
        categorySet := Set new.
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   107
        Smalltalk allClassesDo:addClassAction.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   108
        AllCategories := categorySet.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    ].
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   110
        
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   111
    (searchedNamespace := nameSpace) isNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   112
        searchedNamespace := Smalltalk.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   113
    ].
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   114
    allNames := (searchedNamespace == Smalltalk).
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   115
    searchedNamespace == Smalltalk ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   116
        categorySet := AllCategories.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   117
    ] ifFalse:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   118
        categorySet := Set new.
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   119
        searchedNamespace allClassesDo:addClassAction.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   120
    ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   121
    categoryArray := categorySet asArray sort.
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    ^ categoryArray
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
     (SystemOrganizer for:nil) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
     (SystemOrganizer for:Smalltalk) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
     (SystemOrganizer for:Demos) categories 
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   130
    "Modified: / 21.8.2001 / 15:24:10 / cg"
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   131
!
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   132
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   133
categoryOfElement:aClassName
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   134
    "return a classes category;
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   135
     the argument is the classes name"
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   136
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   137
    |cls|
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   138
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   139
    cls := Smalltalk at:aClassName ifAbsent:nil.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   140
    cls notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   141
        ^ cls category
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   142
    ].
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   143
    self error:'no such class'.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   144
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   145
    "Modified: / 6.2.2000 / 20:12:10 / cg"
895
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   146
!
f8702324cc12 added #categoryOfElement - for RB
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   147
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   148
classify:aClassName under:newCategory
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   149
    "change a classes category;
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   150
     the argument is the classes name"
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   151
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   152
    |cls cats|
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   153
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   154
    cls := Smalltalk at:aClassName ifAbsent:nil.
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   155
    cls notNil ifTrue:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   156
        (AllCategories includes:newCategory) ifFalse:[
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   157
            cats := AllCategories asOrderedCollection.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   158
            cats add:newCategory.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   159
            cats sort.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   160
            AllCategories := cats.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   161
        ].
2251
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   162
        (categoryArray notNil and:[categoryArray includes:newCategory])
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   163
        ifFalse:[
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   164
            categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   165
        ].
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   166
        ^ cls category:newCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   167
    ].
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   168
    self error:'no such class'.
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   169
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
   170
    "Created: / 4.2.2000 / 18:30:11 / cg"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   171
    "Modified: / 6.2.2000 / 20:36:30 / cg"
899
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
2488
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   174
environment
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   175
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   176
	^Smalltalk
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   177
!
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   178
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   179
listAtCategoryNamed:aCategory
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   180
    "return a collection of classes in aCategory."
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   181
1670
99282e024c51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1061
diff changeset
   182
    |classSet searchedNamespace allNames|
689
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
    classSet := IdentitySet new.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   185
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   186
    (searchedNamespace := nameSpace) isNil ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   187
        searchedNamespace := Smalltalk.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   188
    ].
1061
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   189
    "/ hack to enable ported tools (RefactoryBrowser) to see all classes
b48afe9c91b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   190
    allNames := (searchedNamespace == Smalltalk).
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   191
969
3f3e9552e78b allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   192
    searchedNamespace allClassesDo:[:aClass |
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   193
        |cat|
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   194
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   195
        aClass isMeta ifFalse:[
2251
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   196
            aClass isRealNameSpace ifFalse:[
689
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   197
                (allNames or:[aClass nameSpace == nameSpace]) ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   198
                    cat := aClass category.
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   199
                    cat = aCategory ifTrue:[
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   200
                        classSet add:aClass name
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
    ].
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   206
    ^ classSet asArray sort.
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
    "
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   209
     (SystemOrganizer for:nil) listAtCategoryNamed:'Collections-Abstract' 
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   210
     (SystemOrganizer for:Smalltalk) listAtCategoryNamed:'Collections-Abstract' 
1d4a311dd765 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   211
     (SystemOrganizer for:Demos) listAtCategoryNamed:'Collections-Abstract' 
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
1895
c3b43165a0cc changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   214
    "Modified: / 10-11-2006 / 17:12:56 / cg"
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   217
!SystemOrganizer methodsFor:'change and update'!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   218
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   219
update:something with:anArgument from:changedObject
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   220
    "/ flush cached categories ...
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   221
    categoryArray := nil.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   222
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   223
    "Created: / 6.2.2000 / 20:08:52 / cg"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   224
    "Modified: / 6.2.2000 / 20:10:21 / cg"
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
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   227
!SystemOrganizer methodsFor:'private accessing'!
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
nameSpace:aNameSpace
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    "set the nameSpace - nil is allowed and stands for: any"
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
994
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   232
    nameSpace := aNameSpace ? Smalltalk.
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   233
    nameSpace addDependent:self.
fdfd49f4dc25 caching
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   234
    nameSpace ~~ Smalltalk ifTrue:[Smalltalk addDependent:self].
688
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
     (SystemOrganizer for:nil) organization
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
     (SystemOrganizer for:Demos) organization
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    "
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    "Modified: / 20.6.1998 / 12:35:34 / cg"
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
! !
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
!SystemOrganizer class methodsFor:'documentation'!
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
5d925b1c32c1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
version
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   247
    ^ '$Header: SystemOrganizer.st 1909 2012-03-31 00:14:49Z vranyj1 $'
2251
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   248
!
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   249
a0e1f185ee33 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   250
version_CVS
3011
1997ff6e7e55 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2488
diff changeset
   251
    ^ '§Header: /cvs/stx/stx/libbasic3/SystemOrganizer.st,v 1.14 2011/08/20 16:30:14 cg Exp §'
3012
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
   252
!
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
   253
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   254
version_HG
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   255
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   256
    ^ '$Changeset: <not expanded> $'
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   257
!
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   258
3012
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
   259
version_SVN
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   260
    ^ '§Id: SystemOrganizer.st 1909 2012-03-31 00:14:49Z vranyj1 §'
3012
4f40b8304d54 Added InvalidChange
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3011
diff changeset
   261
! !
3121
19723298dd2c Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3042
diff changeset
   262