ResourceSelectionBrowser.st
author tz
Sat, 14 Feb 1998 18:04:11 +0100
changeset 632 930b778d5e28
parent 623 c8a99cea56f7
child 635 47ffd4e4f387
permissions -rw-r--r--
uses now dynamic tree items
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
425
cf47d420764a initial checkin
tz
parents:
diff changeset
     1
"
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
425
cf47d420764a initial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
cf47d420764a initial checkin
tz
parents:
diff changeset
     4
cf47d420764a initial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
cf47d420764a initial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
cf47d420764a initial checkin
tz
parents:
diff changeset
     7
 inclusion of the above copyright notice. This software may not
cf47d420764a initial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
cf47d420764a initial checkin
tz
parents:
diff changeset
     9
 other person. No title to or ownership of the software is
cf47d420764a initial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
cf47d420764a initial checkin
tz
parents:
diff changeset
    11
"
cf47d420764a initial checkin
tz
parents:
diff changeset
    12
cf47d420764a initial checkin
tz
parents:
diff changeset
    13
cf47d420764a initial checkin
tz
parents:
diff changeset
    14
SelectionBrowser subclass:#ResourceSelectionBrowser
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
    15
	instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
    16
		allClasses'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    17
	classVariableNames:''
cf47d420764a initial checkin
tz
parents:
diff changeset
    18
	poolDictionaries:''
619
36c9d07f7dc3 class category changed
tz
parents: 616
diff changeset
    19
	category:'Interface-Dialogs'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    20
!
cf47d420764a initial checkin
tz
parents:
diff changeset
    21
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    22
Object subclass:#Row
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    23
	instanceVariableNames:'method icon resourceType selector'
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    24
	classVariableNames:''
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    25
	poolDictionaries:''
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    26
	privateIn:ResourceSelectionBrowser
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    27
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    28
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    29
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    30
cf47d420764a initial checkin
tz
parents:
diff changeset
    31
copyright
cf47d420764a initial checkin
tz
parents:
diff changeset
    32
"
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    33
 COPYRIGHT (c) 1997 by eXept Software AG
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    34
              All Rights Reserved
cf47d420764a initial checkin
tz
parents:
diff changeset
    35
cf47d420764a initial checkin
tz
parents:
diff changeset
    36
 This software is furnished under a license and may be used
cf47d420764a initial checkin
tz
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
cf47d420764a initial checkin
tz
parents:
diff changeset
    38
 inclusion of the above copyright notice. This software may not
cf47d420764a initial checkin
tz
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
cf47d420764a initial checkin
tz
parents:
diff changeset
    40
 other person. No title to or ownership of the software is
cf47d420764a initial checkin
tz
parents:
diff changeset
    41
 hereby transferred.
cf47d420764a initial checkin
tz
parents:
diff changeset
    42
"
cf47d420764a initial checkin
tz
parents:
diff changeset
    43
cf47d420764a initial checkin
tz
parents:
diff changeset
    44
!
cf47d420764a initial checkin
tz
parents:
diff changeset
    45
cf47d420764a initial checkin
tz
parents:
diff changeset
    46
documentation
cf47d420764a initial checkin
tz
parents:
diff changeset
    47
"
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    48
    [start with:]
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    49
        ResourceSelectionBrowser open
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    50
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    51
    [author:]
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    52
        Thomas Zwick
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    53
"
cf47d420764a initial checkin
tz
parents:
diff changeset
    54
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    55
cf47d420764a initial checkin
tz
parents:
diff changeset
    56
!ResourceSelectionBrowser class methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    57
cf47d420764a initial checkin
tz
parents:
diff changeset
    58
request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withResourceTypes: aResourceTypes
cf47d420764a initial checkin
tz
parents:
diff changeset
    59
cf47d420764a initial checkin
tz
parents:
diff changeset
    60
    "self
cf47d420764a initial checkin
tz
parents:
diff changeset
    61
        request: 'Select A Resource Selector'
cf47d420764a initial checkin
tz
parents:
diff changeset
    62
        onSuperclass: #ApplicationModel 
cf47d420764a initial checkin
tz
parents:
diff changeset
    63
        andClass: #ToolApplicationModel 
