Tools__ImplementingMethodList.st
author Jan Vrany <jan.vrany@labware.com>
Wed, 05 Oct 2022 11:57:26 +0100
branchjv
changeset 19637 28f5bfaa093d
parent 12431 9f0c59c742d5
permissions -rw-r--r--
`NewSystemBrowser`: avoid updating package info when changed class is not selected This speeds up loading of packages when browser is open as it does not (needlessly) update package info which may involve scm round-trip.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
12123
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     2
 COPYRIGHT (c) 2004 by eXept Software AG
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     3
              All Rights Reserved
10039
6ec92794fdd5 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10004
diff changeset
     4
12123
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     5
 This software is furnished under a license and may be used
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     6
 only in accordance with the terms of that license and with the
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     8
 be provided or otherwise made available to, or used by, any
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
     9
 other person.  No title to or ownership of the software is
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    10
 hereby transferred.
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    11
"
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ NameSpace: Tools }"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
MethodList subclass:#ImplementingMethodList
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'selectorList selectedSelectors'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Interface-Browsers-New'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!ImplementingMethodList class methodsFor:'documentation'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
12123
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    27
 COPYRIGHT (c) 2004 by eXept Software AG
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    28
              All Rights Reserved
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
12123
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    30
 This software is furnished under a license and may be used
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    31
 only in accordance with the terms of that license and with the
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    33
 be provided or otherwise made available to, or used by, any
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    34
 other person.  No title to or ownership of the software is
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
    35
 hereby transferred.
