ResourceSelectionBrowser.st
author tz
Thu, 09 Apr 1998 21:12:59 +0200
changeset 771 905c3b4ba565
parent 769 bb413a70f479
child 773 de5c99bd3078
permissions -rw-r--r--
revised
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
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    16
		allClasses classSelectionBlock readResourcesProcess
905c3b4ba565 revised
tz
parents: 769
diff changeset
    17
		mayReadResources'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    18
	classVariableNames:''
cf47d420764a initial checkin
tz
parents:
diff changeset
    19
	poolDictionaries:''
619
36c9d07f7dc3 class category changed
tz
parents: 616
diff changeset
    20
	category:'Interface-Dialogs'
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    21
!
cf47d420764a initial checkin
tz
parents:
diff changeset
    22
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    23
Object subclass:#ResourceMethod
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    24
	instanceVariableNames:'method icon resourceType selector'
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    25
	classVariableNames:''
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    26
	poolDictionaries:''
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    27
	privateIn:ResourceSelectionBrowser
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    28
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
    29
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    30
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    31
cf47d420764a initial checkin
tz
parents:
diff changeset
    32
copyright
cf47d420764a initial checkin
tz
parents:
diff changeset
    33
"
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    34
 COPYRIGHT (c) 1997-1998 by eXept Software AG
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    35
              All Rights Reserved
cf47d420764a initial checkin
tz
parents:
diff changeset
    36
cf47d420764a initial checkin
tz
parents:
diff changeset
    37
 This software is furnished under a license and may be used
cf47d420764a initial checkin
tz
parents:
diff changeset
    38
 only in accordance with the terms of that license and with the
cf47d420764a initial checkin
tz
parents:
diff changeset
    39
 inclusion of the above copyright notice. This software may not
cf47d420764a initial checkin
tz
parents:
diff changeset
    40
 be provided or otherwise made available to, or used by, any
cf47d420764a initial checkin
tz
parents:
diff changeset
    41
 other person. No title to or ownership of the software is
cf47d420764a initial checkin
tz
parents:
diff changeset
    42
 hereby transferred.
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
cf47d420764a initial checkin
tz
parents:
diff changeset
    47
documentation
cf47d420764a initial checkin
tz
parents:
diff changeset
    48