cf47d420764a initial checkin
tz
parents:
diff changeset
    64
        andSelector: #saveIcon 
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
    65
        withResourceTypes: #(image) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    66
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
    67
cf47d420764a initial checkin
tz
parents:
diff changeset
    68
    ^self new
cf47d420764a initial checkin
tz
parents:
diff changeset
    69
        title: aTitle;
cf47d420764a initial checkin
tz
parents:
diff changeset
    70
        openOnSuperclass: aSuperclass
cf47d420764a initial checkin
tz
parents:
diff changeset
    71
        andClass: aClass
cf47d420764a initial checkin
tz
parents:
diff changeset
    72
        andSelector: aSelector
cf47d420764a initial checkin
tz
parents:
diff changeset
    73
        withResourceTypes: aResourceTypes
cf47d420764a initial checkin
tz
parents:
diff changeset
    74
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    75
cf47d420764a initial checkin
tz
parents:
diff changeset
    76
!ResourceSelectionBrowser class methodsFor:'interface specs'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    77
cf47d420764a initial checkin
tz
parents:
diff changeset
    78
windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
    79
    "this window spec was automatically generated by the ST/X UIPainter"
cf47d420764a initial checkin
tz
parents:
diff changeset
    80
cf47d420764a initial checkin
tz
parents:
diff changeset
    81
    "do not manually edit this - the painter/builder may not be able to
cf47d420764a initial checkin
tz
parents:
diff changeset
    82
     handle the specification if its corrupted."
cf47d420764a initial checkin
tz
parents:
diff changeset
    83
cf47d420764a initial checkin
tz
parents:
diff changeset
    84
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
    85
     UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
    86
     ResourceSelectionBrowser new openInterface:#windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
    87
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
    88
    "ResourceSelectionBrowser open"
cf47d420764a initial checkin
tz
parents:
diff changeset
    89
cf47d420764a initial checkin
tz
parents:
diff changeset
    90
    <resource: #canvas>
cf47d420764a initial checkin
tz
parents:
diff changeset
    91
cf47d420764a initial checkin
tz
parents:
diff changeset
    92
    ^
468
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
    93
     
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    94
       #(#FullSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
    95
          #'window:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
    96
           #(#WindowSpec
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
    97
              #'name:' 'Resource Selection Browser'
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
    98
              #'layout:' #(#LayoutFrame 69 0 395 0 668 0 744 0)
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
    99
              #'label:' 'Resource Selection Browser'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   100
              #'min:' #(#Point 400 300)
cf47d420764a initial checkin
tz
parents:
diff changeset
   101
              #'max:' #(#Point 1152 864)
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   102
              #'bounds:' #(#Rectangle 69 395 669 745)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   103
              #'usePreferredExtent:' false
cf47d420764a initial checkin
tz
parents:
diff changeset
   104
          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   105
          #'component:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   106
           #(#SpecCollection
cf47d420764a initial checkin
tz
parents:
diff changeset
   107
              #'collection:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   108
               #(
cf47d420764a initial checkin
tz
parents:
diff changeset
   109
                 #(#VariableHorizontalPanelSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   110
                    #'name:' 'variableHorizontalPanel'
cf47d420764a initial checkin
tz
parents:
diff changeset
   111
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0)
cf47d420764a initial checkin
tz
parents:
diff changeset
   112
                    #'component:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   113
                     #(#SpecCollection
cf47d420764a initial checkin
tz
parents:
diff changeset
   114
                        #'collection:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   115
                         #(
cf47d420764a initial checkin
tz
parents:
diff changeset
   116
                           #(#ViewSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   117
                              #'name:' 'view1'
cf47d420764a initial checkin
tz
parents:
diff changeset
   118
                              #'component:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   119
                               #(#SpecCollection
cf47d420764a initial checkin
tz
parents:
diff changeset
   120
                                  #'collection:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   121
                                   #(
cf47d420764a initial checkin
tz
parents:
diff changeset
   122
                                     #(#SelectionInTreeViewSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   123
                                        #'name:' 'listOfClassesView'
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   124
                                        #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -22 1.0)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   125
                                        #'model:' #selectionOfClass
