Tools__ImplementingMethodList.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 17:11:44 +0200
changeset 18767 0478d93cdb75
parent 10039 6ec92794fdd5
child 12123 4bde08cebd48
permissions -rw-r--r--
#REFACTORING by stefan Sanitize BlockValues class: Tools::Inspector2 changed: #toolbarBackgroundHolder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     2
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     3
 Copyright (c) 2009-2010 eXept Software AG
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     5
 Permission is hereby granted, free of charge, to any person
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     6
 obtaining a copy of this software and associated documentation
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     7
 files (the 'Software'), to deal in the Software without
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     8
 restriction, including without limitation the rights to use,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     9
 copy, modify, merge, publish, distribute, sublicense, and/or sell
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    10
 copies of the Software, and to permit persons to whom the
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    11
 Software is furnished to do so, subject to the following
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    12
 conditions:
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    13
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    14
 The above copyright notice and this permission notice shall be
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    15
 included in all copies or substantial portions of the Software.
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    16
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    17
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    18
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    19
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    20
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    21
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    22
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    23
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    24
 OTHER DEALINGS IN THE SOFTWARE.
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
MethodList subclass:#ImplementingMethodList
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	instanceVariableNames:'selectorList selectedSelectors'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	classVariableNames:''
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
	poolDictionaries:''
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	category:'Interface-Browsers-New'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!ImplementingMethodList class methodsFor:'documentation'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
copyright
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    41
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    42
 Copyright (c) 2009-2010 eXept Software AG
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    43
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    44
 Permission is hereby granted, free of charge, to any person
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    45
 obtaining a copy of this software and associated documentation
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    46
 files (the 'Software'), to deal in the Software without
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    47
 restriction, including without limitation the rights to use,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    48
 copy, modify, merge, publish, distribute, sublicense, and/or sell
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    49
 copies of the Software, and to permit persons to whom the
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    50
 Software is furnished to do so, subject to the following
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    51
 conditions:
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    53
 The above copyright notice and this permission notice shall be
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    54
 included in all copies or substantial portions of the Software.
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    55
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    56
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    57
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    58
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    59
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    60
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    61
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    62
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
    63
 OTHER DEALINGS IN THE SOFTWARE.
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
documentation
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    Like a ClassList, but shows classes hierarchical.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    If topClassHolders value is non-nil, only that classes hierarchy
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    is shown.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    embeddable application displaying the classes as listed by
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    the inputGenerator.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    Provides an outputGenerator, which enumerates the classes and
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    their protocols (method-categories) in the selected classes.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    [author:]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
	Claus Gittinger (cg@exept.de)
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!ImplementingMethodList class methodsFor:'plugIn spec'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
aspectSelectors
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "This resource specification was automatically generated
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
     by the UIPainter of ST/X."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    "Do not manually edit this. If it is corrupted,
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
     the UIPainter may not be able to read the specification."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Return a description of exported aspects;
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
     these can be connected to aspects of an embedding application
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
     (if this app is embedded in a subCanvas)."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    ^ #(
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
	#classHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
	#(#doubleClickChannel #action )
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
	#forceGeneratorTrigger
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
	#immediateUpdate
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
	#inGeneratorHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
	#outGeneratorHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
	#menuHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
	#methodCategoryHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
	#packageFilter
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
	#selectedMethods
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
	#selectionChangeCondition
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
	#updateTrigger
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
      ).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!ImplementingMethodList methodsFor:'aspects'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
