MethodSelectionBrowser.st
changeset 908 6862c9c822a3
parent 823 47e7d348e01a
child 1979 7b14d02e8ed1
equal deleted inserted replaced
907:393a5860fc7d 908:6862c9c822a3
    60 
    60 
    61 !MethodSelectionBrowser class methodsFor:'instance creation'!
    61 !MethodSelectionBrowser class methodsFor:'instance creation'!
    62 
    62 
    63 request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withTypes: protocolTypes
    63 request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withTypes: protocolTypes
    64     "opens a MethodSelectionBrowser on 
    64     "opens a MethodSelectionBrowser on 
    65 	aSuperclassOrSymbol, 
    65         aSuperclassOrSymbol, 
    66 	and aClassOrSymbol, 
    66         and aClassOrSymbol, 
    67 	and aSelector,
    67         and aSelector,
    68 	with allowed protocolTypes"
    68         with allowed protocolTypes"
    69 
    69 
    70     "
    70     "
    71     MethodSelectionBrowser
    71     MethodSelectionBrowser
    72 	request: 'Select a Method'
    72         request: 'Select a Method'
    73 	onSuperclass: #ApplicationModel 
    73         onSuperclass: #ApplicationModel 
    74 	andClass: #ToolApplicationModel 
    74         andClass: #MenuEditor 
    75 	andSelector: #saveIcon 
    75         andSelector: #menuItemImage
    76 	withTypes: #(class)      
    76         withTypes: #(class)      
    77     "
    77     "
    78 
    78 
    79     ^self new
    79     ^self new
    80 	title: aTitle;
    80         title: aTitle;
    81 	openOnSuperclass: aSuperclass
    81         openOnSuperclass: aSuperclass
    82 	andClass: aClass
    82         andClass: aClass
    83 	andSelector: aSelector
    83         andSelector: aSelector
    84 	withTypes: protocolTypes
    84         withTypes: protocolTypes
    85 
    85 
    86 
    86 
    87 ! !
    87 ! !
    88 
    88 
    89 !MethodSelectionBrowser class methodsFor:'list specs'!
    89 !MethodSelectionBrowser class methodsFor:'list specs'!
   130 !MethodSelectionBrowser methodsFor:'callbacks - user'!
   130 !MethodSelectionBrowser methodsFor:'callbacks - user'!
   131 
   131 
   132 classSelected
   132 classSelected
   133     "after a class selection, read the class or/and instance methods of the selected class"
   133     "after a class selection, read the class or/and instance methods of the selected class"
   134 
   134 
   135     self selectionOfClass value isNil ifTrue: [^nil].
   135     ClassPresentation = #'Class Hierarchy'
       
   136         ifTrue:  [self selectionOfClassHierarchy  value isNil ifTrue: [^nil]]
       
   137         ifFalse: [self selectionOfClassCategories value isNil ifTrue: [^nil]].
       
   138 
   136     self withWaitCursorDo:
   139     self withWaitCursorDo:
   137     [
   140     [
   138         |clsName contentsBlock|
   141         |clsName contentsBlock|
   139         resourceTypes isNil ifTrue: [resourceTypes := #(instance class)].
   142         resourceTypes isNil ifTrue: [resourceTypes := #(instance class)].
   140         clsName := (self selectionOfClass value name upTo: $ ) asSymbol.
   143         ClassPresentation = #'Class Hierarchy'
       
   144             ifTrue:  [clsName := (self selectionOfClassHierarchy  value name upTo: $ ) asSymbol]
       
   145             ifFalse: [clsName := (self selectionOfClassCategories value name upTo: $ ) asSymbol].
   141         self valueOfClassName value: clsName.
   146         self valueOfClassName value: clsName.
   142         self class lastSelection: clsName.
   147         self class lastSelection: clsName.
   143         self listOfResourceMethods removeAll.
   148         self listOfResourceMethods removeAll.
   144         contentsBlock := 
   149         contentsBlock := 
   145         [:protocol|
   150         [:protocol|