"
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
    49
    The ResourceSelectionBrowser allows you to browse in class hierarchies
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    50
    and to select resource methods for loading or to saving resource 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    51
    specifications (#canvas, #menu, etc.).
905c3b4ba565 revised
tz
parents: 769
diff changeset
    52
905c3b4ba565 revised
tz
parents: 769
diff changeset
    53
    [instance variables:]
905c3b4ba565 revised
tz
parents: 769
diff changeset
    54
	resourceMethod          <Symbol>        selector of the resource spec
905c3b4ba565 revised
tz
parents: 769
diff changeset
    55
	resourceClass           <Symbol>        class of the resource spec
905c3b4ba565 revised
tz
parents: 769
diff changeset
    56
	resourceSuperclass      <Symbol>        root class of the tree list
905c3b4ba565 revised
tz
parents: 769
diff changeset
    57
	resourceTypes           <Array>         allowed resource types
905c3b4ba565 revised
tz
parents: 769
diff changeset
    58
	allClasses              <Array>         list of the subclasses of resourceSuperclass
905c3b4ba565 revised
tz
parents: 769
diff changeset
    59
	classSelectionBlock     <Block>         by evaluating this block the class selection is done
905c3b4ba565 revised
tz
parents: 769
diff changeset
    60
	readResourcesProcess    <Process>       process of reading the resource methods
905c3b4ba565 revised
tz
parents: 769
diff changeset
    61
	mayReadResources        <Boolean>       flag whether may read the resource methods
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
    62
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    63
    [start with:]
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    64
	ResourceSelectionBrowser open
504
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    65
1ff52096d1d3 copyright changed
tz
parents: 481
diff changeset
    66
    [author:]
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    67
	Thomas Zwick, eXept Software AG
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    68
"
cf47d420764a initial checkin
tz
parents:
diff changeset
    69
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    70
cf47d420764a initial checkin
tz
parents:
diff changeset
    71
!ResourceSelectionBrowser class methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
    72
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    73
request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withResourceTypes: resourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    74
    "opens a ResourceSelectionBrowser 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    75
	with aTitle
905c3b4ba565 revised
tz
parents: 769
diff changeset
    76
	on aSuperclassOrSymbol, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    77
	and aClassOrSymbol, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    78
	and aSelector,
905c3b4ba565 revised
tz
parents: 769
diff changeset
    79
	with allowed aResourceTypes"
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    80
    "
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
    81
    ResourceSelectionBrowser
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    82
	request: 'Select a Resource Selector'
905c3b4ba565 revised
tz
parents: 769
diff changeset
    83
	onSuperclass: #ApplicationModel 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    84
	andClass: #ToolApplicationModel 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    85
	andSelector: #saveIcon 
905c3b4ba565 revised
tz
parents: 769
diff changeset
    86
	withResourceTypes: #(image) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    87
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
    88
cf47d420764a initial checkin
tz
parents:
diff changeset
    89
    ^self new
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
    90
	title: aTitle;
905c3b4ba565 revised
tz
parents: 769
diff changeset
    91
	openOnSuperclass: aSuperclass
905c3b4ba565 revised
tz
parents: 769
diff changeset
    92
	andClass: aClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
    93
	andSelector: aSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
    94
	withResourceTypes: resourceTypes
425
cf47d420764a initial checkin
tz
parents:
diff changeset
    95
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
    96
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    97
!ResourceSelectionBrowser class methodsFor:'callbacks - default'!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    98
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
    99
treeViewChildren
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   100
    "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
   101
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   102
    ^[:aTreeItem|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   103
	|classes|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   104
	classes := OrderedCollection new.    
905c3b4ba565 revised
tz
parents: 769
diff changeset
   105
	classes addAll: ((aTreeItem contents subclasses reject: [:cls| cls isPrivate]) asSortedCollection: [:i1 :i2| i1 name < i2 name]).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   106
	classes addAll: (aTreeItem contents privateClasses asSortedCollection: [:i1 :i2| i1 name < i2 name]).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   107
	classes
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   108
     ]
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   109
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   110
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   111
treeViewContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   112
    "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
   113
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   114
    ^Smalltalk at: #Object
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   115
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   116
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   117
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   118
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   119
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   120
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   121
treeViewIcon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   122
    "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
   123
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   124
    ^[:aTreeItem|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   125
	|icon|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   126
	icon := self iconClass.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   127
	aTreeItem contents isPrivate 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   128
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   129
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   130
	   icon := self iconPrivateClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   131
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   132
	icon
905c3b4ba565 revised
tz
parents: 769
diff changeset
   133
    ]
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   134
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   135
!
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
treeViewLabel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   138
    "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
   139
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   140
    ^[:aTreeItem|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   141
	|label superCls|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   142
	label := aTreeItem contents name.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   143
	(aTreeItem contents isPrivate and: [aTreeItem parent contents ~~ (superCls := aTreeItem contents superclass)])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   144
	    ifTrue: [label := label, ' (', superCls name, ')'].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   145
	label
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   146
     ]
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   147
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   148
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   149
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   150
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   151
!ResourceSelectionBrowser class methodsFor:'image specs'!
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   152
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   153
iconClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   154
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   155
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   156
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   157
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   158
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   159
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   160
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   161
     ImageEditor openOnClass:self andSelector:#iconClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   162
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   163
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   164
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   165
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   166
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   167
	constantNamed:#'ResourceSelectionBrowser iconClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   168
	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
   169
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   170
iconPrivateClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   171
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   172
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   173
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   174
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   175
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   176
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   177
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   178
     ImageEditor openOnClass:self andSelector:#iconPrivateClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   179
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   180
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   181
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   182
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   183
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   184
	constantNamed:#'ResourceSelectionBrowser iconPrivateClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   185
	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
   186
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   187
!ResourceSelectionBrowser class methodsFor:'interface specs'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   188
cf47d420764a initial checkin
tz
parents:
diff changeset
   189
windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   190
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   191
     by the UIPainter of ST/X."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   192
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   193
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   194
     the UIPainter may not be able to read the specification."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   195
cf47d420764a initial checkin
tz
parents:
diff changeset
   196
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   197
     UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   198
     ResourceSelectionBrowser new openInterface:#windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   199
     ResourceSelectionBrowser open
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   200
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   201
cf47d420764a initial checkin
tz
parents:
diff changeset
   202
    <resource: #canvas>
cf47d420764a initial checkin
tz
parents:
diff changeset
   203
cf47d420764a initial checkin
tz
parents:
diff changeset
   204
    ^
468
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
   205
     
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   206
       #(#FullSpec
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   207
	  #window: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   208
	   #(#WindowSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   209
	      #name: 'Resource Selection Browser'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   210
	      #layout: #(#LayoutFrame 221 0 252 0 820 0 601 0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   211
	      #label: 'Resource Selection Browser'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   212
	      #min: #(#Point 400 300)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   213
	      #max: #(#Point 1152 864)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   214
	      #bounds: #(#Rectangle 221 252 821 602)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   215
	      #usePreferredExtent: false
905c3b4ba565 revised
tz
parents: 769
diff changeset
   216
	  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   217
	  #component: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   218
	   #(#SpecCollection
905c3b4ba565 revised
tz
parents: 769
diff changeset
   219
	      #collection: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   220
	       #(
905c3b4ba565 revised
tz
parents: 769
diff changeset
   221
		 #(#VariableHorizontalPanelSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   222
		    #name: 'VariableHorizontalPanel'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   223
		    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   224
		    #component: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   225
		     #(#SpecCollection
905c3b4ba565 revised
tz
parents: 769
diff changeset
   226
			#collection: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   227
			 #(
905c3b4ba565 revised
tz
parents: 769
diff changeset
   228
			   #(#ViewSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   229
			      #name: 'Box1'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   230
			      #component: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   231
			       #(#SpecCollection
905c3b4ba565 revised
tz
parents: 769
diff changeset
   232
				  #collection: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   233
				   #(
905c3b4ba565 revised
tz
parents: 769
diff changeset
   234
				     #(#SelectionInTreeViewSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   235
					#name: 'listOfClassesView'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   236
					#layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -22 1.0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   237
					#tabable: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   238
					#model: #selectionOfClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   239
					#hasHorizontalScrollBar: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   240
					#hasVerticalScrollBar: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   241
					#miniScrollerHorizontal: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   242
					#showDirectoryIndicatorForRoot: false
905c3b4ba565 revised
tz
parents: 769
diff changeset
   243
					#showDirectoryIndicator: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   244
					#valueChangeSelector: #classSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   245
					#hierarchicalList: #rootOfClasses
905c3b4ba565 revised
tz
parents: 769
diff changeset
   246
					#validateDoubleClickSelector: #validateDoubleClick:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   247
					#contentsSelector: #treeViewContents
905c3b4ba565 revised
tz
parents: 769
diff changeset
   248
					#labelSelector: #treeViewLabel
905c3b4ba565 revised
tz
parents: 769
diff changeset
   249
					#childrenSelector: #treeViewChildren
905c3b4ba565 revised
tz
parents: 769
diff changeset
   250
					#iconSelector: #treeViewIcon
905c3b4ba565 revised
tz
parents: 769
diff changeset
   251
				    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   252
				     #(#InputFieldSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   253
					#name: 'classNameInputField'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   254
					#layout: #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   255
					#tabable: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   256
					#model: #valueOfClassName
905c3b4ba565 revised
tz
parents: 769
diff changeset
   257
				    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   258
				     #(#LabelSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   259
					#name: 'ClassHierarchyLabel'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   260
					#layout: #(#LayoutFrame 0 0 2 0 297 0 23 0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   261
					#label: ' Class Hierarchy'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   262
					#level: 1
905c3b4ba565 revised
tz
parents: 769
diff changeset
   263
					#adjust: #left
905c3b4ba565 revised
tz
parents: 769
diff changeset
   264
				    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   265
				  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   266
			      )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   267
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   268
			   #(#ViewSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   269
			      #name: 'Box2'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   270
			      #component: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   271
			       #(#SpecCollection
