MethodSelectionBrowser.st
changeset 646 d2fc253819c1
child 650 495b35593c09
equal deleted inserted replaced
645:9f422fbbd801 646:d2fc253819c1
       
     1 "
       
     2  COPYRIGHT (c) 1997 by eXept Software AG
       
     3               All Rights Reserved
       
     4 
       
     5  This software is furnished under a license and may be used
       
     6  only in accordance with the terms of that license and with the
       
     7  inclusion of the above copyright notice. This software may not
       
     8  be provided or otherwise made available to, or used by, any
       
     9  other person. No title to or ownership of the software is
       
    10  hereby transferred.
       
    11 "
       
    12 
       
    13 
       
    14 
       
    15 ResourceSelectionBrowser subclass:#MethodSelectionBrowser
       
    16 	instanceVariableNames:''
       
    17 	classVariableNames:''
       
    18 	poolDictionaries:''
       
    19 	category:'Interface-Dialogs'
       
    20 !
       
    21 
       
    22 Object subclass:#Row
       
    23 	instanceVariableNames:'selector type'
       
    24 	classVariableNames:''
       
    25 	poolDictionaries:''
       
    26 	privateIn:MethodSelectionBrowser
       
    27 !
       
    28 
       
    29 !MethodSelectionBrowser class methodsFor:'documentation'!
       
    30 
       
    31 copyright
       
    32 "
       
    33  COPYRIGHT (c) 1997 by eXept Software AG
       
    34               All Rights Reserved
       
    35 
       
    36  This software is furnished under a license and may be used
       
    37  only in accordance with the terms of that license and with the
       
    38  inclusion of the above copyright notice. This software may not
       
    39  be provided or otherwise made available to, or used by, any
       
    40  other person. No title to or ownership of the software is
       
    41  hereby transferred.
       
    42 "
       
    43 
       
    44 
       
    45 !
       
    46 
       
    47 documentation
       
    48 "
       
    49     [start with:]
       
    50         MethodSelectionBrowser open
       
    51 
       
    52     [author:]
       
    53         Thomas Zwick
       
    54 "
       
    55 
       
    56 ! !
       
    57 
       
    58 !MethodSelectionBrowser class methodsFor:'instance creation'!
       
    59 
       
    60 request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withTypes: aResourceTypes
       
    61 
       
    62     "self
       
    63         request: 'Select A Method'
       
    64         onSuperclass: #ApplicationModel 
       
    65         andClass: #ToolApplicationModel 
       
    66         andSelector: #saveIcon 
       
    67         withTypes: #(class)  
       
    68     "
       
    69 
       
    70     ^self new
       
    71         title: aTitle;
       
    72         openOnSuperclass: aSuperclass
       
    73         andClass: aClass
       
    74         andSelector: aSelector
       
    75         withTypes: aResourceTypes
       
    76 
       
    77 
       
    78 ! !
       
    79 
       
    80 !MethodSelectionBrowser class methodsFor:'list specs'!
       
    81 
       
    82 columnsOfDataSetView
       
    83 
       
    84   ^ #(
       
    85    #(#DataSetColumnSpec
       
    86       #label: 'Selector'
       
    87       #model: #selector
       
    88       #canSelect: false
       
    89   )
       
    90    (#DataSetColumnSpec
       
    91       #label: 'Type'
       
    92       #model: #type
       
    93       #canSelect: false
       
    94   ))
       
    95 
       
    96 
       
    97 
       
    98 
       
    99 ! !
       
   100 
       
   101 !MethodSelectionBrowser methodsFor:'callbacks - user'!
       
   102 
       
   103 classSelected: anIndex
       
   104 
       
   105     self selectionOfClass value isNil ifTrue: [^nil].
       
   106     self withWaitCursorDo:
       
   107     [
       
   108         |clsName|
       
   109         resourceTypes isNil ifTrue: [resourceTypes := #(instance class)].
       
   110         clsName := self listOfClassesView list at: anIndex.
       
   111         self valueOfClassName value: clsName.
       
   112         self class lastSelection: clsName.
       
   113         (resourceTypes includes: #instance) ifTrue: [
       
   114         self listOfResources contents:
       
   115             (((Smalltalk at: clsName) 
       
   116                 selectors
       
   117                 asOrderedCollection)
       
   118              collect: [:sel| Row new selector: sel; type: 'instance'])].
       
   119         (resourceTypes includes: #class) ifTrue: [
       
   120         self listOfResources addAll:
       
   121             (((Smalltalk at: clsName) 
       
   122                 class selectors
       
   123                 asOrderedCollection)
       
   124              collect: [:sel| Row new selector: sel; type: 'class'])].
       
   125     ]
       
   126 
       
   127 
       
   128 ! !
       
   129 
       
   130 !MethodSelectionBrowser methodsFor:'instance creation'!
       
   131 
       
   132 openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withTypes: aResourceTypes
       
   133 
       
   134     ^super openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
       
   135 
       
   136 
       
   137 
       
   138 ! !
       
   139 
       
   140 !MethodSelectionBrowser methodsFor:'startup / release'!
       
   141 
       
   142 postBuildWith:aBuilder
       
   143 
       
   144     title := 'Method Selection Browser'.
       
   145 
       
   146     ^super postBuildWith:aBuilder
       
   147 
       
   148 ! !
       
   149 
       
   150 !MethodSelectionBrowser::Row methodsFor:'accessing'!
       
   151 
       
   152 selector
       
   153 
       
   154     selector isNil ifTrue: [selector := method who methodSelector].
       
   155     ^selector
       
   156 
       
   157 !
       
   158 
       
   159 selector: aSymbol
       
   160 
       
   161     selector := aSymbol
       
   162 
       
   163 !
       
   164 
       
   165 type
       
   166 
       
   167     ^type
       
   168 
       
   169 
       
   170 !
       
   171 
       
   172 type: aString
       
   173 
       
   174     type := aString
       
   175 
       
   176 
       
   177 ! !
       
   178 
       
   179 !MethodSelectionBrowser class methodsFor:'documentation'!
       
   180 
       
   181 version
       
   182     ^ '$Header$'
       
   183 ! !