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