Tools_FullMethodCategoryList.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 05 Sep 2013 12:46:11 +0200
changeset 13498 b8d845e42988
parent 8758 b08b67293652
permissions -rw-r--r--
Added `environment` instance variable to Tools__NewSystemBrowser and components it uses. The environment is by default initialized to Smalltalk. This allow for displaying limited subset of classes in the browser. The classes displayed does not even have to be classes and does not have to be installed in Smalltalk dictionary.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6179
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     1
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     2
 COPYRIGHT (c) 2004 by eXept Software AG
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     3
              All Rights Reserved
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     4
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     5
 This software is furnished under a license and may be used
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     6
 only in accordance with the terms of that license and with the
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     8
 be provided or otherwise made available to, or used by, any
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
     9
 other person.  No title to or ownership of the software is
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    10
 hereby transferred.
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    11
"
5592
d9730a8d7c52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5591
diff changeset
    12
"{ Package: 'stx:libtool' }"
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ NameSpace: Tools }"
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
MethodCategoryList subclass:#FullMethodCategoryList
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Interface-Browsers-New'
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!FullMethodCategoryList class methodsFor:'documentation'!
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
6179
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    25
copyright
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    26
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    27
 COPYRIGHT (c) 2004 by eXept Software AG
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    28
              All Rights Reserved
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    29
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    30
 This software is furnished under a license and may be used
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    31
 only in accordance with the terms of that license and with the
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    33
 be provided or otherwise made available to, or used by, any
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    34
 other person.  No title to or ownership of the software is
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    35
 hereby transferred.
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    36
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    37
!
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5592
diff changeset
    38
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    embeddable application displaying the classes as listed by
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    the inputGenerator.
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Provides an outputGenerator, which enumerates the classes and
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    their protocols (method-categories) in the selected classes.
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [author:]
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
	Claus Gittinger (cg@exept.de)
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!FullMethodCategoryList methodsFor:'generators'!
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
makeGenerator
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "return a generator which enumerates the methods from the selected protocol;
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
     that generator generates 4-element elements (includes the class and protocol), 
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
     in order to make the consumers only depend on one input 
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     (i.e. to pass multiple-class and multiple-protocol info
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
      without a need for another classHolder/protocolHolder in the methodList)."
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ^ Iterator on:[:whatToDo |
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    63
                        |protocols all packages theProtocol|
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    65
                        protocols := self selectedProtocols value ? #().
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    67
                        all := protocols includes:(self class nameListEntryForALL).
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    68
                        packages := packageFilter value value.
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    70
                        protocols size > 0 ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    71
                            protocols size == 1 ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    72
                                theProtocol := protocols first.
13498
b8d845e42988 Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 8758
diff changeset
    73
                                environment allClassesDo:[:eachClass |
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    74
                                    eachClass instAndClassSelectorsAndMethodsDo:[:sel :eachMethod |
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    75
                                        |cat|
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    77
                                        cat := eachMethod category.
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    78
                                        (all 
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    79
                                        or:[theProtocol = cat]) ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    80
                                            (packages isNil
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    81
                                            or:[packages includes:eachMethod package])
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    82
                                            ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    83
                                                whatToDo value:eachClass value:cat value:sel value:eachMethod.
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    84
                                            ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    85
                                        ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    86
                                    ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    87
                                ]
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    88
                            ] ifFalse:[
13498
b8d845e42988 Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 8758
diff changeset
    89
                                environment allClassesDo:[:eachClass |
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    90
                                    eachClass instAndClassSelectorsAndMethodsDo:[:sel :eachMethod |
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    91
                                        |cat|
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
8758
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    93
                                        cat := eachMethod category.
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    94
                                        (all 
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    95
                                        or:[protocols includes:cat]) ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    96
                                            (packages isNil
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    97
                                            or:[packages includes:eachMethod package])
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    98
                                            ifTrue:[
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    99
                                                whatToDo value:eachClass value:cat value:sel value:eachMethod.
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   100
                                            ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   101
                                        ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   102
                                    ].
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   103
                                ]
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   104
                            ]
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   105
                        ]
b08b67293652 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   106
                  ]
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!FullMethodCategoryList methodsFor:'private'!
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
listOfMethodCategories
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    |categories|
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    categories := Set new.
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
6669
a972530040a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6179
diff changeset
   116
    categories addAll:MethodCategoryCache new allMethodCategories.    
a972530040a4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6179
diff changeset
   117
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    categories := categories asOrderedCollection sort.
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    categories addFirst:(self class nameListEntryForALL).
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    ^ categories
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
! !
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!FullMethodCategoryList class methodsFor:'documentation'!
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
version
13498
b8d845e42988 Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 8758
diff changeset
   126
    ^ '$Header: /cvs/stx/stx/libtool/Tools_FullMethodCategoryList.st,v 1.6 2013-09-05 10:46:11 vrany Exp $'
5591
273637686948 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
! !