ResourceSelectionBrowser.st
changeset 680 49c81e9cc6f7
parent 664 6ed67e67d321
child 689 ff099c344dd6
equal deleted inserted replaced
679:9cd2115ac627 680:49c81e9cc6f7
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 SelectionBrowser subclass:#ResourceSelectionBrowser
    14 SelectionBrowser subclass:#ResourceSelectionBrowser
    15 	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes
    15 	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes
    16 		allClasses'
    16 		allClasses classSelectionBlock'
    17 	classVariableNames:''
    17 	classVariableNames:''
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Interface-Dialogs'
    19 	category:'Interface-Dialogs'
    20 !
    20 !
    21 
    21 
    76 
    76 
    77 !ResourceSelectionBrowser class methodsFor:'callbacks - default'!
    77 !ResourceSelectionBrowser class methodsFor:'callbacks - default'!
    78 
    78 
    79 treeViewChildren
    79 treeViewChildren
    80 
    80 
    81     ^[:aTreeItem| aTreeItem contents subclasses asSortedCollection: [:i1 :i2| i1 name < i2 name]]
    81     ^[:aTreeItem|
       
    82         |classes|
       
    83         classes := OrderedCollection new.    
       
    84         classes 
       
    85             addAll: (aTreeItem contents subclasses asSortedCollection: [:i1 :i2| i1 name < i2 name]);
       
    86         yourself]
    82 
    87 
    83 !
    88 !
    84 
    89 
    85 treeViewContents
    90 treeViewContents
    86 
    91 
    91 
    96 
    92 !
    97 !
    93 
    98 
    94 treeViewIcon
    99 treeViewIcon
    95 
   100 
    96     ^[:aTreeItem|  
   101     ^[self iconClass]
    97         aTreeItem contents subclasses notEmpty 
       
    98         ifTrue: 
       
    99         [
       
   100             aTreeItem hide 
       
   101                 ifTrue:  [self iconHidingSubclasses] 
       
   102                 ifFalse: [self iconShowingSubclasses]] 
       
   103         ifFalse: 
       
   104         [
       
   105             self iconClass
       
   106         ]
       
   107      ]
       
   108 
   102 
   109 !
   103 !
   110 
   104 
   111 treeViewLabel
   105 treeViewLabel
   112 
   106 
   133      
   127      
   134        #(#FullSpec
   128        #(#FullSpec
   135           #window: 
   129           #window: 
   136            #(#WindowSpec
   130            #(#WindowSpec
   137               #name: 'Resource Selection Browser'
   131               #name: 'Resource Selection Browser'
   138               #layout: #(#LayoutFrame 155 0 154 0 754 0 503 0)
   132               #layout: #(#LayoutFrame 197 0 172 0 796 0 521 0)
   139               #label: 'Resource Selection Browser'
   133               #label: 'Resource Selection Browser'
   140               #min: #(#Point 400 300)
   134               #min: #(#Point 400 300)
   141               #max: #(#Point 1152 864)
   135               #max: #(#Point 1152 864)
   142               #bounds: #(#Rectangle 155 154 755 504)
   136               #bounds: #(#Rectangle 197 172 797 522)
   143               #usePreferredExtent: false
   137               #usePreferredExtent: false
   144           )
   138           )
   145           #component: 
   139           #component: 
   146            #(#SpecCollection
   140            #(#SpecCollection
   147               #collection: 
   141               #collection: 
   159                                #(#SpecCollection
   153                                #(#SpecCollection
   160                                   #collection: 
   154                                   #collection: 
   161                                    #(
   155                                    #(
   162                                      #(#SelectionInTreeViewSpec
   156                                      #(#SelectionInTreeViewSpec
   163                                         #name: 'listOfClassesView'
   157                                         #name: 'listOfClassesView'
   164                                         #layout: #(#LayoutFrame 0 0.0 22 0.0 0 1.0 -22 1.0)
   158                                         #layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -22 1.0)
   165                                         #model: #selectionOfClass
   159                                         #model: #selectionOfClass
   166                                         #hasHorizontalScrollBar: true
   160                                         #hasHorizontalScrollBar: true
   167                                         #hasVerticalScrollBar: true
   161                                         #hasVerticalScrollBar: true
   168                                         #miniScrollerHorizontal: true
   162                                         #miniScrollerHorizontal: true
   169                                         #showDirectoryIndicatorForRoot: false
   163                                         #showDirectoryIndicatorForRoot: false
   179                                         #name: 'classNameInputField'
   173                                         #name: 'classNameInputField'
   180                                         #layout: #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1)
   174                                         #layout: #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1)
   181                                         #model: #valueOfClassName
   175                                         #model: #valueOfClassName
   182                                     )
   176                                     )
   183                                      #(#LabelSpec
   177                                      #(#LabelSpec
   184                                         #name: 'Label1'
   178                                         #name: 'ClassHierarchyLabel'
   185                                         #layout: #(#LayoutFrame 0 0 0 0 297 0 22 0)
   179                                         #layout: #(#LayoutFrame 0 0 2 0 297 0 23 0)
   186                                         #label: ' Class Hierarchy'
   180                                         #label: ' Class Hierarchy'
   187                                         #level: 1
   181                                         #level: 1
   188                                         #adjust: #left
   182                                         #adjust: #left
   189                                     )
   183                                     )
   190                                   )
   184                                   )
   196                                #(#SpecCollection
   190                                #(#SpecCollection
   197                                   #collection: 
   191                                   #collection: 
   198                                    #(
   192                                    #(
   199                                      #(#DataSetSpec
   193                                      #(#DataSetSpec
   200                                         #name: 'resourcesDataSetView'
   194                                         #name: 'resourcesDataSetView'
   201                                         #layout: #(#LayoutFrame 2 0.0 0 0.0 -2 1.0 -22 1.0)
   195                                         #layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -22 1.0)
   202                                         #model: #selectionOfResource
   196                                         #model: #selectionOfResource
   203                                         #hasHorizontalScrollBar: true
   197                                         #hasHorizontalScrollBar: true
   204                                         #hasVerticalScrollBar: true
   198                                         #hasVerticalScrollBar: true
   205                                         #miniScrollerHorizontal: true
   199                                         #miniScrollerHorizontal: true
   206                                         #rowClassName: 'ResourceSelectionBrowser::Row'
   200                                         #rowClassName: 'ResourceSelectionBrowser::Row'
   224                     )
   218                     )
   225                     #handles: #(#Any 0.5 1.0)
   219                     #handles: #(#Any 0.5 1.0)
   226                 )
   220                 )
   227                  #(#UISubSpecification
   221                  #(#UISubSpecification
   228                     #name: 'SubSpecification'
   222                     #name: 'SubSpecification'
   229                     #layout: #(#LayoutFrame 2 0.0 -32 1 -2 1.0 -8 1.0)
   223                     #layout: #(#LayoutFrame 301 0.0 -32 1 -2 1.0 -8 1.0)
   230                     #majorKey: #ToolApplicationModel
   224                     #majorKey: #ToolApplicationModel
   231                     #minorKey: #windowSpecForCommitWithoutChannels
   225                     #minorKey: #windowSpecForCommitWithoutChannels
       
   226                 )
       
   227                  #(#HorizontalPanelViewSpec
       
   228                     #name: 'HorizontalPanelView1'
       
   229                     #layout: #(#LayoutFrame 3 0 76 0.691429 300 0 0 0.977143)
       
   230                     #component: 
       
   231                      #(#SpecCollection
       
   232                         #collection: 
       
   233                          #(
       
   234                            #(#LabelSpec
       
   235                               #name: 'Label2'
       
   236                               #label: 'Create: '
       
   237                               #adjust: #right
       
   238                               #extent: #(#Point 67 24)
       
   239                           )
       
   240                            #(#ActionButtonSpec
       
   241                               #name: 'CreateClassButton'
       
   242                               #activeHelpKey: #dss
       
   243                               #label: 'Class'
       
   244                               #model: #createClass:
       
   245                               #actionValue: 'class'
       
   246                               #extent: #(#Point 72 24)
       
   247                           )
       
   248                            #(#ActionButtonSpec
       
   249                               #name: 'CreateSubclassButton'
       
   250                               #activeHelpKey: #dss
       
   251                               #label: 'Subclass'
       
   252                               #model: #createClass:
       
   253                               #actionValue: 'subclass'
       
   254                               #extent: #(#Point 72 24)
       
   255                           )
       
   256                            #(#ActionButtonSpec
       
   257                               #name: 'CreatePrivateClassButton'
       
   258                               #activeHelpKey: #dss
       
   259                               #label: 'Private'
       
   260                               #model: #createClass:
       
   261                               #actionValue: 'private'
       
   262                               #extent: #(#Point 72 24)
       
   263                           )
       
   264                         )
       
   265                     )
       
   266                     #horizontalLayout: #fit
       
   267                     #verticalLayout: #fit
   232                 )
   268                 )
   233               )
   269               )
   234           )
   270           )
   235       )
   271       )
   236 ! !
   272 ! !
   269 
   305 
   270     <resource: #image>
   306     <resource: #image>
   271 
   307 
   272     ^Icon
   308     ^Icon
   273         constantNamed:#'ResourceSelectionBrowser iconClass'
   309         constantNamed:#'ResourceSelectionBrowser iconClass'
   274         ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 21 85 85 85 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 12 26 170 170 170 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 0 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]!
   310         ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@UUUUUAQ****(@F**** @Z****@A****(@F**** @Z****@A****(LF**** TZ****@A****(@F**** @Z****@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself]
   275 
   311 !
   276 iconHidingSubclasses
   312 
       
   313 iconPrivateClass
   277     "Generated by the Image Editor"
   314     "Generated by the Image Editor"
   278     "
   315     "
   279     ImageEditor openOnClass:self andSelector:#iconHidingSubclasses
   316     ImageEditor openOnClass:self andSelector:#iconPrivateClass
   280     "
   317     "
   281 
   318 
   282     <resource: #image>
   319     <resource: #image>
   283 
   320 
   284     ^Icon
   321     ^Icon
   285         constantNamed:#'ResourceSelectionBrowser iconHidingSubclasses'
   322         constantNamed:#'ResourceSelectionBrowser iconPrivateClass'
   286         ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]!
   323         ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU@A****(@F*??* @Z/??*@A+???(MF/??> @Z5UU:@A+UUW(DF/??> @Z???:@A*??>(@F*??* @Z****C@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself]
   287 
   324 !
   288 iconShowingSubclasses
   325 
       
   326 iconRealPrivateClass
   289     "Generated by the Image Editor"
   327     "Generated by the Image Editor"
   290     "
   328     "
   291     ImageEditor openOnClass:self andSelector:#iconShowingSubclasses
   329     ImageEditor openOnClass:self andSelector:#iconRealPrivateClass
   292     "
   330     "
   293 
   331 
   294     <resource: #image>
   332     <resource: #image>
   295 
   333 
   296     ^Icon
   334     ^Icon
   297         constantNamed:#'ResourceSelectionBrowser iconShowingSubclasses'
   335         constantNamed:#'ResourceSelectionBrowser iconRealPrivateClass'
   298         ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 5 85 85 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 8 136 136 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]! !
   336         ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU@A****(@F*??* @Z/??*@A+???(OF/??> @Z5UU:@A+UUW(DF/??> @Z???:@A*??>(@F*??* @Z****C0@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself]
       
   337 ! !
   299 
   338 
   300 !ResourceSelectionBrowser methodsFor:'accessing - views'!
   339 !ResourceSelectionBrowser methodsFor:'accessing - views'!
   301 
   340 
   302 classNameInputField
   341 classNameInputField
   303 
   342 
   379     ^ holder
   418     ^ holder
   380 ! !
   419 ! !
   381 
   420 
   382 !ResourceSelectionBrowser methodsFor:'callbacks - tree view'!
   421 !ResourceSelectionBrowser methodsFor:'callbacks - tree view'!
   383 
   422 
       
   423 treeViewChildren
       
   424 
       
   425     ^[:aTreeItem|
       
   426         |classes|
       
   427         classes := self class treeViewChildren value: aTreeItem.
       
   428         classes addAll: (aTreeItem contents privateClasses asSortedCollection: [:i1 :i2| i1 name < i2 name]);
       
   429         yourself]
       
   430 !
       
   431 
   384 treeViewContents
   432 treeViewContents
   385 
   433 
   386     ^(Smalltalk at: resourceSuperclass) ? self class treeViewContents
   434     ^(Smalltalk at: resourceSuperclass) ? self class treeViewContents
   387 
   435 
   388 
   436 
   389 !
   437 !
   390 
   438 
   391 treeViewIcon
   439 treeViewIcon
   392 
   440 
   393     ^self class treeViewIcon
   441     ^[:aTreeItem|
       
   442         |icon|
       
   443         icon := self class treeViewIcon value.
       
   444         aTreeItem contents isPrivate 
       
   445         ifTrue:
       
   446         [
       
   447             aTreeItem parent contents ~~ aTreeItem contents superclass
       
   448                 ifTrue: [icon := self class iconRealPrivateClass]
       
   449                 ifFalse: [icon := self class iconPrivateClass]
       
   450         ].
       
   451         icon]
   394 !
   452 !
   395 
   453 
   396 treeViewLabel
   454 treeViewLabel
   397 
   455 
   398     ^self class treeViewLabel
   456     ^[:aTreeItem|
   399 
   457         |label superCls|
       
   458         label := self class treeViewLabel value: aTreeItem.
       
   459         (aTreeItem contents isPrivate and: [aTreeItem parent contents ~~ (superCls := aTreeItem contents superclass)])
       
   460             ifTrue: [label := label, ' (', superCls name, ')'].
       
   461         label]
   400 ! !
   462 ! !
   401 
   463 
   402 !ResourceSelectionBrowser methodsFor:'callbacks - user'!
   464 !ResourceSelectionBrowser methodsFor:'callbacks - user'!
   403 
   465 
   404 classSelected: anIndex
   466 classSelected: anIndex
   406     self selectionOfClass value isNil ifTrue: [^nil].
   468     self selectionOfClass value isNil ifTrue: [^nil].
   407     self withWaitCursorDo:
   469     self withWaitCursorDo:
   408     [
   470     [
   409         |clsName|
   471         |clsName|
   410         resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
   472         resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
   411         clsName := self listOfClassesView list at: anIndex.
   473         clsName := ((self listOfClassesView list at: anIndex) upTo: $ ) asSymbol.
   412         self valueOfClassName value: clsName.
   474         self valueOfClassName value: clsName.
   413         self class lastSelection: clsName.
   475         self class lastSelection: clsName.
   414         self listOfResources contents:
   476         self listOfResources contents:
   415             ((((Smalltalk at: clsName) 
   477             ((((Smalltalk at: clsName) 
   416                 class methodDictionary
   478                 class methodDictionary
   418                     [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
   480                     [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
   419              collect: [:m| Row new method: m]).
   481              collect: [:m| Row new method: m]).
   420     ]
   482     ]
   421 !
   483 !
   422 
   484 
       
   485 createClass: what
       
   486 
       
   487     |clsCandidat cls|
       
   488     clsCandidat := self valueOfClassName value asSymbol.
       
   489 
       
   490     (Smalltalk at: clsCandidat) notNil 
       
   491         ifTrue: [^self warn: 'Cannot create class ', clsCandidat asBoldText,
       
   492                 '!!\Key with that name in dictionary ' withCRs, 'Smalltalk' asBoldText, ' detected.'].
       
   493 
       
   494     cls := self selectionOfClass value contents.
       
   495     what = 'class' ifTrue: [cls := cls superclass].
       
   496 
       
   497     cls isNil ifTrue: [^self warn: 'May not create class with superclass ', 'nil' asBoldText, '!!'].
       
   498 
       
   499     what = 'private' 
       
   500         ifFalse: [cls subclass: clsCandidat
       
   501         instanceVariableNames:''
       
   502         classVariableNames:''
       
   503         poolDictionaries:''
       
   504         category: cls category.]
       
   505     ifTrue:
       
   506     [
       
   507         |superClsCandidate|
       
   508         superClsCandidate := (Dialog 
       
   509                 request: 'Enter name of superclass of private class.'
       
   510                 initialAnswer: 'Object') asSymbol.
       
   511         (superClsCandidate := Smalltalk at: superClsCandidate) isNil ifTrue: [^nil].
       
   512 
       
   513         (superClsCandidate isClass and: [superClsCandidate isPrivate not])
       
   514             ifFalse: [^self warn: 'May not create private class with superclass ', superClsCandidate asBoldText, '!!'].
       
   515         superClsCandidate subclass: clsCandidat
       
   516             instanceVariableNames:''
       
   517             classVariableNames:''
       
   518             poolDictionaries:''
       
   519             privateIn: cls
       
   520     ].
       
   521 
       
   522     allClasses := Object withAllSubclasses.
       
   523 
       
   524     what = 'class' 
       
   525         ifTrue:  [self selectionOfClass value parent changed: #children]
       
   526         ifFalse: [self selectionOfClass value changed: #children].
       
   527 
       
   528     classSelectionBlock value: self valueOfClassName value
       
   529 !
       
   530 
   423 resourceDoubleClicked
   531 resourceDoubleClicked
   424 
   532 
   425     resourceMethod := self selectionOfResource value.
   533     resourceMethod := self selectionOfResource value.
   426     accept value: true.
   534     accept value: true.
   427     self close
   535     self close
   450     (self selectionOfClass value notNil and:
   558     (self selectionOfClass value notNil and:
   451     [(cls := Smalltalk at: self selectionOfClass value name) isClass and:
   559     [(cls := Smalltalk at: self selectionOfClass value name) isClass and:
   452     [accept value]]) 
   560     [accept value]]) 
   453     ifTrue:
   561     ifTrue:
   454     [
   562     [
   455         ^cls name, ' ', self valueOfSelector value
   563         ^self valueOfClassName value, ' ', self valueOfSelector value
   456     ].
   564     ].
   457     ^nil
   565     ^nil
   458 ! !
   566 ! !
   459 
   567 
   460 !ResourceSelectionBrowser methodsFor:'startup / release'!
   568 !ResourceSelectionBrowser methodsFor:'startup / release'!
   468 
   576 
   469 !
   577 !
   470 
   578 
   471 postBuildWith:aBuilder
   579 postBuildWith:aBuilder
   472 
   580 
   473     |classSelection classSelectionBlock|
   581     |classSelection|
   474     allClasses := Object withAllSubclasses.
   582     allClasses := Object withAllSubclasses.
   475     classSelection :=  resourceClass ? self class lastSelection ? #Object.
   583     classSelection :=  resourceClass ? self class lastSelection.
       
   584     (Smalltalk at: classSelection) isNil ifTrue: [classSelection := #Object].
   476     classSelectionBlock := 
   585     classSelectionBlock := 
   477     [:clsPattern|                                  
   586     [:clsPattern|                                  
   478         |foundClass classes|         
   587         |foundClass classes|         
   479         ((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or:
   588         ((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or:
   480         [foundClass name ~= clsPattern])
   589         [foundClass name ~= clsPattern])
   507         classSelectionBlock value: self classNameInputField contents
   616         classSelectionBlock value: self classNameInputField contents
   508     ].
   617     ].
   509     self listOfClassesView validateDoubleClickBlock: [:aTreeItem | aTreeItem contents ~~ self treeViewContents].
   618     self listOfClassesView validateDoubleClickBlock: [:aTreeItem | aTreeItem contents ~~ self treeViewContents].
   510     self listOfClassesView selectedNodeExpand: true.
   619     self listOfClassesView selectedNodeExpand: true.
   511 
   620 
   512     [[classSelectionBlock value: classSelection] value.
   621     [
   513     self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil)]
   622         [classSelectionBlock value: classSelection] value.
       
   623         self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil)
       
   624     ]
   514     forkAt: 4.
   625     forkAt: 4.
   515 
   626 
   516     ^super postBuildWith:aBuilder
   627     ^super postBuildWith:aBuilder
   517 
   628 
   518 ! !
   629 ! !
   521 
   632 
   522 iconOn:aGC
   633 iconOn:aGC
   523 
   634 
   524     icon isNil ifTrue: [icon := method iconOn: aGC].
   635     icon isNil ifTrue: [icon := method iconOn: aGC].
   525     ^icon
   636     ^icon
       
   637 
   526 !
   638 !
   527 
   639 
   528 method: aMethod
   640 method: aMethod
   529 
   641 
   530     method := aMethod
   642     method := aMethod