selectedSelectors
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    selectedSelectors isNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
	selectedSelectors := ValueHolder new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
	selectedSelectors addDependent:self
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    ^ selectedSelectors.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!ImplementingMethodList methodsFor:'change & update'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
delayedUpdate:something with:aParameter from:changedObject
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    changedObject == selectedMethodNameIndices ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
"/        self selectedMethods value:(self selectedMethodNameIndices value collect:[:idx | methodList at:idx]).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
"/        lastSelectedMethods := self selectedMethods value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
	self selectedSelectors value:(self selectedMethodNameIndices value collect:[:idx | selectorList at:idx]).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
	"/ lastSelectedSelectors := self selectedSelectors value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
	^ self 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    changedObject == selectedSelectors ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
	self updateOutputGenerator.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
	^ self
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    super delayedUpdate:something with:aParameter from:changedObject
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Created: / 5.2.2000 / 13:42:14 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    "Modified: / 6.2.2000 / 00:05:26 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
selectedMethodsChanged
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    self updateOutputGenerator
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
selectionChanged
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    self halt:'should not happen'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
!ImplementingMethodList methodsFor:'generators'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
makeGenerator
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "return a generator which enumerates the methods from the selected protocol;
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
     that generator generates 4-element elements (includes the class and protocol), 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
     in order to make the consumers only depend on one input 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
     (i.e. to pass multiple-class and multiple-protocol info
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
      without a need for another classHolder/protocolHolder in the methodList)."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    ^ Iterator on:[:whatToDo |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
			|selectors items packages|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
			items := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
			selectors := self selectedSelectors value ? #().
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
			selectors size > 0 ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
			    packages := packageFilter value value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
			    selectors do:[:eachSelector |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
				classes do:[:eachClass | |mthd|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
				    mthd := eachClass compiledMethodAt:eachSelector.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
				    mthd notNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
					(packages isNil
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
					or:[packages includes:mthd package]) ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
					    items add:(Array with:eachClass with:mthd category with:eachSelector with:mthd)
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
					]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
				    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
				]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
			    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
			].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
			items sort:[:a :b |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
					|nm1 nm2 sel1 sel2|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
					nm1 := (a at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
					nm2 := (b at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
					nm1 < nm2 ifTrue:[ true ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
					ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
					    nm1 = nm2 ifFalse:[ false ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
					    ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
						sel1 := a at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
						sel2 := b at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
						sel1 < sel2
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
					    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
					]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
				    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
			items do:[:eachItem | whatToDo valueWithArguments:eachItem].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
		  ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
!ImplementingMethodList methodsFor:'private'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
listOfMethodNames
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    |entries selectorsAlready newNameList 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
     newClasses allCategories allSelectors generator 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
     "showCategory"  categoryOrCountPerSelector|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    generator := inGeneratorHolder value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    generator isNil ifTrue:[^ #() ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    newClasses := IdentitySet new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    selectorsAlready := IdentitySet new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    entries := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    allCategories := Set new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    allSelectors := Bag identityNew.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    categoryOrCountPerSelector := IdentityDictionary new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    "/ generator generates nil-selector entries
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    "/ to pass multiple-class and multiple-protocol info
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    generator do:[:cls :cat :sel :mthd | 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
			|catsAlready|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
			sel notNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
			    (selectorsAlready includes:sel) ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
				entries add:(Array with:cls with:sel with:mthd).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
				selectorsAlready add:sel
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
			    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
			    newClasses add:cls.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
			    allCategories add:cat.    
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
			    allSelectors add:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
			    catsAlready := categoryOrCountPerSelector at:sel ifAbsent:nil.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
			    catsAlready isNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
				categoryOrCountPerSelector at:sel put:cat.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
			    ] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
				catsAlready isInteger ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
				    categoryOrCountPerSelector at:sel put:(catsAlready + 1).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
				] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
				    catsAlready ~= cat ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
					categoryOrCountPerSelector at:sel put:2.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
				    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
				]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
			    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
			]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
		 ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    entries sort:[:a :b | |nmA nmB clsNmA clsNmB|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
			   nmA := (a at:2).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
			   nmB := (b at:2).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
			   nmA = nmB ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
			       clsNmA := (a at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
			       clsNmB := (b at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
			       clsNmA < clsNmB
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
			   ] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
			       nmA < nmB
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
			   ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
		 ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    newNameList := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    selectorList := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
    "/ showCategory := allCategories size > 1.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    entries do:[:entry |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
	|cls sel mthd s catOrCounts|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
	cls := entry at:1.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
	sel := entry at:2.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
	mthd := entry at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
"/        s := self 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
"/                listEntryForMethod:mthd 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
"/                selector:sel 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
"/                class:cls 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
"/                showClass:false 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
"/                showCategory:showCategory
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
"/                classFirst:false.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
"/        newNameList add:s.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
        
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
	selectorList add:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
	s := sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
	catOrCounts := categoryOrCountPerSelector at:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
	catOrCounts isInteger ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
	    s := s , ' { ... }'  "/ in multiple categories
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
	] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
	    allCategories size > 1 ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
		s := s , ' {' , catOrCounts , '}'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
	    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
	].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
	newNameList add:s.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    classes := newClasses.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    ^ newNameList.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    "Created: / 5.2.2000 / 22:43:40 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    "Modified: / 1.3.2000 / 21:00:26 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
release
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    super release.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    selectedSelectors removeDependent:self.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
!ImplementingMethodList class methodsFor:'documentation'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
version_CVS
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
   318
    ^ '$Header: /cvs/stx/stx/libtool/Tools__ImplementingMethodList.st,v 1.2 2011-07-03 13:37:06 cg Exp $'
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
version_SVN
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    ^ '§Id: Tools__ImplementingMethodList.st 7796 2011-06-23 16:01:32Z vranyj1 §'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
! !