ResourceSelectionBrowser.st
changeset 523 eec155f1b037
parent 517 91ff807d8a23
child 563 81f54df8d333
equal deleted inserted replaced
522:06bef91cb861 523:eec155f1b037
    15 	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes
    15 	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes
    16 		allClasses'
    16 		allClasses'
    17 	classVariableNames:''
    17 	classVariableNames:''
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Interface-Advanced-Tools'
    19 	category:'Interface-Advanced-Tools'
       
    20 !
       
    21 
       
    22 Object subclass:#Row
       
    23 	instanceVariableNames:'method icon resourceType selector'
       
    24 	classVariableNames:''
       
    25 	poolDictionaries:''
       
    26 	privateIn:ResourceSelectionBrowser
    20 !
    27 !
    21 
    28 
    22 !ResourceSelectionBrowser class methodsFor:'documentation'!
    29 !ResourceSelectionBrowser class methodsFor:'documentation'!
    23 
    30 
    24 copyright
    31 copyright
    90      
    97      
    91        #(#FullSpec
    98        #(#FullSpec
    92           #'window:' 
    99           #'window:' 
    93            #(#WindowSpec
   100            #(#WindowSpec
    94               #'name:' 'Resource Browser'
   101               #'name:' 'Resource Browser'
    95               #'layout:' #(#LayoutFrame 315 0 311 0 726 0 610 0)
   102               #'layout:' #(#LayoutFrame 460 0 343 0 871 0 642 0)
    96               #'label:' 'Resource Browser'
   103               #'label:' 'Resource Browser'
    97               #'min:' #(#Point 400 300)
   104               #'min:' #(#Point 400 300)
    98               #'max:' #(#Point 1152 864)
   105               #'max:' #(#Point 1152 864)
    99               #'bounds:' #(#Rectangle 315 311 727 611)
   106               #'bounds:' #(#Rectangle 460 343 872 643)
   100               #'usePreferredExtent:' false
   107               #'usePreferredExtent:' false
   101           )
   108           )
   102           #'component:' 
   109           #'component:' 
   103            #(#SpecCollection
   110            #(#SpecCollection
   104               #'collection:' 
   111               #'collection:' 
   148                                         #'layout:' #(#LayoutFrame 2 0.0 0 0.0 2 1.0 -22 1.0)
   155                                         #'layout:' #(#LayoutFrame 2 0.0 0 0.0 2 1.0 -22 1.0)
   149                                         #'model:' #selectionOfResource
   156                                         #'model:' #selectionOfResource
   150                                         #'hasHorizontalScrollBar:' true
   157                                         #'hasHorizontalScrollBar:' true
   151                                         #'hasVerticalScrollBar:' true
   158                                         #'hasVerticalScrollBar:' true
   152                                         #'miniScrollerHorizontal:' true
   159                                         #'miniScrollerHorizontal:' true
       
   160                                         #'rowClassName:' 'ResourceSelectionBrowser::Row'
   153                                         #'dataList:' #listOfResources
   161                                         #'dataList:' #listOfResources
   154                                         #'useIndex:' false
   162                                         #'useIndex:' false
   155                                         #'has3Dsepartors:' true
   163                                         #'has3Dsepartors:' true
   156                                         #'doubleClickSelector:' #resourceDoubleClicked
   164                                         #'doubleClickSelector:' #resourceDoubleClicked
   157                                         #'valueChangeSelector:' #resourceSelected
   165                                         #'valueChangeSelector:' #resourceSelected
   158                                         #'verticalSpacing:' 1
   166                                         #'verticalSpacing:' 1
   159                                         #'columns:' 
   167                                         #'columns:' 
   160                                          #(
   168                                          #(
   161                                            #(#DataSetColumnSpec
   169                                            #(#DataSetColumnSpec
   162                                               #'width:' 20
   170                                               #'width:' 20
       
   171                                               #'height:' 20
   163                                               #'printSelector:' #'iconOn:'
   172                                               #'printSelector:' #'iconOn:'
   164                                               #'canSelect:' false
   173                                               #'canSelect:' false
   165                                           )
   174                                           )
   166                                            #(#DataSetColumnSpec
   175                                            #(#DataSetColumnSpec
   167                                               #'label:' 'Selector'
   176                                               #'label:' 'Selector'
   283         resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
   292         resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
   284         clsName := self listOfClassesView list at: anIndex.
   293         clsName := self listOfClassesView list at: anIndex.
   285         self valueOfClassName value: clsName.
   294         self valueOfClassName value: clsName.
   286         self class lastSelection: clsName.
   295         self class lastSelection: clsName.
   287         self listOfResources contents:
   296         self listOfResources contents:
   288             ((Smalltalk at: clsName) 
   297             ((((Smalltalk at: clsName) 
   289                 class methodDictionary
   298                 class methodDictionary
   290                 asOrderedCollection select: 
   299                 asOrderedCollection select: 
   291                     [:m|m resources notNil and: [resourceTypes includes: m resourceType]]).
   300                     [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
       
   301              collect: [:m| Row new method: m]).
   292     ]
   302     ]
   293 !
   303 !
   294 
   304 
   295 resourceDoubleClicked
   305 resourceDoubleClicked
   296 
   306 
   334         ].
   344         ].
   335         self valueOfClassName value: clsPattern
   345         self valueOfClassName value: clsPattern
   336     ].
   346     ].
   337     classSelectionBlock value: classSelection.
   347     classSelectionBlock value: classSelection.
   338     self valueOfClassName value: classSelection.
   348     self valueOfClassName value: classSelection.
   339     self selectionOfResource value: (self listOfResources detect: [:m| m who methodSelector == resourceMethod] ifNone: nil).
   349     self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil).
   340     self classNameInputField entryCompletionBlock:
   350     self classNameInputField entryCompletionBlock:
   341     [:value|
   351     [:value|
   342         |what|
   352         |what|
   343         what := Smalltalk classnameCompletion: value withoutSpaces.
   353         what := Smalltalk classnameCompletion: value withoutSpaces.
   344         self classNameInputField contents:what first.
   354         self classNameInputField contents:what first.
   380 
   390 
   381 
   391 
   382 
   392 
   383 ! !
   393 ! !
   384 
   394 
       
   395 !ResourceSelectionBrowser::Row methodsFor:'accessing'!
       
   396 
       
   397 iconOn:aGC
       
   398 
       
   399     icon isNil ifTrue: [icon := method iconOn: aGC].
       
   400     ^icon
       
   401 !
       
   402 
       
   403 method: aMethod
       
   404 
       
   405     method := aMethod
       
   406 !
       
   407 
       
   408 resourceType
       
   409 
       
   410     resourceType isNil ifTrue: [resourceType := method resourceType].
       
   411     ^resourceType
       
   412 !
       
   413 
       
   414 selector
       
   415 
       
   416     selector isNil ifTrue: [selector := method who methodSelector].
       
   417     ^selector
       
   418 ! !
       
   419 
   385 !ResourceSelectionBrowser class methodsFor:'documentation'!
   420 !ResourceSelectionBrowser class methodsFor:'documentation'!
   386 
   421 
   387 version
   422 version
   388     ^ '$Header$'
   423     ^ '$Header$'
   389 ! !
   424 ! !