ResourceSelectionBrowser.st
author Claus Gittinger <cg@exept.de>
Mon, 27 Jul 1998 18:20:47 +0200
changeset 918 1172ecb3fd63
parent 910 7510ea8c9aeb
child 1034 3cb196044804
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
425
cf47d420764a initial checkin
tz
parents:
diff changeset
     1
"
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
     2
 COPYRIGHT (c) 1997-1998 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
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    16
		allClasses classSelectionBlock'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    17
	classVariableNames:'ClassPresentation'
425
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
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    22
Object subclass:#ResourceMethod
523
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
"
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    33
 COPYRIGHT (c) 1997-1998 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
"
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
    48
    The ResourceSelectionBrowser allows you to browse in class hierarchies
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    49
    and to select resource methods for loading or to saving resource 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    50
    specifications (#canvas, #menu, etc.).
905c3b4ba565 revised
tz
parents: 769
diff changeset
    51
905c3b4ba565 revised
tz
parents: 769
diff changeset
    52
    [instance variables:]
907
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    53
        resourceMethod          <Symbol>        selector of the resource spec
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    54
        resourceClass           <Symbol>        class of the resource spec
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    55
        resourceSuperclass      <Symbol>        root class of the tree list
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    56
        resourceTypes           <Array>         allowed resource types
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    57
        allClasses              <Array>         list of the subclasses of resourceSuperclass
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    58
        classSelectionBlock     <Block>         by evaluating this block the class selection is done
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
    59
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    60
    [start with:]
907
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    61
        ResourceSelectionBrowser open
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    62
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    63
    [author:]
907
393a5860fc7d class presentation in categories added (2)
tz
parents: 906
diff changeset
    64
        Thomas Zwick, eXept Software AG
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    65
"
cf47d420764a initial checkin
tz
parents:
diff changeset
    66
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    67
cf47d420764a initial checkin
tz
parents:
diff changeset
    68
!ResourceSelectionBrowser class methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    69
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    70
request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withResourceTypes: resourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    71
    "opens a ResourceSelectionBrowser 
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    72
        with aTitle
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    73
        on aSuperclassOrSymbol, 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    74
        and aClassOrSymbol, 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    75
        and aSelector,
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    76
        with allowed aResourceTypes"
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    77
    "
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    78
    ResourceSelectionBrowser
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    79
        request: 'Select a Resource Selector'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    80
        onSuperclass: #ApplicationModel 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    81
        andClass: #MenuEditor 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    82
        andSelector: #menuItemImage 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    83
        withResourceTypes: #(image) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    84
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
    85
cf47d420764a initial checkin
tz
parents:
diff changeset
    86
    ^self new
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    87
        title: aTitle;
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    88
        openOnSuperclass: aSuperclass
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    89
        andClass: aClass
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    90
        andSelector: aSelector
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    91
        withResourceTypes: resourceTypes
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    92
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    93
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    94
!ResourceSelectionBrowser class methodsFor:'callbacks - default'!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    95
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
    96
treeViewClassHierarchyChildren
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    97
    "returns the children for the contents (class) of aTreeItem as a block"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    98
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
    99
    ^[:aTreeItem|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   100
        |classes|    
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   101
        classes := OrderedCollection new. 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   102
        classes addAll: ((aTreeItem contents subclasses reject: [:cls| cls isPrivate]) asSortedCollection: [:cls1 :cls2| cls1 name < cls2 name]).
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   103
        classes addAll: (aTreeItem contents privateClasses asSortedCollection: [:cls1 :cls2| cls1 name < cls2 name]).
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   104
        classes
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   105
     ]
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   106
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   107
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   108
treeViewClassHierarchyContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   109
    "returns the default contents of the root of the class tree list"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   110
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   111
    ^ Object
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   112
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   113
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   114
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   115
treeViewClassHierarchyIcon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   116
    "returns the icon for aTreeItem as a block"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   117
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   118
    ^[:aTreeItem|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   119
        |icon|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   120
        aTreeItem contents isClass
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   121
        ifTrue:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   122
        [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   123
            icon := self iconClass.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   124
            aTreeItem contents isPrivate 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   125
            ifTrue:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   126
            [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   127
               icon := self iconPrivateClass
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   128
            ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   129
            icon
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   130
        ]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   131
        ifFalse:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   132
        [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   133
            self iconCategory
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   134
        ]
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   135
    ]
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   136
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   137
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   138
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   139
treeViewClassHierarchyLabel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   140
    "returns the label for aTreeItem as a block"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   141
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   142
    ^[:aTreeItem|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   143
        |label superCls|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   144
        label := aTreeItem contents name.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   145
        (aTreeItem contents isPrivate and: [aTreeItem parent contents ~~ (superCls := aTreeItem contents superclass)])
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   146
            ifTrue: [label := label, ' (', superCls name, ')'].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   147
        label
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   148
     ]
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   149
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   150
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   151
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   152
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   153
!ResourceSelectionBrowser class methodsFor:'image specs'!
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   154
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   155
iconCategory
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   156
    "This resource specification was automatically generated
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   157
     by the ImageEditor of ST/X."
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   158
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   159
    "Do not manually edit this!! If it is corrupted,
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   160
     the ImageEditor may not be able to read the specification."
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   161
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   162
    "
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   163
     self iconCategory inspect
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   164
     ImageEditor openOnClass:self andSelector:#iconCategory
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   165
    "
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   166
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   167
    <resource: #image>
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   168
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   169
    ^Icon
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   170
        constantNamed:#'ResourceSelectionBrowser iconCategory'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   171
        ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'3L0@@@@@@L3L3L@@@@@@@@3L3@@3L3L3L0CL3@LQDQDQD#CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@L#L3L3L3CL3@@3L3L3L0CL3L@@@@@@@@3L3L0@@@@@@L3L') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'<@O@8@G@3?3@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@3?3@8@G@<@O@') ; yourself); yourself]!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   172
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   173
iconClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   174
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   175
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   176
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   177
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   178
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   179
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   180
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   181
     ImageEditor openOnClass:self andSelector:#iconClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   182
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   183
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   184
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   185
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   186
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   187
	constantNamed:#'ResourceSelectionBrowser iconClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   188
	ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@UUUUU!!Q****(@F**** @Z****@A****(@F**** @Z****@A****(LF**** TZ****@A****(@F**** @Z****@B@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself]!
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   189
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   190
iconPrivateClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   191
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   192
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   193
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   194
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   195
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   196
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   197
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   198
     ImageEditor openOnClass:self andSelector:#iconPrivateClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   199
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   200
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   201
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   202
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   203
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   204
	constantNamed:#'ResourceSelectionBrowser iconPrivateClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   205
	ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU A****(@F*??* @Z+??*@A*/*>(OF*>+: @Z+??*@A*/?:(DF*>** @Z+:**@A*/**(@F*>** @Z****C2@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself]! !
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   206
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   207
!ResourceSelectionBrowser class methodsFor:'interface specs'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   208
cf47d420764a initial checkin
tz
parents:
diff changeset
   209
windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   210
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   211
     by the UIPainter of ST/X."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   212
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   213
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   214
     the UIPainter may not be able to read the specification."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   215
cf47d420764a initial checkin
tz
parents:
diff changeset
   216
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   217
     UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   218
     ResourceSelectionBrowser new openInterface:#windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   219
     ResourceSelectionBrowser open
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   220
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   221
cf47d420764a initial checkin
tz
parents:
diff changeset
   222
    <resource: #canvas>
cf47d420764a initial checkin
tz
parents:
diff changeset
   223
cf47d420764a initial checkin
tz
parents:
diff changeset
   224
    ^
468
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
   225
     
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   226
       #(#FullSpec
773
tz
parents: 771
diff changeset
   227
          #window: 
tz
parents: 771
diff changeset
   228
           #(#WindowSpec
tz
parents: 771
diff changeset
   229
              #name: 'Resource Selection Browser'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   230
              #layout: #(#LayoutFrame 194 0 307 0 793 0 656 0)
773
tz
parents: 771
diff changeset
   231
              #label: 'Resource Selection Browser'
tz
parents: 771
diff changeset
   232
              #min: #(#Point 400 300)
tz
parents: 771
diff changeset
   233
              #max: #(#Point 1152 864)
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   234
              #bounds: #(#Rectangle 194 307 794 657)
773
tz
parents: 771
diff changeset
   235
              #usePreferredExtent: false
tz
parents: 771
diff changeset
   236
          )
tz
parents: 771
diff changeset
   237
          #component: 
tz
parents: 771
diff changeset
   238
           #(#SpecCollection
tz
parents: 771
diff changeset
   239
              #collection: 
tz
parents: 771
diff changeset
   240
               #(
tz
parents: 771
diff changeset
   241
                 #(#VariableHorizontalPanelSpec
tz
parents: 771
diff changeset
   242
                    #name: 'VariableHorizontalPanel'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   243
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -36 1.0)
773
tz
parents: 771
diff changeset
   244
                    #component: 
tz
parents: 771
diff changeset
   245
                     #(#SpecCollection
tz
parents: 771
diff changeset
   246
                        #collection: 
tz
parents: 771
diff changeset
   247
                         #(
tz
parents: 771
diff changeset
   248
                           #(#ViewSpec
tz
parents: 771
diff changeset
   249
                              #name: 'Box1'
tz
parents: 771
diff changeset
   250
                              #component: 
tz
parents: 771
diff changeset
   251
                               #(#SpecCollection
tz
parents: 771
diff changeset
   252
                                  #collection: 
tz
parents: 771
diff changeset
   253
                                   #(
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   254
                                     #(#HorizontalPanelViewSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   255
                                        #name: 'HorizontalPanel2'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   256
                                        #layout: #(#LayoutFrame 0 0 2 0 297 0 23 0)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   257
                                        #component: 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   258
                                         #(#SpecCollection
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   259
                                            #collection: 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   260
                                             #(
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   261
                                               #(#RadioButtonSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   262
                                                  #name: 'ClassCategoriesRadioButton'
918
1172ecb3fd63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   263
                                                  #label: 'Categories'
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   264
                                                  #translateLabel: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   265
                                                  #model: #selectionOfClassPresentation
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   266
                                                  #isTriggerOnDown: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   267
                                                  #lampColor: #(#Color 0.0 0.0 0.0)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   268
                                                  #select: #'Class Categories'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   269
                                                  #extent: #(#Point 124 21)
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   270
                                              )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   271
                                               #(#RadioButtonSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   272
                                                  #name: 'ClassHierarchyRadioButton'
918
1172ecb3fd63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   273
                                                  #label: 'Hierarchy'
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   274
                                                  #translateLabel: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   275
                                                  #model: #selectionOfClassPresentation
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   276
                                                  #isTriggerOnDown: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   277
                                                  #lampColor: #(#Color 0.0 0.0 0.0)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   278
                                                  #select: #'Class Hierarchy'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   279
                                                  #extent: #(#Point 145 21)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   280
                                              )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   281
                                            )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   282
                                        )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   283
                                        #horizontalLayout: #leftSpace
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   284
                                        #verticalLayout: #fit
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   285
                                        #horizontalSpace: 3
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   286
                                        #verticalSpace: 3
773
tz
parents: 771
diff changeset
   287
                                    )
tz
parents: 771
diff changeset
   288
                                     #(#SelectionInTreeViewSpec
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   289
                                        #name: 'listOfClassHierarchyView'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   290
                                        #layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0)
773
tz
parents: 771
diff changeset
   291
                                        #tabable: true
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   292
                                        #model: #selectionOfClassHierarchy
773
tz
parents: 771
diff changeset
   293
                                        #hasHorizontalScrollBar: true
tz
parents: 771
diff changeset
   294
                                        #hasVerticalScrollBar: true
tz
parents: 771
diff changeset
   295
                                        #miniScrollerHorizontal: true
tz
parents: 771
diff changeset
   296
                                        #showDirectoryIndicatorForRoot: false
tz
parents: 771
diff changeset
   297
                                        #showDirectoryIndicator: true
tz
parents: 771
diff changeset
   298
                                        #valueChangeSelector: #classSelected
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   299
                                        #hierarchicalList: #rootOfClassHierarchy
773
tz
parents: 771
diff changeset
   300
                                        #validateDoubleClickSelector: #validateDoubleClick:
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   301
                                        #contentsSelector: #treeViewClassHierarchyContents
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   302
                                        #labelSelector: #treeViewClassHierarchyLabel
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   303
                                        #childrenSelector: #treeViewClassHierarchyChildren
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   304
                                        #iconSelector: #treeViewClassHierarchyIcon
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   305
                                    )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   306
                                     #(#SelectionInTreeViewSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   307
                                        #name: 'listOfClassCategoriesView'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   308
                                        #layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0)
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   309
                                        #tabable: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   310
                                        #model: #selectionOfClassCategories
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   311
                                        #hasHorizontalScrollBar: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   312
                                        #hasVerticalScrollBar: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   313
                                        #miniScrollerHorizontal: true
909
c0bd0d9103e3 class presentation in categories added (3)
tz
parents: 907
diff changeset
   314
                                        #showRoot: false
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   315
                                        #showDirectoryIndicator: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   316
                                        #valueChangeSelector: #classSelected
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   317
                                        #hierarchicalList: #rootOfClassCategories
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   318
                                        #validateDoubleClickSelector: #validateDoubleClick:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   319
                                        #childrenSelector: #treeViewClassCategoryChildren
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   320
                                        #iconSelector: #treeViewClassCategoryIcon
773
tz
parents: 771
diff changeset
   321
                                    )
tz
parents: 771
diff changeset
   322
                                     #(#InputFieldSpec
tz
parents: 771
diff changeset
   323
                                        #name: 'classNameInputField'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   324
                                        #layout: #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1)
773
tz
parents: 771
diff changeset
   325
                                        #tabable: true
tz
parents: 771
diff changeset
   326
                                        #model: #valueOfClassName
tz
parents: 771
diff changeset
   327
                                    )
tz
parents: 771
diff changeset
   328
                                  )
tz
parents: 771
diff changeset
   329
                              )
tz
parents: 771
diff changeset
   330
                          )
tz
parents: 771
diff changeset
   331
                           #(#ViewSpec
tz
parents: 771
diff changeset
   332
                              #name: 'Box2'
tz
parents: 771
diff changeset
   333
                              #component: 
tz
parents: 771
diff changeset
   334
                               #(#SpecCollection
tz
parents: 771
diff changeset
   335
                                  #collection: 
tz
parents: 771
diff changeset
   336
                                   #(
tz
parents: 771
diff changeset
   337
                                     #(#DataSetSpec
tz
parents: 771
diff changeset
   338
                                        #name: 'resourcesDataSetView'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   339
                                        #layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0)
773
tz
parents: 771
diff changeset
   340
                                        #model: #selectionOfResourceMethod
tz
parents: 771
diff changeset
   341
                                        #hasHorizontalScrollBar: true
tz
parents: 771
diff changeset
   342
                                        #hasVerticalScrollBar: true
tz
parents: 771
diff changeset
   343
                                        #miniScrollerHorizontal: true
tz
parents: 771
diff changeset
   344
                                        #rowClassName: 'ResourceSelectionBrowser::Row'
tz
parents: 771
diff changeset
   345
                                        #dataList: #listOfResourceMethods
tz
parents: 771
diff changeset
   346
                                        #useIndex: false
tz
parents: 771
diff changeset
   347
                                        #has3Dsepartors: true
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   348
                                        #has3Dseparators: true
773
tz
parents: 771
diff changeset
   349
                                        #doubleClickSelector: #resourceDoubleClicked
tz
parents: 771
diff changeset
   350
                                        #columnHolder: #resourceMethodColumns
tz
parents: 771
diff changeset
   351
                                        #valueChangeSelector: #resourceSelected
tz
parents: 771
diff changeset
   352
                                        #verticalSpacing: 1
tz
parents: 771
diff changeset
   353
                                    )
tz
parents: 771
diff changeset
   354
                                     #(#InputFieldSpec
tz
parents: 771
diff changeset
   355
                                        #name: 'selectorInputField'
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   356
                                        #layout: #(#LayoutFrame 2 0.0 -22 1 -2 1.0 0 1)
773
tz
parents: 771
diff changeset
   357
                                        #tabable: true
tz
parents: 771
diff changeset
   358
                                        #model: #valueOfResourceSelector
tz
parents: 771
diff changeset
   359
                                    )
tz
parents: 771
diff changeset
   360
                                  )
tz
parents: 771
diff changeset
   361
                              )
tz
parents: 771
diff changeset
   362
                          )
tz
parents: 771
diff changeset
   363
                        )
tz
parents: 771
diff changeset
   364
                    )
tz
parents: 771
diff changeset
   365
                    #handles: #(#Any 0.5 1.0)
tz
parents: 771
diff changeset
   366
                )
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   367
                 #(#HorizontalPanelViewSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   368
                    #name: 'HorizontalPanel1'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   369
                    #layout: #(#LayoutFrame 2 0.0 -30 1 -2 1.0 -4 1.0)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   370
                    #component: 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   371
                     #(#SpecCollection
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   372
                        #collection: 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   373
                         #(
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   374
                           #(#ActionButtonSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   375
                              #name: 'HelpButton'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   376
                              #activeHelpKey: #dss
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   377
                              #label: 'Help'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   378
                              #model: #openHTMLDocument:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   379
                              #initiallyDisabled: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   380
                              #enableChannel: #helpEnabled
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   381
                              #actionValue: 'tools/uipainter/ResourceSelectionBrowser.html'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   382
                              #extent: #(#Point 196 26)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   383
                          )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   384
                           #(#ActionButtonSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   385
                              #name: 'cancelButton'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   386
                              #activeHelpKey: #commitCancel
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   387
                              #label: 'Cancel'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   388
                              #tabable: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   389
                              #model: #cancel
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   390
                              #extent: #(#Point 196 26)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   391
                          )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   392
                           #(#ActionButtonSpec
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   393
                              #name: 'okButton'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   394
                              #activeHelpKey: #commitOK
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   395
                              #label: 'OK'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   396
                              #tabable: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   397
                              #model: #accept
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   398
                              #isDefault: true
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   399
                              #extent: #(#Point 196 24)
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   400
                          )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   401
                        )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   402
                    )
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   403
                    #horizontalLayout: #fit
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   404
                    #verticalLayout: #fit
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   405
                )
773
tz
parents: 771
diff changeset
   406
              )
tz
parents: 771
diff changeset
   407
          )
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   408
      )
918
1172ecb3fd63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   409
1172ecb3fd63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   410
    "Modified: / 27.7.1998 / 18:05:40 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   411
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   412
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   413
!ResourceSelectionBrowser class methodsFor:'list specs'!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   414
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   415
tableColumnsForResourceMethodAttributes
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   416
    "This resource specification was automatically generated
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   417
     by the DataSetBuilder of ST/X."
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   418
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   419
    "Do not manually edit this!! If it is corrupted,
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   420
     the DataSetBuilder may not be able to read the specification."
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   421
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   422
    "
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   423
     DataSetBuilder new openOnClass:ResourceSelectionBrowser andSelector:#tableColumnsForResourceMethodAttributes
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   424
    "
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   425
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   426
    <resource: #tableColumns>
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   427
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   428
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   429
    ^ #(
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   430
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   431
           #width: 20
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   432
           #height: 20
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   433
           #printSelector: #iconOn:
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   434
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   435
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   436
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   437
           #label: ' Selector'
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   438
           #labelAlignment: #left
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   439
           #model: #selector
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   440
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   441
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   442
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   443
           #label: ' Resource Type'
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   444
           #labelAlignment: #left
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   445
           #model: #resourceType
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   446
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   447
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   448
     )
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   449
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   450
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   451
!ResourceSelectionBrowser methodsFor:'aspects'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   452
773
tz
parents: 771
diff changeset
   453
helpEnabled
tz
parents: 771
diff changeset
   454
    "returns whether there is a documentation file"
tz
parents: 771
diff changeset
   455
tz
parents: 771
diff changeset
   456
    ^true
tz
parents: 771
diff changeset
   457
!
tz
parents: 771
diff changeset
   458
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   459
listOfResourceMethods
905c3b4ba565 revised
tz
parents: 769
diff changeset
   460
    "returns the value holder for the list of the resource methods"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   461
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   462
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   463
    (holder := builder bindingAt:#listOfResourceMethods) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   464
	builder aspectAt:#listOfResourceMethods put:(holder :=  List new).
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   465
    ].
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   466
    ^ holder
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   467
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   468
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   469
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   470
    "returns the columns for the table of the resource methods as value holder"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   471
cf47d420764a initial checkin
tz
parents:
diff changeset
   472
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   473
    (holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   474
        builder aspectAt:#resourceMethodColumns put:(holder := List new).
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   475
        holder addAll: (self class tableColumnsForResourceMethodAttributes collect: [:i| i decodeAsLiteralArray]).
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   476
    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   477
    ^ holder
905c3b4ba565 revised
tz
parents: 769
diff changeset
   478
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   479
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   480
rootOfClassCategories
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   481
    "returns the value holder for the root of the class tree list"
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   482
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   483
    |holder|                                
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   484
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   485
    (holder := builder bindingAt:#rootOfClassCategories) isNil ifTrue:[
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   486
        ClassPresentation = #'Class Categories' ifTrue: [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   487
        builder aspectAt:#rootOfClassCategories put: (holder := TreeItem name: 'Categories')].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   488
    ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   489
    ^ holder
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   490
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   491
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   492
!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   493
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   494
rootOfClassHierarchy
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   495
    "returns the value holder for the root of the class tree list"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   496
905c3b4ba565 revised
tz
parents: 769
diff changeset
   497
    |holder|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   498
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   499
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   500
    (holder := builder bindingAt:#rootOfClassHierarchy) isNil ifTrue:[
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   501
        ClassPresentation = #'Class Hierarchy' ifTrue: [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   502
        builder aspectAt:#rootOfClassHierarchy put: (holder := TreeItem new)]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   503
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   504
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   505
cf47d420764a initial checkin
tz
parents:
diff changeset
   506
cf47d420764a initial checkin
tz
parents:
diff changeset
   507
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   508
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   509
selectionOfClassCategories
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   510
    "returns the value holder for the selected class of the class tree list"
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   511
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   512
    |holder|           
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   513
    (holder := builder bindingAt:#selectionOfClassCategories) isNil ifTrue:[
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   514
        builder aspectAt:#selectionOfClassCategories put:(holder :=  ValueHolder new). 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   515
    ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   516
    ^ holder
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   517
!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   518
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   519
selectionOfClassHierarchy
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   520
    "returns the value holder for the selected class of the class tree list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   521
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   522
    |holder|           
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   523
    (holder := builder bindingAt:#selectionOfClassHierarchy) isNil ifTrue:[
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   524
        builder aspectAt:#selectionOfClassHierarchy put:(holder :=  ValueHolder new). 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   525
    ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   526
    ^ holder
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   527
!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   528
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   529
selectionOfClassPresentation
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   530
    "returns the value holder for the selected class presentation"
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   531
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   532
    |holder|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   533
    (holder := builder bindingAt:#selectionOfClassPresentation) isNil ifTrue:[
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   534
        builder aspectAt:#selectionOfClassPresentation put:(holder :=  RadioButtonGroup with: (ClassPresentation := ClassPresentation ? #'Class Categories')).
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   535
        holder onChangeSend: #value to: [holder value = #'Class Hierarchy'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   536
            ifTrue:  [ClassPresentation := holder value.(builder componentAt: #listOfClassHierarchyView)  root: self rootOfClassHierarchy.  (builder componentAt: #listOfClassHierarchyView)  raise. classSelectionBlock value: self valueOfClassName value]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   537
            ifFalse: [ClassPresentation := holder value.(builder componentAt: #listOfClassCategoriesView) root: self rootOfClassCategories. (builder componentAt: #listOfClassCategoriesView) raise. classSelectionBlock value: self valueOfClassName value]]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   538
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   539
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   540
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   541
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   542
selectionOfResourceMethod
905c3b4ba565 revised
tz
parents: 769
diff changeset
   543
    "returns the value holder for the selected resource method of the resource method list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   544
cf47d420764a initial checkin
tz
parents:
diff changeset
   545
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   546
    (holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   547
	builder aspectAt:#selectionOfResourceMethod put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   548
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   549
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   550
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   551
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   552
valueOfClassName
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   553
    "returns the value holder for the name of the class"
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   554
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   555
    |holder|                   
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   556
    (holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   557
        builder aspectAt:#valueOfClassName put:(holder :=  '' asValue).
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   558
    ].
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   559
    ^ holder
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   560
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   561
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   562
valueOfResourceSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
   563
    "returns the value holder for the name of the selector"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   564
cf47d420764a initial checkin
tz
parents:
diff changeset
   565
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   566
    (holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   567
	builder aspectAt:#valueOfResourceSelector put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   568
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   569
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   570
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   571
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   572
!ResourceSelectionBrowser methodsFor:'callbacks - class list'!
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   573
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   574
treeViewClassCategoryChildren
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   575
    "returns the children for the contents (class) of aTreeItem as a block"
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   576
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   577
    ^[:aTreeItem|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   578
        |children|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   579
         children := OrderedCollection new.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   580
         aTreeItem contents = ''
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   581
         ifTrue:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   582
         [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   583
            children := (self treeViewClassHierarchyContents withAllSubclasses collect: [:cls| cls category]) asSet asSortedCollection.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   584
            children := children collect: [:child| TreeItem name: child contents: 'Category']
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   585
         ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   586
         aTreeItem contents = 'Category'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   587
         ifTrue:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   588
         [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   589
            children := self treeViewClassHierarchyContents withAllSubclasses select: [:cls| cls category = aTreeItem name and: [cls isPrivate not]].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   590
            children := children asSortedCollection: [:c1 :c2| c1 name <= c2 name].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   591
            children := children collect: [:child| TreeItem name: child name contents: child]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   592
         ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   593
         aTreeItem contents isClass
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   594
         ifTrue:
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   595
         [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   596
            children := aTreeItem contents privateClasses.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   597
            children := children asSortedCollection: [:c1 :c2| c1 name <= c2 name].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   598
            children := children collect: [:child| TreeItem name: child name , ' (', child superclass name, ')' contents: child]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   599
         ].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   600
         children
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   601
     ]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   602
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   603
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   604
!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   605
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   606
treeViewClassCategoryIcon
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   607
    "returns the icon for aTreeItem as a block"
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   608
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   609
    ^self class treeViewClassHierarchyIcon
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   610
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   611
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   612
!
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   613
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   614
treeViewClassHierarchyContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   615
    "returns the contents of the root of the class tree list"
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   616
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   617
    |cls|
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   618
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   619
    resourceSuperclass notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   620
        cls := Smalltalk at: resourceSuperclass.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   621
    ].
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   622
    ^ cls ? self class treeViewClassHierarchyContents
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   623
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   624
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   625
905c3b4ba565 revised
tz
parents: 769
diff changeset
   626
validateDoubleClick: aTreeItem
905c3b4ba565 revised
tz
parents: 769
diff changeset
   627
    "returns whether a class may be selected"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   628
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   629
    ^aTreeItem contents ~= '' and: [aTreeItem contents ~~ self treeViewClassHierarchyContents]       
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   630
905c3b4ba565 revised
tz
parents: 769
diff changeset
   631
905c3b4ba565 revised
tz
parents: 769
diff changeset
   632
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   633
! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   634
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   635
!ResourceSelectionBrowser methodsFor:'callbacks - user'!
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   636
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   637
classSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   638
    "after a class selection, read the allowed resource methods of the selected class"
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   639
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   640
    ClassPresentation = #'Class Hierarchy'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   641
        ifTrue:  [self selectionOfClassHierarchy  value isNil ifTrue: [^nil]]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   642
        ifFalse: [self selectionOfClassCategories value isNil ifTrue: [^nil]].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   643
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   644
    self withWaitCursorDo:
cf47d420764a initial checkin
tz
parents:
diff changeset
   645
    [
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   646
        |clsName|           
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   647
        resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   648
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   649
        ClassPresentation = #'Class Hierarchy'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   650
            ifTrue:  [clsName := (self selectionOfClassHierarchy  value name upTo: $ ) asSymbol]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   651
            ifFalse: [clsName := (self selectionOfClassCategories value name upTo: $ ) asSymbol].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   652
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   653
        self valueOfClassName value: clsName.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   654
        self class lastSelection: clsName.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   655
        self listOfResourceMethods contents:
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   656
            ((((Smalltalk at: clsName) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   657
                class methodDictionary
cf47d420764a initial checkin
tz
parents:
diff changeset
   658
                asOrderedCollection select: 
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   659
                    [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   660
             collect: [:m| (ResourceMethod new method: m)]).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   661
    ]
cf47d420764a initial checkin
tz
parents:
diff changeset
   662
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   663
cf47d420764a initial checkin
tz
parents:
diff changeset
   664
resourceDoubleClicked
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   665
    "after a double click on resource method, accept it and close"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   666
cf47d420764a initial checkin
tz
parents:
diff changeset
   667
    accept value: true.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   668
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   669
    self close
cf47d420764a initial checkin
tz
parents:
diff changeset
   670
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   671
cf47d420764a initial checkin
tz
parents:
diff changeset
   672
resourceSelected
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   673
    "after a click on a resource method, set its selector into the field"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   674
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   675
    self selectionOfResourceMethod value notNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   676
	ifTrue: [self valueOfResourceSelector value: self selectionOfResourceMethod value selector]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   677
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   678
cf47d420764a initial checkin
tz
parents:
diff changeset
   679
!ResourceSelectionBrowser methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   680
cf47d420764a initial checkin
tz
parents:
diff changeset
   681
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   682
    "opens a ResourceSelectionBrowser on 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   683
        aSuperclassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   684
        and aClassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   685
        and aSelector,
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   686
        with allowed aResourceTypes"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   687
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   688
    |clsName|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   689
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   690
    resourceMethod := aSelector.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   691
    resourceTypes := aResourceTypes.
cf47d420764a initial checkin
tz
parents:
diff changeset
   692
    resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   693
    resourceClass := nil.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   694
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   695
    aClassOrSymbol isClass 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   696
        ifTrue: [resourceClass := aClassOrSymbol name] 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   697
        ifFalse: [
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   698
            aClassOrSymbol notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   699
                (Smalltalk at: aClassOrSymbol) notNil
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   700
                ifTrue: [resourceClass := aClassOrSymbol]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   701
            ]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   702
        ].            
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   703
    self valueOfResourceSelector value:(aSelector ? '').
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   704
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   705
    self open.
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   706
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   707
    (clsName := self selectionOfClassHierarchy value) isNil 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   708
        ifTrue:  [(clsName := self selectionOfClassCategories value) isNil ifTrue:  [^nil]].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   709
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   710
    clsName := (clsName name upTo: $ ) asSymbol.
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   711
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   712
    ((Smalltalk at: clsName) isClass and: [accept value]) 
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   713
    ifTrue:
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   714
    [            
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   715
        ^clsName, ' ', self valueOfResourceSelector value
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   716
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   717
    ^nil
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   718
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   719
    "Modified: / 22.4.1998 / 14:51:03 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   720
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   721
cf47d420764a initial checkin
tz
parents:
diff changeset
   722
!ResourceSelectionBrowser methodsFor:'startup / release'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   723
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   724
postBuildWith:aBuilder
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   725
    "after building and before opening,  
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   726
     create a class selection block, an entry completion block for the class name field"
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   727
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   728
    |classSelection classNameInputField|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   729
     
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   730
    allClasses := self treeViewClassHierarchyContents withAllSubclasses reject: [:cls| cls isPrivate].
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   731
    classSelection :=  resourceClass. 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   732
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   733
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   734
        ifTrue: [classSelection :=  self class lastSelection].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   735
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   736
        ifTrue: [classSelection :=  self treeViewContents].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   737
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   738
    classSelectionBlock := 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   739
    [:clsPattern|                                  
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   740
        |foundClass classes|  
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   741
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   742
        clsPattern notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   743
            foundClass := Smalltalk at:(clsPattern printString asSymbol).
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   744
        ].
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   745
        (foundClass isClass not or:[foundClass name ~= clsPattern])
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   746
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   747
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   748
            classes := allClasses select: [:cls| cls name size >= clsPattern size].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   749
            1 to: clsPattern size do: 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   750
            [:i|    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   751
                 classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   752
            ].    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   753
            foundClass := classes at: 1 ifAbsent: [nil] 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   754
        ].          
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   755
        foundClass notNil
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   756
        ifTrue:
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   757
        [           
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   758
            ClassPresentation = #'Class Hierarchy'
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   759
            ifTrue:  
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   760
            [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   761
                |searchArgs nonSuperclasses|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   762
                foundClass isPrivate
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   763
                    ifFalse: [searchArgs := foundClass withAllSuperclasses reverse]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   764
                    ifTrue:  [searchArgs := foundClass owningClass withAllSuperclasses reverse. searchArgs add: foundClass]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   765
    .                                  
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   766
                (nonSuperclasses := self treeViewClassHierarchyContents allSuperclasses) notNil 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   767
                    ifTrue: [searchArgs := searchArgs reject: [:cls| nonSuperclasses includes: cls]].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   768
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   769
                self selectionOfClassHierarchy value: (self rootOfClassHierarchy detectChild:[:child :arg| child contents == arg] arguments:searchArgs).
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   770
            ]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   771
            ifFalse: 
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   772
            [
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   773
                |searchArgs|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   774
                foundClass isPrivate
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   775
                    ifTrue:  [searchArgs := Array with: 'Categories' with: foundClass category with: foundClass owningClass name with: foundClass name]
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   776
                    ifFalse: [searchArgs := Array with: 'Categories' with: foundClass category with: foundClass name].
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   777
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   778
                self selectionOfClassCategories value: (self rootOfClassCategories detectChild:[:child :arg| (child name upTo: $ ) = arg] arguments:searchArgs).
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   779
            ].
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   780
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   781
        self valueOfClassName value: clsPattern
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   782
    ].
635
47ffd4e4f387 do select method row after opening
tz
parents: 632
diff changeset
   783
    self valueOfClassName value: classSelection.  
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   784
905c3b4ba565 revised
tz
parents: 769
diff changeset
   785
    (classNameInputField := builder componentAt: #classNameInputField) entryCompletionBlock:
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   786
    [:value|
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   787
        |what oldClassName|
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   788
        oldClassName := classNameInputField contents.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   789
        what := Smalltalk classnameCompletion: value withoutSpaces.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   790
        classNameInputField contents:what first.
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   791
        oldClassName = classNameInputField contents ifTrue:[classNameInputField flash].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   792
        classSelectionBlock value: classNameInputField contents
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   793
    ].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   794
906
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   795
    classSelectionBlock value: self valueOfClassName value.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   796
    self classSelected.
8be0b8d1a2fd class presentation in categories added
tz
parents: 867
diff changeset
   797
    self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil).
909
c0bd0d9103e3 class presentation in categories added (3)
tz
parents: 907
diff changeset
   798
c0bd0d9103e3 class presentation in categories added (3)
tz
parents: 907
diff changeset
   799
    ^super postBuildWith:aBuilder
c0bd0d9103e3 class presentation in categories added (3)
tz
parents: 907
diff changeset
   800
910
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   801
!
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   802
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   803
postOpenWith:aBuilder
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   804
    "after opening and if turned on make hierarchy view visible"
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   805
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   806
    ClassPresentation = #'Class Hierarchy'
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   807
        ifTrue: [(builder componentAt: #listOfClassHierarchyView) raise].
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   808
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   809
    ^super postOpenWith:aBuilder
7510ea8c9aeb class presentation in categories added (4)
tz
parents: 909
diff changeset
   810
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   811
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   812
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   813
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'!
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   814
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   815
iconOn:aGC
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   816
    "registers and returns an icon indicating the resource type"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   817
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   818
    self resourceType isNil ifTrue: [^nil].
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   819
    icon isNil 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   820
    ifTrue: 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   821
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   822
	|cls sel image imageKey|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   823
	((self resourceType = #image) or: [resourceType = #fileImage])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   824
	ifTrue: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   825
	[  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   826
	    cls := method who methodClass soleInstance.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   827
	    sel := method who methodSelector.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   828
	]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   829
	ifFalse:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   830
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   831
	    cls := BrowserView.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   832
	    sel := (resourceType, 'Icon') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   833
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   834
	imageKey := (cls name, sel) asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   835
	(icon := aGC registeredImageAt: imageKey) isNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   836
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   837
	[       
905c3b4ba565 revised
tz
parents: 769
diff changeset
   838
	    image := cls perform: sel.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   839
	    image extent y > 18
905c3b4ba565 revised
tz
parents: 769
diff changeset
   840
	    ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   841
	    [         
905c3b4ba565 revised
tz
parents: 769
diff changeset
   842
		image := image magnifiedBy: 18/image extent y
905c3b4ba565 revised
tz
parents: 769
diff changeset
   843
	    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   844
	    aGC registerImage: image key: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   845
	    icon := aGC registeredImageAt: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   846
	].
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   847
    ].
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   848
    ^icon
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   849
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   850
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   851
method: aMethod
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   852
    "sets aMethod"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   853
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   854
    method := aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   855
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   856
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   857
resourceType
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   858
    "returns resourceType"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   859
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   860
    resourceType isNil ifTrue: [resourceType := method resourceType].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   861
    ^resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   862
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   863
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   864
selector
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   865
    "returns selector"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   866
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   867
    selector isNil ifTrue: [selector := method who methodSelector].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   868
    ^selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   869
! !
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   870
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   871
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   872
cf47d420764a initial checkin
tz
parents:
diff changeset
   873
version
cf47d420764a initial checkin
tz
parents:
diff changeset
   874
    ^ '$Header$'
cf47d420764a initial checkin
tz
parents:
diff changeset
   875
! !