905c3b4ba565 revised
tz
parents: 769
diff changeset
   272
				  #collection: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   273
				   #(
905c3b4ba565 revised
tz
parents: 769
diff changeset
   274
				     #(#DataSetSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   275
					#name: 'resourcesDataSetView'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   276
					#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -22 1.0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   277
					#model: #selectionOfResourceMethod
905c3b4ba565 revised
tz
parents: 769
diff changeset
   278
					#hasHorizontalScrollBar: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   279
					#hasVerticalScrollBar: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   280
					#miniScrollerHorizontal: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   281
					#rowClassName: 'ResourceSelectionBrowser::Row'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   282
					#dataList: #listOfResourceMethods
905c3b4ba565 revised
tz
parents: 769
diff changeset
   283
					#useIndex: false
905c3b4ba565 revised
tz
parents: 769
diff changeset
   284
					#has3Dsepartors: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   285
					#doubleClickSelector: #resourceDoubleClicked
905c3b4ba565 revised
tz
parents: 769
diff changeset
   286
					#columnHolder: #resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   287
					#valueChangeSelector: #resourceSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   288
					#verticalSpacing: 1
905c3b4ba565 revised
tz
parents: 769
diff changeset
   289
				    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   290
				     #(#InputFieldSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   291
					#name: 'selectorInputField'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   292
					#layout: #(#LayoutFrame 2 0.0 -22 1 -2 1.0 0 1)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   293
					#tabable: true
