ResourceSelectionBrowser.st
author ca
Mon, 05 Jan 1998 09:33:12 +0100
changeset 393 a824a3a9b834
parent 388 45cf0af38948
permissions -rw-r--r--
raise update notification if list size changed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
385
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     1
SelectionBrowser subclass:#ResourceSelectionBrowser
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     2
	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceSelector
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     3
		resourceTypes'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     4
	classVariableNames:''
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     5
	poolDictionaries:''
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     6
	category:'Interface-Advanced-Tools'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     7
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     8
059ced1c8344 intitial checkin
tz
parents:
diff changeset
     9
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    10
!ResourceSelectionBrowser class methodsFor:'instance creation'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    11
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    12
openOnSuperclass: aSuperclass class: aClass selector: aSelector resourceTypes: aResourceTypes
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    13
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    14
    ^self new openOnSuperclass: aSuperclass class: aClass selector: aSelector resourceTypes: aResourceTypes
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    15
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    16
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    17
!ResourceSelectionBrowser class methodsFor:'interface specs'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    18
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    19
windowSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    20
    "this window spec was automatically generated by the ST/X UIPainter"
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    21
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    22
    "do not manually edit this - the painter/builder may not be able to
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    23
     handle the specification if its corrupted."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    24
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    25
    "
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    26
     UIPainter new openOnClass:ResourceBrowser andSelector:#windowSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    27
     ResourceBrowser new openInterface:#windowSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    28
    "
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    29
    "ResourceBrowser open"
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    30
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    31
    <resource: #canvas>
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    32
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    33
    ^
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    34
     
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    35
       #(#FullSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    36
          #'window:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    37
           #(#WindowSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    38
              #'name:' 'Resource Browser'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    39
              #'layout:' #(#LayoutFrame 541 0 280 0 940 0 579 0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    40
              #'label:' 'Resource Browser'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    41
              #'min:' #(#Point 400 300)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    42
              #'max:' #(#Point 1152 864)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    43
              #'bounds:' #(#Rectangle 541 280 941 580)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    44
              #'usePreferredExtent:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    45
          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    46
          #'component:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    47
           #(#SpecCollection
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    48
              #'collection:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    49
               #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    50
                 #(#VariableHorizontalPanelSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    51
                    #'name:' 'variableHorizontalPanel'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    52
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    53
                    #'component:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    54
                     #(#SpecCollection
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    55
                        #'collection:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    56
                         #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    57
                           #(#ViewSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    58
                              #'name:' 'view1'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    59
                              #'component:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    60
                               #(#SpecCollection
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    61
                                  #'collection:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    62
                                   #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    63
                                     #(#SelectionInTreeViewSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    64
                                        #'name:' 'listOfClassesView'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    65
                                        #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    66
                                        #'model:' #selectionOfClass
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    67
                                        #'hasHorizontalScrollBar:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    68
                                        #'hasVerticalScrollBar:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    69
                                        #'miniScrollerHorizontal:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    70
                                        #'showRoot:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    71
                                        #'valueChangeSelector:' #'classSelected:'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    72
                                        #'hierarchicalList:' #listOfClasses
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    73
                                    )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    74
                                  )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    75
                              )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    76
                              #'level:' -1
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    77
                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    78
                           #(#ViewSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    79
                              #'name:' 'view2'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    80
                              #'component:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    81
                               #(#SpecCollection
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    82
                                  #'collection:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    83
                                   #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    84
                                     #(#DataSetSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    85
                                        #'name:' 'resourcesDataSetView'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    86
                                        #'layout:' #(#LayoutFrame 2 0.0 0 0.0 2 1.0 -22 1.0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    87
                                        #'model:' #selectionOfResource
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    88
                                        #'hasHorizontalScrollBar:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    89
                                        #'hasVerticalScrollBar:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    90
                                        #'miniScrollerHorizontal:' true
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    91
                                        #'dataList:' #listOfResources
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    92
                                        #'useIndex:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    93
                                        #'doubleClickSelector:' #resourceDoubleClicked
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    94
                                        #'valueChangeSelector:' #resourceSelected
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    95
                                        #'verticalSpacing:' 1
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    96
                                        #'columns:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    97
                                         #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    98
                                           #(#DataSetColumnSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
    99
                                              #'width:' 20
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   100
                                              #'model:' #icon
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   101
                                              #'printSelector:' #'iconOn:'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   102
                                              #'canSelect:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   103
                                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   104
                                           #(#DataSetColumnSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   105
                                              #'label:' 'selector'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   106
                                              #'model:' #selector
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   107
                                              #'canSelect:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   108
                                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   109
                                           #(#DataSetColumnSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   110
                                              #'label:' 'resource'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   111
                                              #'model:' #resourceType
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   112
                                              #'canSelect:' false
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   113
                                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   114
                                        )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   115
                                    )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   116
                                     #(#InputFieldSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   117
                                        #'name:' 'selectorInputField'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   118
                                        #'layout:' #(#LayoutFrame 2 0.0 -22 1 2 1.0 0 1)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   119
                                        #'model:' #valueOfSelector
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   120
                                    )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   121
                                  )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   122
                              )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   123
                              #'level:' -1
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   124
                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   125
                        )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   126
                    )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   127
                    #'handles:' #(#Any 0.5 1.0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   128
                )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   129
                 #(#HorizontalPanelViewSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   130
                    #'name:' 'horizontalPanelView'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   131
                    #'layout:' #(#LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   132
                    #'component:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   133
                     #(#SpecCollection
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   134
                        #'collection:' 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   135
                         #(
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   136
                           #(#ActionButtonSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   137
                              #'name:' 'actionButton2'