cf47d420764a initial checkin
tz
parents:
diff changeset
   126
                                        #'hasHorizontalScrollBar:' true
cf47d420764a initial checkin
tz
parents:
diff changeset
   127
                                        #'hasVerticalScrollBar:' true
cf47d420764a initial checkin
tz
parents:
diff changeset
   128
                                        #'miniScrollerHorizontal:' true
468
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
   129
                                        #'showDirectoryIndicatorForRoot:' false
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
   130
                                        #'showDirectoryIndicator:' true
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   131
                                        #'valueChangeSelector:' #'classSelected:'
cf47d420764a initial checkin
tz
parents:
diff changeset
   132
                                        #'hierarchicalList:' #listOfClasses
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   133
                                        #'contentsSelector:' #treeViewContents
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   134
                                        #'labelSelector:' #treeViewLabel
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   135
                                        #'childrenSelector:' #treeViewChildren
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   136
                                        #'iconSelector:' #treeViewIcon
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   137
                                    )
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   138
                                     #(#InputFieldSpec
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   139
                                        #'name:' 'classNameInputField'
608
8610ea5b501d geometry
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   140
                                        #'layout:' #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1)
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   141
                                        #'model:' #valueOfClassName
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   142
                                    )
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   143
                                  )
cf47d420764a initial checkin
tz
parents:
diff changeset
   144
                              )
cf47d420764a initial checkin
tz
parents:
diff changeset
   145
                          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   146
                           #(#ViewSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   147
                              #'name:' 'view2'
cf47d420764a initial checkin
tz
parents:
diff changeset
   148
                              #'component:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   149
                               #(#SpecCollection
cf47d420764a initial checkin
tz
parents:
diff changeset
   150
                                  #'collection:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   151
                                   #(
cf47d420764a initial checkin
tz
parents:
diff changeset
   152
                                     #(#DataSetSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   153
                                        #'name:' 'resourcesDataSetView'
608
8610ea5b501d geometry
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   154
                                        #'layout:' #(#LayoutFrame 2 0.0 0 0.0 -2 1.0 -22 1.0)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   155
                                        #'model:' #selectionOfResource
cf47d420764a initial checkin
tz
parents:
diff changeset
   156
                                        #'hasHorizontalScrollBar:' true
cf47d420764a initial checkin
tz
parents:
diff changeset
   157
                                        #'hasVerticalScrollBar:' true
cf47d420764a initial checkin
tz
parents:
diff changeset
   158
                                        #'miniScrollerHorizontal:' true
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   159
                                        #'rowClassName:' 'ResourceSelectionBrowser::Row'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   160
                                        #'dataList:' #listOfResources
cf47d420764a initial checkin
tz
parents:
diff changeset
   161
                                        #'useIndex:' false
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   162
                                        #'has3Dsepartors:' true
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   163
                                        #'doubleClickSelector:' #resourceDoubleClicked
cf47d420764a initial checkin
tz
parents:
diff changeset
   164
                                        #'valueChangeSelector:' #resourceSelected
cf47d420764a initial checkin
tz
parents:
diff changeset
   165
                                        #'verticalSpacing:' 1
cf47d420764a initial checkin
tz
parents:
diff changeset
   166
                                        #'columns:' 
cf47d420764a initial checkin
tz
parents:
diff changeset
   167
                                         #(
cf47d420764a initial checkin
tz
parents:
diff changeset
   168
                                           #(#DataSetColumnSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   169
                                              #'width:' 20
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   170
                                              #'height:' 20
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   171
                                              #'printSelector:' #'iconOn:'
cf47d420764a initial checkin
tz
parents:
diff changeset
   172
                                              #'canSelect:' false
cf47d420764a initial checkin
tz
parents:
diff changeset
   173
                                          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   174
                                           #(#DataSetColumnSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   175
                                              #'label:' 'Selector'
cf47d420764a initial checkin
tz
parents:
diff changeset
   176
                                              #'model:' #selector
cf47d420764a initial checkin
tz
parents:
diff changeset
   177
                                              #'canSelect:' false