905c3b4ba565 revised
tz
parents: 769
diff changeset
   294
					#model: #valueOfResourceSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
   295
				    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   296
				  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   297
			      )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   298
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   299
			)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   300
		    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   301
		    #handles: #(#Any 0.5 1.0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   302
		)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   303
		 #(#UISubSpecification
905c3b4ba565 revised
tz
parents: 769
diff changeset
   304
		    #name: 'windowSpecForCommitWithoutChannels'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   305
		    #layout: #(#LayoutFrame 301 0.0 -32 1 -2 1.0 -8 1.0)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   306
		    #majorKey: #ToolApplicationModel
905c3b4ba565 revised
tz
parents: 769
diff changeset
   307
		    #minorKey: #windowSpecForCommitWithoutChannels
905c3b4ba565 revised
tz
parents: 769
diff changeset
   308
		)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   309
		 #(#HorizontalPanelViewSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   310
		    #name: 'HorizontalPanelView'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   311
		    #layout: #(#LayoutFrame 3 0 76 0.691429 300 0 0 0.977143)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   312
		    #component: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   313
		     #(#SpecCollection
905c3b4ba565 revised
tz
parents: 769
diff changeset
   314
			#collection: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   315
			 #(
905c3b4ba565 revised
tz
parents: 769
diff changeset
   316
			   #(#LabelSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   317
			      #name: 'Label2'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   318
			      #label: 'Create: '
905c3b4ba565 revised
tz
parents: 769
diff changeset
   319
			      #adjust: #right
905c3b4ba565 revised
tz
parents: 769
diff changeset
   320
			      #extent: #(#Point 72 24)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   321
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   322
			   #(#ActionButtonSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   323
			      #name: 'CreateClassButton'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   324
			      #activeHelpKey: #dss
905c3b4ba565 revised
tz
parents: 769
diff changeset
   325
			      #label: 'Class'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   326
			      #model: #createClass:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   327
			      #actionValue: 'class'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   328
			      #extent: #(#Point 72 24)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   329
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   330
			   #(#ActionButtonSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   331
			      #name: 'CreateSubclassButton'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   332
			      #activeHelpKey: #dss
905c3b4ba565 revised
tz
parents: 769
diff changeset
   333
			      #label: 'Subclass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   334
			      #model: #createClass:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   335
			      #actionValue: 'subclass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   336
			      #extent: #(#Point 72 24)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   337
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   338
			   #(#ActionButtonSpec
905c3b4ba565 revised
tz
parents: 769
diff changeset
   339
			      #name: 'CreatePrivateClassButton'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   340
			      #activeHelpKey: #dss
