Tools__ImplementingClassList.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 17:11:44 +0200
changeset 18767 0478d93cdb75
parent 18420 725860d08340
permissions -rw-r--r--
#REFACTORING by stefan Sanitize BlockValues class: Tools::Inspector2 changed: #toolbarBackgroundHolder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     1
"{ Encoding: utf8 }"
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     2
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     4
 COPYRIGHT (c) 2004 by eXept Software AG
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     5
              All Rights Reserved
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     7
 This software is furnished under a license and may be used
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     8
 only in accordance with the terms of that license and with the
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    10
 be provided or otherwise made available to, or used by, any
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    11
 other person.  No title to or ownership of the software is
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    12
 hereby transferred.
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libtool' }"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"{ NameSpace: Tools }"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
MethodList subclass:#ImplementingClassList
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Interface-Browsers-New'
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!ImplementingClassList class methodsFor:'documentation'!
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    29
 COPYRIGHT (c) 2004 by eXept Software AG
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    30
              All Rights Reserved
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    32
 This software is furnished under a license and may be used
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    33
 only in accordance with the terms of that license and with the
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    35
 be provided or otherwise made available to, or used by, any
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    36
 other person.  No title to or ownership of the software is
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    37
 hereby transferred.
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Like a ClassList, but shows classes hierarchical.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    If topClassHolders value is non-nil, only that classes hierarchy
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    is shown.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    embeddable application displaying the classes as listed by
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    the inputGenerator.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    Provides an outputGenerator, which enumerates the classes and
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    their protocols (method-categories) in the selected classes.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [author:]
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
	Claus Gittinger (cg@exept.de)
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
! !
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!ImplementingClassList methodsFor:'private'!
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
listOfMethodNames
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    |methods entries newNameList 
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
     allCategories classUses allSelectors generator 
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     "theMethod"|
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    generator := inGeneratorHolder value.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    generator isNil ifTrue:[^ #() ].
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    classUses := Bag identityNew.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    allSelectors := IdentitySet new.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    allCategories := Set new.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    entries := OrderedCollection new.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "/ generator generates nil-selector entries
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "/ to pass multiple-class and multiple-protocol info
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    generator do:[:cls :cat :sel :mthd | 
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    78
                        sel notNil ifTrue:[
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    79
                            entries add:(Array with:cls with:sel with:mthd).
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    80
                            classUses add:cls.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    81
                            allSelectors add:sel.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    82
                            allCategories add:mthd category.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    83
                        ]
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    84
                 ].
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    entries sort:[:a :b | |clsNmA clsNmB|
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    87
                           clsNmA := (a at:1) name.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    88
                           clsNmB := (b at:1) name.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    89
                           clsNmA < clsNmB
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    90
                 ].
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    newNameList := entries collect:[:entry | 
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    93
                                        |class nm|
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    95
                                        class := (entry at:1).
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    96
                                        nm := class name.
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    97
                                        ((allSelectors size > 1)
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    98
                                        or:[(classUses occurrencesOf:class) > 1]) ifTrue:[
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
    99
                                            nm := nm , ' ' , (entry at:2)
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   100
                                        ].
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   101
                                        allCategories size > 1 ifTrue:[
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   102
                                            nm := nm , ' {' , (entry at:3) category , '}'
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   103
                                        ].
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
"/                                        class name , ' ' , (entry at:2)
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   105
                                        nm
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   106
                                   ].
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   107
    methods := entries collectColumn:3.
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    methodList := methods.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
"/    methods size == 1 ifTrue:[
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
"/        theMethod := methods first.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
"/        self methodLabelHolder value:(theMethod mclass name , ' ' , theMethod selector).
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
"/    ].
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    ^ newNameList.
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   115
    "Created: / 05-02-2000 / 22:43:40 / cg"
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   116
    "Modified: / 01-03-2000 / 21:00:26 / cg"
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   117
    "Modified: / 22-09-2018 / 11:22:15 / Claus Gittinger"
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!ImplementingClassList class methodsFor:'documentation'!
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
18420
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   122
version
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   123
    ^ '$Header$'
725860d08340 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   124
! !
10003
ed8572afe3f2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125