cf47d420764a initial checkin
tz
parents:
diff changeset
   178
                                          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   179
                                           #(#DataSetColumnSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   180
                                              #'label:' 'Resource'
cf47d420764a initial checkin
tz
parents:
diff changeset
   181
                                              #'model:' #resourceType
cf47d420764a initial checkin
tz
parents:
diff changeset
   182
                                              #'canSelect:' false
cf47d420764a initial checkin
tz
parents:
diff changeset
   183
                                          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   184
                                        )
cf47d420764a initial checkin
tz
parents:
diff changeset
   185
                                    )
cf47d420764a initial checkin
tz
parents:
diff changeset
   186
                                     #(#InputFieldSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   187
                                        #'name:' 'selectorInputField'
608
8610ea5b501d geometry
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   188
                                        #'layout:' #(#LayoutFrame 2 0.0 -22 1 -2 1.0 0 1)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   189
                                        #'model:' #valueOfSelector
cf47d420764a initial checkin
tz
parents:
diff changeset
   190
                                    )
cf47d420764a initial checkin
tz
parents:
diff changeset
   191
                                  )
cf47d420764a initial checkin
tz
parents:
diff changeset
   192
                              )
cf47d420764a initial checkin
tz
parents:
diff changeset
   193
                          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   194
                        )
cf47d420764a initial checkin
tz
parents:
diff changeset
   195
                    )
cf47d420764a initial checkin
tz
parents:
diff changeset
   196
                    #'handles:' #(#Any 0.5 1.0)
cf47d420764a initial checkin
tz
parents:
diff changeset
   197
                )
436
07be1c96bb58 *** empty log message ***
tz
parents: 435
diff changeset
   198
                 #(#UISubSpecification
07be1c96bb58 *** empty log message ***
tz
parents: 435
diff changeset
   199
                    #'name:' 'SubSpecification'
07be1c96bb58 *** empty log message ***
tz
parents: 435
diff changeset
   200
                    #'layout:' #(#LayoutFrame 2 0.0 -32 1 -2 1.0 -8 1.0)
07be1c96bb58 *** empty log message ***
tz
parents: 435
diff changeset
   201
                    #'majorKey:' #ToolApplicationModel
07be1c96bb58 *** empty log message ***
tz
parents: 435
diff changeset
   202
                    #'minorKey:' #windowSpecForCommitWithoutChannels
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   203
                )
cf47d420764a initial checkin
tz
parents:
diff changeset
   204
              )
cf47d420764a initial checkin
tz
parents:
diff changeset
   205
          )
cf47d420764a initial checkin
tz
parents:
diff changeset
   206
      )
cf47d420764a initial checkin
tz
parents:
diff changeset
   207
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   208
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   209
!ResourceSelectionBrowser class methodsFor:'resources'!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   210
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   211
iconClass
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   212
    "Generated by the Image Editor"
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   213
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   214
    ImageEditor openOnClass:self andSelector:#iconClass
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   215
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   216
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   217
    <resource: #image>
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   218
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   219
    ^Icon
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   220
        constantNamed:#'ResourceSelectionBrowser iconClass'
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   221
        ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 21 85 85 85 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 12 26 170 170 170 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 0 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   222
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   223
iconHidingSubclasses
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   224
    "Generated by the Image Editor"
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   225
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   226
    ImageEditor openOnClass:self andSelector:#iconHidingSubclasses
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   227
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   228
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   229
    <resource: #image>
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   230
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   231
    ^Icon
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   232
        constantNamed:#'ResourceSelectionBrowser iconHidingSubclasses'
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   233
        ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   234
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   235
iconShowingSubclasses
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   236
    "Generated by the Image Editor"
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   237
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   238
    ImageEditor openOnClass:self andSelector:#iconShowingSubclasses
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   239
    "
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   240
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   241
    <resource: #image>
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   242
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   243
    ^Icon
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   244
        constantNamed:#'ResourceSelectionBrowser iconShowingSubclasses'
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   245
        ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 5 85 85 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 8 136 136 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   246
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   247
!ResourceSelectionBrowser methodsFor:'accessing - views'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   248
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   249
classNameInputField
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   250
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   251
    ^builder componentAt: #classNameInputField
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   252
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   253
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   254
listOfClassesView
cf47d420764a initial checkin
tz
parents:
diff changeset
   255