388
45cf0af38948 checkin from browser
tz
parents: 385
diff changeset
   138
                              #'label:' 'Cancel'
385
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   139
                              #'model:' #cancel
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   140
                              #'extent:' #(#Point 99 22)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   141
                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   142
                           #(#ActionButtonSpec
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   143
                              #'name:' 'actionButton1'
388
45cf0af38948 checkin from browser
tz
parents: 385
diff changeset
   144
                              #'label:' 'OK'
385
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   145
                              #'model:' #accept
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   146
                              #'extent:' #(#Point 99 22)
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   147
                          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   148
                        )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   149
                    )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   150
                    #'level:' 1
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   151
                    #'horizontalLayout:' #center
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   152
                    #'verticalLayout:' #center
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   153
                    #'horizontalSpace:' 3
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   154
                    #'verticalSpace:' 3
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   155
                )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   156
              )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   157
          )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   158
      )
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   159
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   160
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   161
!ResourceSelectionBrowser methodsFor:'actions'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   162
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   163
classSelected
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   164
    |a|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   165
    self selectionOfClass value isNil ifTrue: [^nil].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   166
    self listOfResources contents:
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   167
    (a := (Smalltalk at: self selectionOfClass value name ) class methodDictionary
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   168
asOrderedCollection select: [:m| m resources notNil]).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   169
     
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   170
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   171
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   172
classSelected: anIndex
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   173
    
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   174
    self selectionOfClass value isNil ifTrue: [^nil].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   175
    self withWaitCursorDo:
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   176
    [
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   177
        |clsName|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   178
        clsName := ((builder componentAt: #listOfClassesView) list at: anIndex).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   179
        self class lastSelection: clsName.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   180
        self listOfResources contents:
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   181
        ((Smalltalk at: clsName) 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   182
        class methodDictionary
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   183
        asOrderedCollection select: 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   184
        [:m| m resources notNil and: [resourceTypes includes: m resourceType]]).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   185
    ]
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   186
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   187
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   188
closeCancel
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   189
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   190
    resourceMethod := nil.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   191
    super closeCancel
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   192
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   193
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   194
resourceDoubleClicked
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   195
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   196
    resourceMethod := self selectionOfResource value.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   197
    accept value: true.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   198
    self close
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   199
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   200
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   201
resourceSelected
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   202
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   203
    resourceMethod := self selectionOfResource value.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   204
    self valueOfSelector value: self selectionOfResource value selector
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   205
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   206
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   207
!ResourceSelectionBrowser methodsFor:'aspects'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   208
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   209
listOfClasses
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   210
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   211
    |holder|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   212
    (holder := builder bindingAt:#listOfClasses) isNil ifTrue:[
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   213
        builder aspectAt:#listOfClasses put:(holder := TreeItem newAsTreeFromSmalltalkClass: 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   214
        (Smalltalk at: resourceSuperclass)).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   215
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   216
    ^ holder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   217
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   218
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   219
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   220
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   221
listOfResources
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   222
    "automatically generated by UIPainter ..."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   223
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   224
    "*** the code below creates a default model when invoked."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   225
    "*** (which may not be the one you wanted)"
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   226
    "*** Please change as required and accept in the browser."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   227
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   228
    |holder|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   229
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   230
    (holder := builder bindingAt:#listOfResources) isNil ifTrue:[
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   231
        builder aspectAt:#listOfResources put:(holder :=  List new).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   232
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   233
    ^ holder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   234
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   235
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   236
selectionOfClass
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   237
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   238
    |holder|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   239
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   240
    (holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   241
        builder aspectAt:#selectionOfClass put:(holder :=  ValueHolder new).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   242
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   243
    ^ holder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   244
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   245
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   246
selectionOfResource
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   247
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   248
    |holder|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   249
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   250
    (holder := builder bindingAt:#selectionOfResource) isNil ifTrue:[
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   251
        builder aspectAt:#selectionOfResource put:(holder :=  ValueHolder new).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   252
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   253
    ^ holder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   254
!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   255
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   256
valueOfSelector
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   257
    "automatically generated by UIPainter ..."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   258
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   259
    "*** the code below creates a default model when invoked."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   260
    "*** (which may not be the one you wanted)"
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   261
    "*** Please change as required and accept in the browser."
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   262
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   263
    |holder|
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   264
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   265
    (holder := builder bindingAt:#valueOfSelector) isNil ifTrue:[
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   266
        builder aspectAt:#valueOfSelector put:(holder :=  ValueHolder new).
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   267
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   268
    ^ holder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   269
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   270
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   271
!ResourceSelectionBrowser methodsFor:'initialization'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   272
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   273
postBuildWith:aBuilder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   274
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   275
    resourceClass notNil ifTrue:
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   276
    [(builder componentAt: #listOfClassesView) selectFromListOfNames: 
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   277
        (((Smalltalk at: self class lastSelection ? resourceClass ifAbsent: [Object])) withAllSuperclasses reverse collect: [:cls| cls name asString])].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   278
    ^super postBuildWith:aBuilder
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   279
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   280
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   281
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   282
!ResourceSelectionBrowser methodsFor:'instance creation'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   283
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   284
openOnSuperclass: aSuperclass class: aClass selector: aSelector resourceTypes: aResourceTypes
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   285
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   286
    resourceTypes := aResourceTypes.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   287
    resourceSuperclass := aSuperclass.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   288
    resourceClass := aClass.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   289
    resourceSelector := aSelector.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   290
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   291
    self open.
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   292
    accept value
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   293
    ifTrue:
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   294
    [
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   295
        ^self selectionOfClass value name, ' ', self valueOfSelector value
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   296
    ].
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   297
    ^nil
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   298
! !
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   299
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   300
!ResourceSelectionBrowser class methodsFor:'documentation'!
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   301
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   302
version
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   303
    ^ '$Header$'
059ced1c8344 intitial checkin
tz
parents:
diff changeset
   304
! !