905c3b4ba565 revised
tz
parents: 769
diff changeset
   341
			      #label: 'Private'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   342
			      #model: #createClass:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   343
			      #actionValue: 'private'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   344
			      #extent: #(#Point 72 24)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   345
			  )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   346
			)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   347
		    )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   348
		    #horizontalLayout: #fit
905c3b4ba565 revised
tz
parents: 769
diff changeset
   349
		    #verticalLayout: #fit
905c3b4ba565 revised
tz
parents: 769
diff changeset
   350
		)
905c3b4ba565 revised
tz
parents: 769
diff changeset
   351
	      )
905c3b4ba565 revised
tz
parents: 769
diff changeset
   352
	  )
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   353
      )
cf47d420764a initial checkin
tz
parents:
diff changeset
   354
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   355
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   356
!ResourceSelectionBrowser class methodsFor:'list specs'!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   357
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   358
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   359
    "returns the columns for the table of the resource methods"
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   360
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   361
  ^ #(#(#DataSetColumnSpec
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   362
      #width: 20
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   363
      #height: 20
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   364
      #printSelector: #iconOn:
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   365
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   366
  )
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   367
   #(#DataSetColumnSpec
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   368
      #label: ' Selector'
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   369
      #'labelAlignment:' #left
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   370
      #model: #selector
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   371
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   372
  )
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   373
   (#DataSetColumnSpec
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   374
      #label: ' Resource Type'
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   375
      #'labelAlignment:' #left
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   376
      #model: #resourceType
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   377
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   378
  ))
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   379
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   380
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   381
!ResourceSelectionBrowser methodsFor:'aspects'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   382
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   383
listOfResourceMethods
905c3b4ba565 revised
tz
parents: 769
diff changeset
   384
    "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
   385
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   386
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   387
    (holder := builder bindingAt:#listOfResourceMethods) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   388
	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
   389
    ].
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   390
    ^ holder
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   391
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   392
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   393
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   394
    "returns the columns for the table of the resource methods as value holder"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   395
