MethodSelectionBrowser.st
author tz
Mon, 30 Mar 1998 14:45:46 +0200
changeset 754 04e802a6a920
parent 680 49c81e9cc6f7
child 771 905c3b4ba565
permissions -rw-r--r--
color master selection in red + grid background colored
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
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
    23
	instanceVariableNames:'selector protocol'
646
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
650
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    62
    "
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    63
    MethodSelectionBrowser
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    64
        request: 'Select a Method'
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    65
        onSuperclass: #ApplicationModel 
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    66
        andClass: #ToolApplicationModel 
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    67
        andSelector: #saveIcon 
650
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    68
        withTypes: #(class)      
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    69
    "
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    70
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    71
    ^self new
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    72
        title: aTitle;
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    73
        openOnSuperclass: aSuperclass
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    74
        andClass: aClass
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    75
        andSelector: aSelector
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    76
        withTypes: aResourceTypes
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
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    81
!MethodSelectionBrowser class methodsFor:'list specs'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    82
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    83
columnsOfDataSetView
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    84
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    85
  ^ #(
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    86
   #(#DataSetColumnSpec
650
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    87
      #label: ' Selector'
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    88
      #'labelAlignment:' #left
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    89
      #model: #selector
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    90
      #canSelect: false
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    91
  )
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    92
   (#DataSetColumnSpec
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
    93
      #label: ' Protocol'
650
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
    94
      #'labelAlignment:' #left
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
    95
      #model: #protocol
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
    96
      #canSelect: false
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
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   102
! !
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   103
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   104
!MethodSelectionBrowser methodsFor:'callbacks - user'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   105
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   106
classSelected: anIndex
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   107
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   108
    self selectionOfClass value isNil ifTrue: [^nil].
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   109
    self withWaitCursorDo:
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   110
    [
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   111
        |clsName|
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   112
        resourceTypes isNil ifTrue: [resourceTypes := #(instance class)].
680
49c81e9cc6f7 create class support added
tz
parents: 666
diff changeset
   113
        clsName := ((self listOfClassesView list at: anIndex) upTo: $ ) asSymbol.
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   114
        self valueOfClassName value: clsName.
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   115
        self class lastSelection: clsName.
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   116
        (resourceTypes includes: #instance) ifTrue: [
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   117
        self listOfResources contents:
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   118
            (((Smalltalk at: clsName) 
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   119
                selectors
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   120
                asOrderedCollection)
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   121
             collect: [:sel| Row new selector: sel; protocol: 'instance'])].
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   122
        (resourceTypes includes: #class) ifTrue: [
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   123
        self listOfResources addAll:
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   124
            (((Smalltalk at: clsName) 
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   125
                class selectors
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   126
                asOrderedCollection)
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   127
             collect: [:sel| Row new selector: sel; protocol: 'class'])].
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   128
    ]
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   129
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   130
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   131
! !
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   132
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   133
!MethodSelectionBrowser methodsFor:'instance creation'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   134
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   135
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withTypes: aResourceTypes
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   136
650
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   137
    |message type row|
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   138
    message := super openOnSuperclass: aSuperclassOrSymbol 
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   139
        andClass: aClassOrSymbol 
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   140
        andSelector: aSelector 
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   141
        withResourceTypes: aResourceTypes.
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   142
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   143
    (message notNil and:
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   144
    [((row := self selectionOfResource value) notNil and:
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   145
    [(type := row type) = 'class'])])
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   146
    ifTrue:
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   147
    [   
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   148
        message := message replChar:$  withString: ' class '
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   149
    ].
495b35593c09 the returning message should contain some info about the method protocol type
tz
parents: 646
diff changeset
   150
    ^message
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   151
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   152
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   153
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   154
! !
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   155
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   156
!MethodSelectionBrowser methodsFor:'startup / release'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   157
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   158
postBuildWith:aBuilder
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   159
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   160
    title := 'Method Selection Browser'.
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   161
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   162
    ^super postBuildWith:aBuilder
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   163
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   164
! !
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   165
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   166
!MethodSelectionBrowser::Row methodsFor:'accessing'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   167
665
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   168
protocol
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   169
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   170
    ^protocol
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   171
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   172
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   173
!
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   174
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   175
protocol: aString
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   176
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   177
    protocol := aString
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   178
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   179
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   180
!
be9ead6a517b row label changed
tz
parents: 650
diff changeset
   181
646
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   182
selector
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   183
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   184
    ^selector
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   185
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   186
!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   187
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   188
selector: aSymbol
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   189
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   190
    selector := aSymbol
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   191
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   192
! !
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   193
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   194
!MethodSelectionBrowser class methodsFor:'documentation'!
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   195
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   196
version
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   197
    ^ '$Header$'
d2fc253819c1 initial checkin
tz
parents:
diff changeset
   198
! !