cf47d420764a initial checkin
tz
parents:
diff changeset
   256
    ^builder componentAt: #listOfClassesView
cf47d420764a initial checkin
tz
parents:
diff changeset
   257
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   258
cf47d420764a initial checkin
tz
parents:
diff changeset
   259
!ResourceSelectionBrowser methodsFor:'aspects'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   260
cf47d420764a initial checkin
tz
parents:
diff changeset
   261
listOfClasses
cf47d420764a initial checkin
tz
parents:
diff changeset
   262
cf47d420764a initial checkin
tz
parents:
diff changeset
   263
    |holder|
cf47d420764a initial checkin
tz
parents:
diff changeset
   264
    (holder := builder bindingAt:#listOfClasses) isNil ifTrue:[
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   265
        builder aspectAt:#listOfClasses put: (holder := TreeItem new)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   266
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   267
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   268
cf47d420764a initial checkin
tz
parents:
diff changeset
   269
cf47d420764a initial checkin
tz
parents:
diff changeset
   270
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   271
cf47d420764a initial checkin
tz
parents:
diff changeset
   272
listOfResources
cf47d420764a initial checkin
tz
parents:
diff changeset
   273
cf47d420764a initial checkin
tz
parents:
diff changeset
   274
    |holder|
cf47d420764a initial checkin
tz
parents:
diff changeset
   275
    (holder := builder bindingAt:#listOfResources) isNil ifTrue:[
cf47d420764a initial checkin
tz
parents:
diff changeset
   276
        builder aspectAt:#listOfResources put:(holder :=  List new).
cf47d420764a initial checkin
tz
parents:
diff changeset
   277
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   278
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   279
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   280
cf47d420764a initial checkin
tz
parents:
diff changeset
   281
selectionOfClass
cf47d420764a initial checkin
tz
parents:
diff changeset
   282
cf47d420764a initial checkin
tz
parents:
diff changeset
   283
    |holder|
cf47d420764a initial checkin
tz
parents:
diff changeset
   284
    (holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[
cf47d420764a initial checkin
tz
parents:
diff changeset
   285
        builder aspectAt:#selectionOfClass put:(holder :=  ValueHolder new).
cf47d420764a initial checkin
tz
parents:
diff changeset
   286
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   287
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   288
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   289
cf47d420764a initial checkin
tz
parents:
diff changeset
   290
selectionOfResource
cf47d420764a initial checkin
tz
parents:
diff changeset
   291
cf47d420764a initial checkin
tz
parents:
diff changeset
   292
    |holder|
cf47d420764a initial checkin
tz
parents:
diff changeset
   293
    (holder := builder bindingAt:#selectionOfResource) isNil ifTrue:[
cf47d420764a initial checkin
tz
parents:
diff changeset
   294
        builder aspectAt:#selectionOfResource put:(holder :=  '' asValue).
cf47d420764a initial checkin
tz
parents:
diff changeset
   295
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   296
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   297
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   298
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   299
valueOfClassName
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   300
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   301
    |holder|
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   302
    (holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   303
        builder aspectAt:#valueOfClassName put:(holder :=  '' asValue).
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   304
    ].
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   305
    ^ holder
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   306
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   307
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   308
valueOfSelector
cf47d420764a initial checkin
tz
parents:
diff changeset
   309
cf47d420764a initial checkin
tz
parents:
diff changeset
   310
    |holder|
cf47d420764a initial checkin
tz
parents:
diff changeset
   311
    (holder := builder bindingAt:#valueOfSelector) isNil ifTrue:[
cf47d420764a initial checkin
tz
parents:
diff changeset
   312
        builder aspectAt:#valueOfSelector put:(holder :=  '' asValue).
cf47d420764a initial checkin
tz
parents:
diff changeset
   313
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   314
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   315
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   316
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   317
!ResourceSelectionBrowser methodsFor:'callbacks - tree view'!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   318
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   319
treeViewChildren
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   320
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   321
    ^[:aTreeItem| aTreeItem contents subclasses asSortedCollection: [:i1 :i2| i1 name < i2 name]]
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   322
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   323
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   324
!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   325
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   326
treeViewContents
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   327
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   328
    ^Smalltalk at: resourceSuperclass ? #Object
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   329
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   330
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   331
!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   332
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   333
treeViewIcon
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   334
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   335
    ^[:aTreeItem|  
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   336
        aTreeItem contents subclasses notEmpty 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   337
        ifTrue: 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   338
        [
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   339
            aTreeItem hide 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   340
                ifTrue:  [self class iconHidingSubclasses] 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   341
                ifFalse: [self class iconShowingSubclasses]] 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   342
        ifFalse: 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   343
        [
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   344
            self class iconClass
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   345
        ]
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   346
     ]
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   347
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   348
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   349
!
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   350
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   351
treeViewLabel
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   352
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   353
    ^[:aTreeItem|aTreeItem contents name]
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   354
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   355
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   356
! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   357
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   358
!ResourceSelectionBrowser methodsFor:'callbacks - user'!
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   359
cf47d420764a initial checkin
tz
parents:
diff changeset
   360
classSelected: anIndex
cf47d420764a initial checkin
tz
parents:
diff changeset
   361
    
cf47d420764a initial checkin
tz
parents:
diff changeset
   362
    self selectionOfClass value isNil ifTrue: [^nil].
cf47d420764a initial checkin
tz
parents:
diff changeset
   363
    self withWaitCursorDo:
cf47d420764a initial checkin
tz
parents:
diff changeset
   364
    [
cf47d420764a initial checkin
tz
parents:
diff changeset
   365
        |clsName|
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   366
        resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   367
        clsName := self listOfClassesView list at: anIndex.
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   368
        self valueOfClassName value: clsName.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   369
        self class lastSelection: clsName.
cf47d420764a initial checkin
tz
parents:
diff changeset
   370
        self listOfResources contents:
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   371
            ((((Smalltalk at: clsName) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   372
                class methodDictionary
cf47d420764a initial checkin
tz
parents:
diff changeset
   373
                asOrderedCollection select: 
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   374
                    [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   375
             collect: [:m| Row new method: m]).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   376
    ]
cf47d420764a initial checkin
tz
parents:
diff changeset
   377
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   378
cf47d420764a initial checkin
tz
parents:
diff changeset
   379
resourceDoubleClicked
cf47d420764a initial checkin
tz
parents:
diff changeset
   380
cf47d420764a initial checkin
tz
parents:
diff changeset
   381
    resourceMethod := self selectionOfResource value.
cf47d420764a initial checkin
tz
parents:
diff changeset
   382
    accept value: true.
cf47d420764a initial checkin
tz
parents:
diff changeset
   383
    self close
cf47d420764a initial checkin
tz
parents:
diff changeset
   384
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   385
cf47d420764a initial checkin
tz
parents:
diff changeset
   386
resourceSelected
cf47d420764a initial checkin
tz
parents:
diff changeset
   387
cf47d420764a initial checkin
tz
parents:
diff changeset
   388
    resourceMethod := self selectionOfResource value.
cf47d420764a initial checkin
tz
parents:
diff changeset
   389
    self valueOfSelector value: self selectionOfResource value selector
cf47d420764a initial checkin
tz
parents:
diff changeset
   390
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   391
cf47d420764a initial checkin
tz
parents:
diff changeset
   392
!ResourceSelectionBrowser methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   393
cf47d420764a initial checkin
tz
parents:
diff changeset
   394
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
cf47d420764a initial checkin
tz
parents:
diff changeset
   395
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   396
    |cls|
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   397
    resourceMethod := aSelector.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   398
    resourceTypes := aResourceTypes.
cf47d420764a initial checkin
tz
parents:
diff changeset
   399
    resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol].
cf47d420764a initial checkin
tz
parents:
diff changeset
   400
    resourceClass := aClassOrSymbol isClass ifTrue: [aClassOrSymbol name] ifFalse: [aClassOrSymbol].
481
e2e1ea013229 Take care of nil selectors in #openOnSuperClass:andClass:andSelector:
Stefan Vogel <sv@exept.de>
parents: 477
diff changeset
   401
    self valueOfSelector value:(aSelector ? '').
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   402
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   403
    self open.
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   404
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   405
    (self selectionOfClass value notNil and:
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   406
    [(cls := Smalltalk at: self selectionOfClass value name) isClass and:
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   407
    [accept value]]) 
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   408
    ifTrue:
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   409
    [
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   410
        ^cls name, ' ', self valueOfSelector value
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   411
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   412
    ^nil
cf47d420764a initial checkin
tz
parents:
diff changeset
   413
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   414
cf47d420764a initial checkin
tz
parents:
diff changeset
   415
!ResourceSelectionBrowser methodsFor:'startup / release'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   416
cf47d420764a initial checkin
tz
parents:
diff changeset
   417
closeCancel
cf47d420764a initial checkin
tz
parents:
diff changeset
   418
cf47d420764a initial checkin
tz
parents:
diff changeset
   419
    resourceMethod := nil.
cf47d420764a initial checkin
tz
parents:
diff changeset
   420
    super closeCancel
cf47d420764a initial checkin
tz
parents:
diff changeset
   421
cf47d420764a initial checkin
tz
parents:
diff changeset
   422
cf47d420764a initial checkin
tz
parents:
diff changeset
   423
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   424
!
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   425
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   426
postBuildWith:aBuilder
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   427
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   428
    |classSelection classSelectionBlock|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   429
    allClasses := Object withAllSubclasses.
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   430
    classSelection :=  resourceClass ? self class lastSelection ? #Object.
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   431
    classSelectionBlock := 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   432
    [:clsPattern|                                  
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   433
        |foundClass classes|         
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   434
        ((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   435
        [foundClass name ~= clsPattern])
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   436
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   437
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   438
            classes := allClasses select: [:cls| cls name size >= clsPattern size].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   439
            1 to: clsPattern size do: 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   440
            [:i|    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   441
                 classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   442
            ].    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   443
            foundClass := classes at: 1 ifAbsent: [nil] 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   444
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   445
        foundClass notNil
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   446
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   447
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   448
            self listOfClassesView 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   449
                selectFromListOfNames: (foundClass 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   450
                    withAllSuperclasses reverse collect: [:cls| cls name asString]);
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   451
                selectedNodeExpand: true
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   452
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   453
        self valueOfClassName value: clsPattern
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   454
    ].
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   455
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   456
    self valueOfClassName value: classSelection.
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   457
    self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil).
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   458
    self classNameInputField entryCompletionBlock:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   459
    [:value|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   460
        |what|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   461
        what := Smalltalk classnameCompletion: value withoutSpaces.
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   462
        self classNameInputField contents:what first.
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   463
        (what at:2) size ~~ 1 ifTrue:[Display beep].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   464
        classSelectionBlock value: self classNameInputField contents
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   465
    ].
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   466
    self listOfClassesView validateDoubleClickBlock: [:aTreeItem | aTreeItem contents ~~ self treeViewContents].
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   467
    self listOfClassesView selectedNodeExpand: true.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   468
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   469
    [classSelectionBlock value: classSelection] forkAt: 4.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   470
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   471
    ^super postBuildWith:aBuilder
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   472
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   473
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   474
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   475
!ResourceSelectionBrowser::Row methodsFor:'accessing'!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   476
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   477
iconOn:aGC
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   478
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   479
    icon isNil ifTrue: [icon := method iconOn: aGC].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   480
    ^icon
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   481
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   482
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   483
method: aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   484
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   485
    method := aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   486
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   487
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   488
resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   489
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   490
    resourceType isNil ifTrue: [resourceType := method resourceType].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   491
    ^resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   492
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   493
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   494
selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   495
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   496
    selector isNil ifTrue: [selector := method who methodSelector].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   497
    ^selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   498
! !
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   499
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   500
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   501
cf47d420764a initial checkin
tz
parents:
diff changeset
   502
version
cf47d420764a initial checkin
tz
parents:
diff changeset
   503
    ^ '$Header$'
cf47d420764a initial checkin
tz
parents:
diff changeset
   504
! !