10004
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    Like a ClassList, but shows classes hierarchical.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    If topClassHolders value is non-nil, only that classes hierarchy
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    is shown.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    embeddable application displaying the classes as listed by
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    the inputGenerator.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    Provides an outputGenerator, which enumerates the classes and
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    their protocols (method-categories) in the selected classes.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [author:]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
	Claus Gittinger (cg@exept.de)
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
!ImplementingMethodList class methodsFor:'plugIn spec'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
aspectSelectors
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    "This resource specification was automatically generated
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
     by the UIPainter of ST/X."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Do not manually edit this. If it is corrupted,
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     the UIPainter may not be able to read the specification."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    "Return a description of exported aspects;
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     these can be connected to aspects of an embedding application
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     (if this app is embedded in a subCanvas)."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    ^ #(
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
	#classHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
	#(#doubleClickChannel #action )
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
	#forceGeneratorTrigger
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
	#immediateUpdate
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
	#inGeneratorHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
	#outGeneratorHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
	#menuHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
	#methodCategoryHolder
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
	#packageFilter
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
	#selectedMethods
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
	#selectionChangeCondition
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
	#updateTrigger
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
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!ImplementingMethodList methodsFor:'aspects'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
selectedSelectors
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    selectedSelectors isNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
	selectedSelectors := ValueHolder new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
	selectedSelectors addDependent:self
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    ^ selectedSelectors.
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
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
!ImplementingMethodList methodsFor:'change & update'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
delayedUpdate:something with:aParameter from:changedObject
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    changedObject == selectedMethodNameIndices ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
"/        self selectedMethods value:(self selectedMethodNameIndices value collect:[:idx | methodList at:idx]).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
"/        lastSelectedMethods := self selectedMethods value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
        
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
	self selectedSelectors value:(self selectedMethodNameIndices value collect:[:idx | selectorList at:idx]).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
	"/ lastSelectedSelectors := self selectedSelectors value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
	^ self 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    changedObject == selectedSelectors ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
	self updateOutputGenerator.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
	^ self
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    super delayedUpdate:something with:aParameter from:changedObject
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "Created: / 5.2.2000 / 13:42:14 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    "Modified: / 6.2.2000 / 00:05:26 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
selectedMethodsChanged
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    self updateOutputGenerator
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
selectionChanged
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    self halt:'should not happen'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
!ImplementingMethodList methodsFor:'generators'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
makeGenerator
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    "return a generator which enumerates the methods from the selected protocol;
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
     that generator generates 4-element elements (includes the class and protocol), 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
     in order to make the consumers only depend on one input 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
     (i.e. to pass multiple-class and multiple-protocol info
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
      without a need for another classHolder/protocolHolder in the methodList)."
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    ^ Iterator on:[:whatToDo |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
			|selectors items packages|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
			items := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
			selectors := self selectedSelectors value ? #().
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
			selectors size > 0 ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
			    packages := packageFilter value value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
			    selectors do:[:eachSelector |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
				classes do:[:eachClass | |mthd|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
				    mthd := eachClass compiledMethodAt:eachSelector.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
				    mthd notNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
					(packages isNil
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
					or:[packages includes:mthd package]) ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
					    items add:(Array with:eachClass with:mthd category with:eachSelector with:mthd)
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
					]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
				    ]
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
			].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
			items sort:[:a :b |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
					|nm1 nm2 sel1 sel2|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
					nm1 := (a at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
					nm2 := (b at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
					nm1 < nm2 ifTrue:[ true ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
					ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
					    nm1 = nm2 ifFalse:[ false ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
					    ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
						sel1 := a at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
						sel2 := b at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
						sel1 < sel2
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
					    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
					]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
				    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
			items do:[:eachItem | whatToDo valueWithArguments:eachItem].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
		  ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
!ImplementingMethodList methodsFor:'private'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
listOfMethodNames
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    |entries selectorsAlready newNameList 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
     newClasses allCategories allSelectors generator 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
     "showCategory"  categoryOrCountPerSelector|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    generator := inGeneratorHolder value.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    generator isNil ifTrue:[^ #() ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    newClasses := IdentitySet new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    selectorsAlready := IdentitySet new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    entries := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    allCategories := Set new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    allSelectors := Bag identityNew.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    categoryOrCountPerSelector := IdentityDictionary new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    "/ generator generates nil-selector entries
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "/ to pass multiple-class and multiple-protocol info
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    generator do:[:cls :cat :sel :mthd | 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
			|catsAlready|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
			sel notNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
			    (selectorsAlready includes:sel) ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
				entries add:(Array with:cls with:sel with:mthd).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
				selectorsAlready add:sel
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
			    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
			    newClasses add:cls.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
			    allCategories add:cat.    
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
			    allSelectors add:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
			    catsAlready := categoryOrCountPerSelector at:sel ifAbsent:nil.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
			    catsAlready isNil ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
				categoryOrCountPerSelector at:sel put:cat.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
			    ] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
				catsAlready isInteger ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
				    categoryOrCountPerSelector at:sel put:(catsAlready + 1).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
				] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
				    catsAlready ~= cat ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
					categoryOrCountPerSelector at:sel put:2.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
				    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
				]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
			    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
			]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
		 ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    entries sort:[:a :b | |nmA nmB clsNmA clsNmB|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
			   nmA := (a at:2).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
			   nmB := (b at:2).
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
			   nmA = nmB ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
			       clsNmA := (a at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
			       clsNmB := (b at:1) name.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
			       clsNmA < clsNmB
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
			   ] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
			       nmA < nmB
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
			   ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
		 ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    newNameList := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    selectorList := OrderedCollection new.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    "/ showCategory := allCategories size > 1.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    entries do:[:entry |
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
	|cls sel mthd s catOrCounts|
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
	cls := entry at:1.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
	sel := entry at:2.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
	mthd := entry at:3.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
"/        s := self 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
"/                listEntryForMethod:mthd 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
"/                selector:sel 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
"/                class:cls 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
"/                showClass:false 
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
"/                showCategory:showCategory
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
"/                classFirst:false.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
"/        newNameList add:s.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
        
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
	selectorList add:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
	s := sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
	catOrCounts := categoryOrCountPerSelector at:sel.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
	catOrCounts isInteger ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
	    s := s , ' { ... }'  "/ in multiple categories
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
	] ifFalse:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
	    allCategories size > 1 ifTrue:[
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
		s := s , ' {' , catOrCounts , '}'
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
	    ]
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
	].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
	newNameList add:s.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
    ].
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    classes := newClasses.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    ^ newNameList.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
    "Created: / 5.2.2000 / 22:43:40 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    "Modified: / 1.3.2000 / 21:00:26 / cg"
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
release
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    super release.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
    selectedSelectors removeDependent:self.
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
! !
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
!ImplementingMethodList class methodsFor:'documentation'!
65e6afd3a322 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
12123
4bde08cebd48 trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10039
diff changeset
   289
version
12314
0cbf76168690 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   290
    ^ '$Id: Tools__ImplementingMethodList.st 8083 2013-01-14 11:48:37Z vranyj1 $'
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   291
!
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   292
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   293
version_HG
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   294
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   295
    ^ '$Changeset: <not expanded> $'
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   296
!
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   297
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   298
version_SVN
12314
0cbf76168690 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   299
    ^ '$Id: Tools__ImplementingMethodList.st 8083 2013-01-14 11:48:37Z vranyj1 $'
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
   300
! !
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12314
diff changeset
   301