cf47d420764a initial checkin
tz
parents:
diff changeset
   396
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   397
    (holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   398
	builder aspectAt:#resourceMethodColumns put:(holder := List new).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   399
	holder addAll: (self class resourceMethodColumns collect: [:i| i decodeAsLiteralArray]).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   400
    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   401
    ^ holder
905c3b4ba565 revised
tz
parents: 769
diff changeset
   402
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   403
905c3b4ba565 revised
tz
parents: 769
diff changeset
   404
rootOfClasses
905c3b4ba565 revised
tz
parents: 769
diff changeset
   405
    "returns the value holder for the root of the class tree list"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   406
905c3b4ba565 revised
tz
parents: 769
diff changeset
   407
    |holder|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   408
    (holder := builder bindingAt:#rootOfClasses) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   409
	builder aspectAt:#rootOfClasses put: (holder := SelectionInTree new root: TreeItem new)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   410
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   411
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   412
cf47d420764a initial checkin
tz
parents:
diff changeset
   413
cf47d420764a initial checkin
tz
parents:
diff changeset
   414
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   415
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   416
selectionOfClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   417
    "returns the value holder for the selected class of the class tree list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   418
cf47d420764a initial checkin
tz
parents:
diff changeset
   419
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   420
    (holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   421
	builder aspectAt:#selectionOfClass put:(holder :=  ValueHolder new).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   422
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   423
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   424
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   425
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   426
selectionOfResourceMethod
905c3b4ba565 revised
tz
parents: 769
diff changeset
   427
    "returns the value holder for the selected resource method of the resource method list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   428
cf47d420764a initial checkin
tz
parents:
diff changeset
   429
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   430
    (holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   431
	builder aspectAt:#selectionOfResourceMethod put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   432
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   433
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   434
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   435
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   436
valueOfClassName
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   437
    "returns the value holder for the name of the class"
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   438
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   439
    |holder|
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   440
    (holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   441
	builder aspectAt:#valueOfClassName put:(holder :=  '' asValue).
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   442
    ].
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   443
    ^ holder
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   444
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   445
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   446
valueOfResourceSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
   447
    "returns the value holder for the name of the selector"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   448
cf47d420764a initial checkin
tz
parents:
diff changeset
   449
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   450
    (holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   451
	builder aspectAt:#valueOfResourceSelector put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   452
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   453
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   454
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   455
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   456
!ResourceSelectionBrowser methodsFor:'callbacks - class list'!
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   457
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   458
treeViewContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   459
    "returns the contents of the root of the class tree list"
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   460
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   461
    ^(Smalltalk at: resourceSuperclass) ? self class treeViewContents
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   462
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   463
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   464
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   465
905c3b4ba565 revised
tz
parents: 769
diff changeset
   466
validateDoubleClick: aTreeItem
905c3b4ba565 revised
tz
parents: 769
diff changeset
   467
    "returns whether a class may be selected"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   468
905c3b4ba565 revised
tz
parents: 769
diff changeset
   469
    ^aTreeItem contents ~~ self treeViewContents
905c3b4ba565 revised
tz
parents: 769
diff changeset
   470
905c3b4ba565 revised
tz
parents: 769
diff changeset
   471
905c3b4ba565 revised
tz
parents: 769
diff changeset
   472
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   473
! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   474
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   475
!ResourceSelectionBrowser methodsFor:'callbacks - user'!
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   476
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   477
classSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   478
    "after a class selection, read the allowed resource methods of the selected class"
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   479
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   480
    (mayReadResources not or: [self selectionOfClass value isNil]) ifTrue: [^nil].
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   481
    self withWaitCursorDo:
cf47d420764a initial checkin
tz
parents:
diff changeset
   482
    [
cf47d420764a initial checkin
tz
parents:
diff changeset
   483
        |clsName|
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   484
        resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   485
        clsName := self selectionOfClass value name.
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   486
        self valueOfClassName value: clsName.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   487
        self class lastSelection: clsName.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   488
        self listOfResourceMethods contents:
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   489
            ((((Smalltalk at: clsName) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   490
                class methodDictionary
cf47d420764a initial checkin
tz
parents:
diff changeset
   491
                asOrderedCollection select: 
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   492
                    [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   493
             collect: [:m| (ResourceMethod new method: m)]).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   494
    ]
cf47d420764a initial checkin
tz
parents:
diff changeset
   495
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   496
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   497
createClass: what
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   498
    "creates a class, a subclass, or a private class of the selected class"
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   499
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   500
    |clsCandidat cls|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   501
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   502
    clsCandidat := self valueOfClassName value asSymbol.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   503
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   504
    (Smalltalk at: clsCandidat) notNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   505
	ifTrue: [^self warn: 'Cannot create class ', clsCandidat asBoldText,
905c3b4ba565 revised
tz
parents: 769
diff changeset
   506
		'!!\Key with that name in dictionary ' withCRs, 'Smalltalk' asBoldText, ' detected.'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   507
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   508
    cls := self selectionOfClass value contents.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   509
    what = 'class' ifTrue: [cls := cls superclass].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   510
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   511
    cls isNil ifTrue: [^self warn: 'May not create class with superclass ', 'nil' asBoldText, '!!'].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   512
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   513
    what = 'private' 
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   514
    ifFalse: 
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   515
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   516
	cls subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   517
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   518
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   519
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   520
	    category: cls category
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   521
    ]
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   522
    ifTrue:
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   523
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   524
	|superClsCandidate|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   525
	superClsCandidate := (Dialog 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   526
		request: 'Enter name of superclass of private class.'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   527
		initialAnswer: 'Object') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   528
	(Smalltalk at: superClsCandidate) isNil ifTrue: [^self warn: 'Class ', superClsCandidate asBoldText, ' does not exist!!'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   529
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   530
	((superClsCandidate := Smalltalk at: superClsCandidate) isClass and: [superClsCandidate isPrivate not])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   531
	    ifFalse: [^self warn: 'May not create private class with superclass ', superClsCandidate asBoldText, '!!'].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   532
	superClsCandidate subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   533
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   534
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   535
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   536
	    privateIn: cls
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   537
    ].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   538
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   539
    allClasses := Object withAllSubclasses.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   540
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   541
    what = 'class' 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   542
	ifTrue:  [self selectionOfClass value parent changed: #children]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   543
	ifFalse: [self selectionOfClass value changed: #children].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   544
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   545
    classSelectionBlock value: self valueOfClassName value 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   546
!
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   547
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   548
resourceDoubleClicked
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   549
    "after a double click on resource method, accept it and close"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   550
cf47d420764a initial checkin
tz
parents:
diff changeset
   551
    accept value: true.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   552
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   553
    self close
cf47d420764a initial checkin
tz
parents:
diff changeset
   554
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   555
cf47d420764a initial checkin
tz
parents:
diff changeset
   556
resourceSelected
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   557
    "after a click on a resource method, set its selector into the field"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   558
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   559
    self selectionOfResourceMethod value notNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   560
	ifTrue: [self valueOfResourceSelector value: self selectionOfResourceMethod value selector]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   561
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   562
cf47d420764a initial checkin
tz
parents:
diff changeset
   563
!ResourceSelectionBrowser methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   564
cf47d420764a initial checkin
tz
parents:
diff changeset
   565
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   566
    "opens a ResourceSelectionBrowser on 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   567
	aSuperclassOrSymbol, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   568
	and aClassOrSymbol, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   569
	and aSelector,
905c3b4ba565 revised
tz
parents: 769
diff changeset
   570
	with allowed aResourceTypes"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   571
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   572
    |clsName|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   573
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   574
    resourceMethod := aSelector.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   575
    resourceTypes := aResourceTypes.
cf47d420764a initial checkin
tz
parents:
diff changeset
   576
    resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol].
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   577
    resourceClass := aClassOrSymbol isClass 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   578
	ifTrue: [aClassOrSymbol name] 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   579
	ifFalse: [(Smalltalk at: aClassOrSymbol) notNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   580
	    ifTrue: [aClassOrSymbol]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   581
	    ifFalse: [nil]].            
905c3b4ba565 revised
tz
parents: 769
diff changeset
   582
    self valueOfResourceSelector value:(aSelector ? '').
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   583
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   584
    self open.
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   585
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   586
    (clsName := self selectionOfClass value) isNil ifTrue: [^nil].
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   587
    clsName := (clsName name upTo: $ ) asSymbol.
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   588
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   589
    ((Smalltalk at: clsName) isClass and: [accept value]) 
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   590
    ifTrue:
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   591
    [            
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   592
	^clsName, ' ', self valueOfResourceSelector value
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   593
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   594
    ^nil
cf47d420764a initial checkin
tz
parents:
diff changeset
   595
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   596
cf47d420764a initial checkin
tz
parents:
diff changeset
   597
!ResourceSelectionBrowser methodsFor:'startup / release'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   598
cf47d420764a initial checkin
tz
parents:
diff changeset
   599
closeCancel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   600
    "after a cancel, terminate readResourcesProcess"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   601
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   602
    readResourcesProcess notNil ifTrue: [readResourcesProcess terminate].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   603
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   604
    super closeCancel
cf47d420764a initial checkin
tz
parents:
diff changeset
   605
cf47d420764a initial checkin
tz
parents:
diff changeset
   606
cf47d420764a initial checkin
tz
parents:
diff changeset
   607
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   608
!
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   609
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   610
postBuildWith:aBuilder
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   611
    "after building and before opening,  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   612
     create a class selection block, an entry completion block for the class name field, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   613
     and select the class and the resource selector"
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   614
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   615
    |classSelection classNameInputField|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   616
905c3b4ba565 revised
tz
parents: 769
diff changeset
   617
    allClasses := self treeViewContents withAllSubclasses reject: [:cls| cls isPrivate].
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   618
    classSelection :=  resourceClass. 
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   619
    (Smalltalk at: classSelection) isNil 
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   620
        ifTrue: [classSelection :=  self class lastSelection].
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   621
    (Smalltalk at: classSelection) isNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   622
        ifTrue: [classSelection :=  self treeViewContents].
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   623
    classSelectionBlock := 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   624
    [:clsPattern|                                  
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   625
        |foundClass classes|         
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   626
        ((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   627
        [foundClass name ~= clsPattern])
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   628
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   629
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   630
            classes := allClasses select: [:cls| cls name size >= clsPattern size].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   631
            1 to: clsPattern size do: 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   632
            [:i|    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   633
                 classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   634
            ].    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   635
            foundClass := classes at: 1 ifAbsent: [nil] 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   636
        ].          
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   637
        foundClass notNil
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   638
        ifTrue:
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   639
        [
905c3b4ba565 revised
tz
parents: 769
diff changeset
   640
            |superClasses nonSuperclasses item|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   641
            superClasses := foundClass withAllSuperclasses reverse.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   642
            (nonSuperclasses := self treeViewContents allSuperclasses) notNil 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   643
                ifTrue: [superClasses := superClasses reject: [:cls| nonSuperclasses includes: cls]].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   644
            item := self rootOfClasses detectItem:[:child :arg| child contents == arg] arguments:superClasses.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   645
            item notNil ifTrue:[self selectionOfClass value:item]
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   646
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   647
        self valueOfClassName value: clsPattern
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   648
    ].
635
47ffd4e4f387 do select method row after opening
tz
parents: 632
diff changeset
   649
    self valueOfClassName value: classSelection.  
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   650
905c3b4ba565 revised
tz
parents: 769
diff changeset
   651
    (classNameInputField := builder componentAt: #classNameInputField) entryCompletionBlock:
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   652
    [:value|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   653
        |what|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   654
        what := Smalltalk classnameCompletion: value withoutSpaces.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   655
        classNameInputField contents:what first.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   656
        (what at:2) size ~~ 1 ifTrue:[Display beep].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   657
        classSelectionBlock value: classNameInputField contents
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   658
    ].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   659
905c3b4ba565 revised
tz
parents: 769
diff changeset
   660
    mayReadResources := false.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   661
    classSelectionBlock value: classSelection.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   662
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   663
    readResourcesProcess := 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   664
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   665
        mayReadResources := true.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   666
        self classSelected.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   667
        self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   668
        readResourcesProcess := nil.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   669
    ] forkAt: 4. 
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   670
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   671
    ^super postBuildWith:aBuilder
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   672
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   673
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   674
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   675
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'!
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   676
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   677
iconOn:aGC
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   678
    "registers and returns an icon indicating the resource type"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   679
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   680
    self resourceType isNil ifTrue: [^nil].
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   681
    icon isNil 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   682
    ifTrue: 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   683
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   684
	|cls sel image imageKey|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   685
	((self resourceType = #image) or: [resourceType = #fileImage])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   686
	ifTrue: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   687
	[  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   688
	    cls := method who methodClass soleInstance.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   689
	    sel := method who methodSelector.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   690
	]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   691
	ifFalse:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   692
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   693
	    cls := BrowserView.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   694
	    sel := (resourceType, 'Icon') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   695
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   696
	imageKey := (cls name, sel) asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   697
	(icon := aGC registeredImageAt: imageKey) isNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   698
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   699
	[       
905c3b4ba565 revised
tz
parents: 769
diff changeset
   700
	    image := cls perform: sel.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   701
	    image extent y > 18
905c3b4ba565 revised
tz
parents: 769
diff changeset
   702
	    ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   703
	    [         
905c3b4ba565 revised
tz
parents: 769
diff changeset
   704
		image := image magnifiedBy: 18/image extent y
905c3b4ba565 revised
tz
parents: 769
diff changeset
   705
	    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   706
	    aGC registerImage: image key: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   707
	    icon := aGC registeredImageAt: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   708
	].
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   709
    ].
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   710
    ^icon
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   711
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   712
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   713
method: aMethod
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   714
    "sets aMethod"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   715
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   716
    method := aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   717
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   718
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   719
resourceType
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   720
    "returns resourceType"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   721
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   722
    resourceType isNil ifTrue: [resourceType := method resourceType].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   723
    ^resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   724
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   725
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   726
selector
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   727
    "returns selector"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   728
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   729
    selector isNil ifTrue: [selector := method who methodSelector].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   730
    ^selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   731
! !
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   732
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   733
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   734
cf47d420764a initial checkin
tz
parents:
diff changeset
   735
version
cf47d420764a initial checkin
tz
parents:
diff changeset
   736
    ^ '$Header$'
cf47d420764a initial checkin
tz
parents:
diff changeset
   737
! !