Tools__ImplementingClassList.st
author mawalch
Thu, 14 Sep 2017 14:21:48 +0200
changeset 17691 8c9f399ca8e9
parent 10040 57d6484b016b
child 12123 4bde08cebd48
child 18420 725860d08340
permissions -rw-r--r--
#BUGFIX by mawalch class: Tools::NewSystemBrowser changed: #selectorMenuSaveRemove Send #do: instead of #contains: as the block never returns true nor false (Only if the boolean values true and false would be used as selectors). Also: Terminating the iteration looks unwanted and the result is discarded anyway.

"
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
 Copyright (c) 2009-2010 eXept Software AG

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

MethodList subclass:#ImplementingClassList
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Browsers-New'
!

!ImplementingClassList class methodsFor:'documentation'!

copyright
"
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
 Copyright (c) 2009-2010 eXept Software AG

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
"
!

documentation
"
    Like a ClassList, but shows classes hierarchical.

    If topClassHolders value is non-nil, only that classes hierarchy
    is shown.

    embeddable application displaying the classes as listed by
    the inputGenerator.
    Provides an outputGenerator, which enumerates the classes and
    their protocols (method-categories) in the selected classes.

    [author:]
	Claus Gittinger (cg@exept.de)
"


! !

!ImplementingClassList methodsFor:'private'!

listOfMethodNames
    |methods entries newNameList 
     allCategories classUses allSelectors generator 
     "theMethod"|

    generator := inGeneratorHolder value.
    generator isNil ifTrue:[^ #() ].

    classUses := Bag identityNew.
    allSelectors := IdentitySet new.
    allCategories := Set new.
    entries := OrderedCollection new.

    "/ generator generates nil-selector entries
    "/ to pass multiple-class and multiple-protocol info
    generator do:[:cls :cat :sel :mthd | 
			sel notNil ifTrue:[
			    entries add:(Array with:cls with:sel with:mthd).
			    classUses add:cls.
			    allSelectors add:sel.
			    allCategories add:mthd category.
			]
		 ].

    entries sort:[:a :b | |clsNmA clsNmB|
			   clsNmA := (a at:1) name.
			   clsNmB := (b at:1) name.
			   clsNmA < clsNmB
		 ].

    newNameList := entries collect:[:entry | 
					|class nm|

					class := (entry at:1).
					nm := class name.
					((allSelectors size > 1)
					or:[(classUses occurrencesOf:class) > 1]) ifTrue:[
					    nm := nm , ' ' , (entry at:2)
					].
					allCategories size > 1 ifTrue:[
					    nm := nm , ' {' , (entry at:3) category , '}'
					].
"/                                        class name , ' ' , (entry at:2)
					nm
				   ].
    methods := entries collect:[:entry | (entry at:3)].
    methodList := methods.
"/    methods size == 1 ifTrue:[
"/        theMethod := methods first.
"/        self methodLabelHolder value:(theMethod mclass name , ' ' , theMethod selector).
"/    ].
    ^ newNameList.

    "Created: / 5.2.2000 / 22:43:40 / cg"
    "Modified: / 1.3.2000 / 21:00:26 / cg"
! !

!ImplementingClassList class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/Tools__ImplementingClassList.st,v 1.2 2011-07-03 13:37:11 cg Exp $'
!

version_SVN
    ^ '§Id: Tools__ImplementingClassList.st 7796 2011-06-23 16:01:32Z vranyj1 §'
! !