ResourceSelectionBrowser.st
author tz
Wed, 13 May 1998 14:35:02 +0200
changeset 820 e967a1359d77
parent 812 c1c6844ddd57
child 821 950e6fbbc1f0
permissions -rw-r--r--
table columns formatted
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
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   114
    ^ Object
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   115
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   116
    "Modified: / 22.4.1998 / 14:44:11 / cg"
648
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
treeViewIcon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   120
    "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
   121
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   122
    ^[:aTreeItem|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   123
	|icon|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   124
	icon := self iconClass.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   125
	aTreeItem contents isPrivate 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   126
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   127
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   128
	   icon := self iconPrivateClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   129
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   130
	icon
905c3b4ba565 revised
tz
parents: 769
diff changeset
   131
    ]
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   132
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   133
!
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
treeViewLabel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   136
    "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
   137
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   138
    ^[:aTreeItem|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   139
	|label superCls|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   140
	label := aTreeItem contents name.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   141
	(aTreeItem contents isPrivate and: [aTreeItem parent contents ~~ (superCls := aTreeItem contents superclass)])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   142
	    ifTrue: [label := label, ' (', superCls name, ')'].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   143
	label
718
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   144
     ]
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   145
c2e814032029 show private classes only for their owning classes
tz
parents: 693
diff changeset
   146
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   147
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   148
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   149
!ResourceSelectionBrowser class methodsFor:'image specs'!
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   150
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   151
iconClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   152
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   153
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   154
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   155
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   156
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   157
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   158
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   159
     ImageEditor openOnClass:self andSelector:#iconClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   160
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   161
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   162
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   163
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   164
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   165
	constantNamed:#'ResourceSelectionBrowser iconClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   166
	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
   167
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   168
iconPrivateClass
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   169
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   170
     by the ImageEditor of ST/X."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   171
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   172
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   173
     the ImageEditor may not be able to read the specification."
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   174
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   175
    "
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   176
     ImageEditor openOnClass:self andSelector:#iconPrivateClass
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   177
    "
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   178
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   179
    <resource: #image>
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   180
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   181
    ^Icon
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   182
	constantNamed:#'ResourceSelectionBrowser iconPrivateClass'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   183
	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
   184
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   185
!ResourceSelectionBrowser class methodsFor:'interface specs'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   186
cf47d420764a initial checkin
tz
parents:
diff changeset
   187
windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   188
    "This resource specification was automatically generated
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   189
     by the UIPainter of ST/X."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   190
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   191
    "Do not manually edit this!! If it is corrupted,
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   192
     the UIPainter may not be able to read the specification."
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   193
cf47d420764a initial checkin
tz
parents:
diff changeset
   194
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   195
     UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec
cf47d420764a initial checkin
tz
parents:
diff changeset
   196
     ResourceSelectionBrowser new openInterface:#windowSpec
746
8b3532f50ea9 comment
tz
parents: 733
diff changeset
   197
     ResourceSelectionBrowser open
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   198
    "
cf47d420764a initial checkin
tz
parents:
diff changeset
   199
cf47d420764a initial checkin
tz
parents:
diff changeset
   200
    <resource: #canvas>
cf47d420764a initial checkin
tz
parents:
diff changeset
   201
cf47d420764a initial checkin
tz
parents:
diff changeset
   202
    ^
468
bb4e776b9210 levels changed
tz
parents: 467
diff changeset
   203
     
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   204
       #(#FullSpec
773
tz
parents: 771
diff changeset
   205
          #window: 
tz
parents: 771
diff changeset
   206
           #(#WindowSpec
tz
parents: 771
diff changeset
   207
              #name: 'Resource Selection Browser'
tz
parents: 771
diff changeset
   208
              #layout: #(#LayoutFrame 76 0 236 0 675 0 585 0)
tz
parents: 771
diff changeset
   209
              #label: 'Resource Selection Browser'
tz
parents: 771
diff changeset
   210
              #min: #(#Point 400 300)
tz
parents: 771
diff changeset
   211
              #max: #(#Point 1152 864)
tz
parents: 771
diff changeset
   212
              #bounds: #(#Rectangle 76 236 676 586)
tz
parents: 771
diff changeset
   213
              #usePreferredExtent: false
tz
parents: 771
diff changeset
   214
          )
tz
parents: 771
diff changeset
   215
          #component: 
tz
parents: 771
diff changeset
   216
           #(#SpecCollection
tz
parents: 771
diff changeset
   217
              #collection: 
tz
parents: 771
diff changeset
   218
               #(
tz
parents: 771
diff changeset
   219
                 #(#VariableHorizontalPanelSpec
tz
parents: 771
diff changeset
   220
                    #name: 'VariableHorizontalPanel'
tz
parents: 771
diff changeset
   221
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
tz
parents: 771
diff changeset
   222
                    #component: 
tz
parents: 771
diff changeset
   223
                     #(#SpecCollection
tz
parents: 771
diff changeset
   224
                        #collection: 
tz
parents: 771
diff changeset
   225
                         #(
tz
parents: 771
diff changeset
   226
                           #(#ViewSpec
tz
parents: 771
diff changeset
   227
                              #name: 'Box1'
tz
parents: 771
diff changeset
   228
                              #component: 
tz
parents: 771
diff changeset
   229
                               #(#SpecCollection
tz
parents: 771
diff changeset
   230
                                  #collection: 
tz
parents: 771
diff changeset
   231
                                   #(
tz
parents: 771
diff changeset
   232
                                     #(#LabelSpec
tz
parents: 771
diff changeset
   233
                                        #name: 'ClassHierarchyLabel'
tz
parents: 771
diff changeset
   234
                                        #layout: #(#LayoutFrame 0 0.0 2 0 0 1.0 23 0)
tz
parents: 771
diff changeset
   235
                                        #label: ' Class Hierarchy:'
tz
parents: 771
diff changeset
   236
                                        #level: 1
tz
parents: 771
diff changeset
   237
                                        #adjust: #left
tz
parents: 771
diff changeset
   238
                                    )
tz
parents: 771
diff changeset
   239
                                     #(#SelectionInTreeViewSpec
tz
parents: 771
diff changeset
   240
                                        #name: 'listOfClassesView'
tz
parents: 771
diff changeset
   241
                                        #layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -60 1.0)
tz
parents: 771
diff changeset
   242
                                        #tabable: true
tz
parents: 771
diff changeset
   243
                                        #model: #selectionOfClass
tz
parents: 771
diff changeset
   244
                                        #hasHorizontalScrollBar: true
tz
parents: 771
diff changeset
   245
                                        #hasVerticalScrollBar: true
tz
parents: 771
diff changeset
   246
                                        #miniScrollerHorizontal: true
tz
parents: 771
diff changeset
   247
                                        #showDirectoryIndicatorForRoot: false
tz
parents: 771
diff changeset
   248
                                        #showDirectoryIndicator: true
tz
parents: 771
diff changeset
   249
                                        #valueChangeSelector: #classSelected
tz
parents: 771
diff changeset
   250
                                        #hierarchicalList: #rootOfClasses
tz
parents: 771
diff changeset
   251
                                        #validateDoubleClickSelector: #validateDoubleClick:
tz
parents: 771
diff changeset
   252
                                        #contentsSelector: #treeViewContents
tz
parents: 771
diff changeset
   253
                                        #labelSelector: #treeViewLabel
tz
parents: 771
diff changeset
   254
                                        #childrenSelector: #treeViewChildren
tz
parents: 771
diff changeset
   255
                                        #iconSelector: #treeViewIcon
tz
parents: 771
diff changeset
   256
                                    )
tz
parents: 771
diff changeset
   257
                                     #(#InputFieldSpec
tz
parents: 771
diff changeset
   258
                                        #name: 'classNameInputField'
tz
parents: 771
diff changeset
   259
                                        #layout: #(#LayoutFrame 2 0.0 -58 1 -1 1.0 -36 1)
tz
parents: 771
diff changeset
   260
                                        #tabable: true
tz
parents: 771
diff changeset
   261
                                        #model: #valueOfClassName
tz
parents: 771
diff changeset
   262
                                    )
tz
parents: 771
diff changeset
   263
                                     #(#HorizontalPanelViewSpec
tz
parents: 771
diff changeset
   264
                                        #name: 'HorizontalPanelView'
tz
parents: 771
diff changeset
   265
                                        #layout: #(#LayoutFrame 0 0.0 -28 1 0 1.0 -4 1)
tz
parents: 771
diff changeset
   266
                                        #component: 
tz
parents: 771
diff changeset
   267
                                         #(#SpecCollection
tz
parents: 771
diff changeset
   268
                                            #collection: 
tz
parents: 771
diff changeset
   269
                                             #(
tz
parents: 771
diff changeset
   270
                                               #(#LabelSpec
tz
parents: 771
diff changeset
   271
                                                  #name: 'CreateLabel'
tz
parents: 771
diff changeset
   272
                                                  #label: 'Create: '
tz
parents: 771
diff changeset
   273
                                                  #adjust: #right
tz
parents: 771
diff changeset
   274
                                                  #extent: #(#Point 72 24)
tz
parents: 771
diff changeset
   275
                                              )
tz
parents: 771
diff changeset
   276
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   277
                                                  #name: 'CreateClassButton'
tz
parents: 771
diff changeset
   278
                                                  #activeHelpKey: #dss
tz
parents: 771
diff changeset
   279
                                                  #label: 'Class'
tz
parents: 771
diff changeset
   280
                                                  #model: #createClass:
tz
parents: 771
diff changeset
   281
                                                  #actionValue: 'class'
tz
parents: 771
diff changeset
   282
                                                  #extent: #(#Point 72 24)
tz
parents: 771
diff changeset
   283
                                              )
tz
parents: 771
diff changeset
   284
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   285
                                                  #name: 'CreateSubclassButton'
tz
parents: 771
diff changeset
   286
                                                  #activeHelpKey: #dss
tz
parents: 771
diff changeset
   287
                                                  #label: 'Subclass'
tz
parents: 771
diff changeset
   288
                                                  #model: #createClass:
tz
parents: 771
diff changeset
   289
                                                  #actionValue: 'subclass'
tz
parents: 771
diff changeset
   290
                                                  #extent: #(#Point 72 24)
tz
parents: 771
diff changeset
   291
                                              )
tz
parents: 771
diff changeset
   292
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   293
                                                  #name: 'CreatePrivateClassButton'
tz
parents: 771
diff changeset
   294
                                                  #activeHelpKey: #dss
tz
parents: 771
diff changeset
   295
                                                  #label: 'Private'
tz
parents: 771
diff changeset
   296
                                                  #model: #createClass:
tz
parents: 771
diff changeset
   297
                                                  #actionValue: 'private'
tz
parents: 771
diff changeset
   298
                                                  #extent: #(#Point 73 24)
tz
parents: 771
diff changeset
   299
                                              )
tz
parents: 771
diff changeset
   300
                                            )
tz
parents: 771
diff changeset
   301
                                        )
tz
parents: 771
diff changeset
   302
                                        #horizontalLayout: #fit
tz
parents: 771
diff changeset
   303
                                        #verticalLayout: #fit
tz
parents: 771
diff changeset
   304
                                    )
tz
parents: 771
diff changeset
   305
                                  )
tz
parents: 771
diff changeset
   306
                              )
tz
parents: 771
diff changeset
   307
                          )
tz
parents: 771
diff changeset
   308
                           #(#ViewSpec
tz
parents: 771
diff changeset
   309
                              #name: 'Box2'
tz
parents: 771
diff changeset
   310
                              #component: 
tz
parents: 771
diff changeset
   311
                               #(#SpecCollection
tz
parents: 771
diff changeset
   312
                                  #collection: 
tz
parents: 771
diff changeset
   313
                                   #(
tz
parents: 771
diff changeset
   314
                                     #(#DataSetSpec
tz
parents: 771
diff changeset
   315
                                        #name: 'resourcesDataSetView'
tz
parents: 771
diff changeset
   316
                                        #layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -60 1.0)
tz
parents: 771
diff changeset
   317
                                        #model: #selectionOfResourceMethod
tz
parents: 771
diff changeset
   318
                                        #hasHorizontalScrollBar: true
tz
parents: 771
diff changeset
   319
                                        #hasVerticalScrollBar: true
tz
parents: 771
diff changeset
   320
                                        #miniScrollerHorizontal: true
tz
parents: 771
diff changeset
   321
                                        #rowClassName: 'ResourceSelectionBrowser::Row'
tz
parents: 771
diff changeset
   322
                                        #dataList: #listOfResourceMethods
tz
parents: 771
diff changeset
   323
                                        #useIndex: false
tz
parents: 771
diff changeset
   324
                                        #has3Dsepartors: true
tz
parents: 771
diff changeset
   325
                                        #doubleClickSelector: #resourceDoubleClicked
tz
parents: 771
diff changeset
   326
                                        #columnHolder: #resourceMethodColumns
tz
parents: 771
diff changeset
   327
                                        #valueChangeSelector: #resourceSelected
tz
parents: 771
diff changeset
   328
                                        #verticalSpacing: 1
tz
parents: 771
diff changeset
   329
                                    )
tz
parents: 771
diff changeset
   330
                                     #(#InputFieldSpec
tz
parents: 771
diff changeset
   331
                                        #name: 'selectorInputField'
tz
parents: 771
diff changeset
   332
                                        #layout: #(#LayoutFrame 2 0.0 -58 1 -2 1.0 -36 1)
tz
parents: 771
diff changeset
   333
                                        #tabable: true
tz
parents: 771
diff changeset
   334
                                        #model: #valueOfResourceSelector
tz
parents: 771
diff changeset
   335
                                    )
tz
parents: 771
diff changeset
   336
                                     #(#HorizontalPanelViewSpec
tz
parents: 771
diff changeset
   337
                                        #name: 'HorizontalPanel1'
tz
parents: 771
diff changeset
   338
                                        #layout: #(#LayoutFrame 2 0.0 -28 1 -2 1.0 -4 1.0)
tz
parents: 771
diff changeset
   339
                                        #component: 
tz
parents: 771
diff changeset
   340
                                         #(#SpecCollection
tz
parents: 771
diff changeset
   341
                                            #collection: 
tz
parents: 771
diff changeset
   342
                                             #(
tz
parents: 771
diff changeset
   343
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   344
                                                  #name: 'HelpButton'
tz
parents: 771
diff changeset
   345
                                                  #activeHelpKey: #dss
tz
parents: 771
diff changeset
   346
                                                  #label: 'Help'
tz
parents: 771
diff changeset
   347
                                                  #model: #openHTMLDocument:
tz
parents: 771
diff changeset
   348
                                                  #initiallyDisabled: true
tz
parents: 771
diff changeset
   349
                                                  #enableChannel: #helpEnabled
tz
parents: 771
diff changeset
   350
                                                  #actionValue: 'tools/uipainter/ResourceSelectionBrowser.html'
tz
parents: 771
diff changeset
   351
                                                  #extent: #(#Point 96 24)
tz
parents: 771
diff changeset
   352
                                              )
tz
parents: 771
diff changeset
   353
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   354
                                                  #name: 'cancelButton'
tz
parents: 771
diff changeset
   355
                                                  #activeHelpKey: #commitCancel
tz
parents: 771
diff changeset
   356
                                                  #label: 'Cancel'
tz
parents: 771
diff changeset
   357
                                                  #tabable: true
tz
parents: 771
diff changeset
   358
                                                  #model: #cancel
tz
parents: 771
diff changeset
   359
                                                  #extent: #(#Point 96 24)
tz
parents: 771
diff changeset
   360
                                              )
tz
parents: 771
diff changeset
   361
                                               #(#ActionButtonSpec
tz
parents: 771
diff changeset
   362
                                                  #name: 'okButton'
tz
parents: 771
diff changeset
   363
                                                  #activeHelpKey: #commitOK
tz
parents: 771
diff changeset
   364
                                                  #label: 'OK'
tz
parents: 771
diff changeset
   365
                                                  #tabable: true
tz
parents: 771
diff changeset
   366
                                                  #model: #accept
tz
parents: 771
diff changeset
   367
                                                  #isDefault: true
tz
parents: 771
diff changeset
   368
                                                  #extent: #(#Point 96 24)
tz
parents: 771
diff changeset
   369
                                              )
tz
parents: 771
diff changeset
   370
                                            )
tz
parents: 771
diff changeset
   371
                                        )
tz
parents: 771
diff changeset
   372
                                        #horizontalLayout: #fit
tz
parents: 771
diff changeset
   373
                                        #verticalLayout: #fit
tz
parents: 771
diff changeset
   374
                                    )
tz
parents: 771
diff changeset
   375
                                  )
tz
parents: 771
diff changeset
   376
                              )
tz
parents: 771
diff changeset
   377
                          )
tz
parents: 771
diff changeset
   378
                        )
tz
parents: 771
diff changeset
   379
                    )
tz
parents: 771
diff changeset
   380
                    #handles: #(#Any 0.5 1.0)
tz
parents: 771
diff changeset
   381
                )
tz
parents: 771
diff changeset
   382
              )
tz
parents: 771
diff changeset
   383
          )
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   384
      )
cf47d420764a initial checkin
tz
parents:
diff changeset
   385
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   386
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   387
!ResourceSelectionBrowser class methodsFor:'list specs'!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   388
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   389
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   390
    "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
   391
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   392
  ^ #(#(#DataSetColumnSpec
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   393
      #width: 20
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   394
      #height: 20
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   395
      #printSelector: #iconOn:
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   396
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   397
  )
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   398
   #(#DataSetColumnSpec
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   399
      #label: ' Selector'
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   400
      #'labelAlignment:' #left
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   401
      #model: #selector
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   402
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   403
  )
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   404
   (#DataSetColumnSpec
649
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   405
      #label: ' Resource Type'
1896945cf5d4 some cleans
tz
parents: 648
diff changeset
   406
      #'labelAlignment:' #left
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   407
      #model: #resourceType
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   408
      #canSelect: false
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   409
  ))
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   410
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   411
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   412
!ResourceSelectionBrowser methodsFor:'aspects'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   413
773
tz
parents: 771
diff changeset
   414
helpEnabled
tz
parents: 771
diff changeset
   415
    "returns whether there is a documentation file"
tz
parents: 771
diff changeset
   416
tz
parents: 771
diff changeset
   417
    ^true
tz
parents: 771
diff changeset
   418
!
tz
parents: 771
diff changeset
   419
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   420
listOfResourceMethods
905c3b4ba565 revised
tz
parents: 769
diff changeset
   421
    "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
   422
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   423
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   424
    (holder := builder bindingAt:#listOfResourceMethods) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   425
	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
   426
    ].
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   427
    ^ holder
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   428
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   429
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   430
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   431
    "returns the columns for the table of the resource methods as value holder"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   432
cf47d420764a initial checkin
tz
parents:
diff changeset
   433
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   434
    (holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   435
	builder aspectAt:#resourceMethodColumns put:(holder := List new).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   436
	holder addAll: (self class resourceMethodColumns collect: [:i| i decodeAsLiteralArray]).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   437
    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   438
    ^ holder
905c3b4ba565 revised
tz
parents: 769
diff changeset
   439
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   440
905c3b4ba565 revised
tz
parents: 769
diff changeset
   441
rootOfClasses
905c3b4ba565 revised
tz
parents: 769
diff changeset
   442
    "returns the value holder for the root of the class tree list"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   443
905c3b4ba565 revised
tz
parents: 769
diff changeset
   444
    |holder|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   445
    (holder := builder bindingAt:#rootOfClasses) isNil ifTrue:[
786
17a84830f0ee unsolved model problems
tz
parents: 773
diff changeset
   446
        builder aspectAt:#rootOfClasses put: (holder := TreeItem new)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   447
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   448
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   449
cf47d420764a initial checkin
tz
parents:
diff changeset
   450
cf47d420764a initial checkin
tz
parents:
diff changeset
   451
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   452
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   453
selectionOfClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   454
    "returns the value holder for the selected class of the class tree list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   455
cf47d420764a initial checkin
tz
parents:
diff changeset
   456
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   457
    (holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   458
	builder aspectAt:#selectionOfClass put:(holder :=  ValueHolder new).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   459
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   460
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   461
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   462
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   463
selectionOfResourceMethod
905c3b4ba565 revised
tz
parents: 769
diff changeset
   464
    "returns the value holder for the selected resource method of the resource method list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   465
cf47d420764a initial checkin
tz
parents:
diff changeset
   466
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   467
    (holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   468
	builder aspectAt:#selectionOfResourceMethod put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   469
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   470
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   471
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   472
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   473
valueOfClassName
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   474
    "returns the value holder for the name of the class"
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   475
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   476
    |holder|
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   477
    (holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   478
	builder aspectAt:#valueOfClassName put:(holder :=  '' asValue).
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   479
    ].
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   480
    ^ holder
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   481
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   482
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   483
valueOfResourceSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
   484
    "returns the value holder for the name of the selector"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   485
cf47d420764a initial checkin
tz
parents:
diff changeset
   486
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   487
    (holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   488
	builder aspectAt:#valueOfResourceSelector put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   489
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   490
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   491
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   492
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   493
!ResourceSelectionBrowser methodsFor:'callbacks - class list'!
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   494
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   495
treeViewContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   496
    "returns the contents of the root of the class tree list"
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   497
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   498
    |cls|
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   499
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   500
    resourceSuperclass notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   501
        cls := Smalltalk at: resourceSuperclass.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   502
    ].
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   503
    ^ cls ? self class treeViewContents
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   504
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   505
    "Modified: / 22.4.1998 / 14:43:19 / cg"
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   506
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   507
905c3b4ba565 revised
tz
parents: 769
diff changeset
   508
validateDoubleClick: aTreeItem
905c3b4ba565 revised
tz
parents: 769
diff changeset
   509
    "returns whether a class may be selected"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   510
905c3b4ba565 revised
tz
parents: 769
diff changeset
   511
    ^aTreeItem contents ~~ self treeViewContents
905c3b4ba565 revised
tz
parents: 769
diff changeset
   512
905c3b4ba565 revised
tz
parents: 769
diff changeset
   513
905c3b4ba565 revised
tz
parents: 769
diff changeset
   514
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   515
! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   516
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   517
!ResourceSelectionBrowser methodsFor:'callbacks - user'!
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   518
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   519
classSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   520
    "after a class selection, read the allowed resource methods of the selected class"
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   521
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   522
    (mayReadResources not or: [self selectionOfClass value isNil]) ifTrue: [^nil].
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   523
    self withWaitCursorDo:
cf47d420764a initial checkin
tz
parents:
diff changeset
   524
    [
cf47d420764a initial checkin
tz
parents:
diff changeset
   525
        |clsName|
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   526
        resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
789
ee325d04f292 do not show the braces
tz
parents: 786
diff changeset
   527
        clsName := (self selectionOfClass value name upTo: $ ) asSymbol.
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   528
        self valueOfClassName value: clsName.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   529
        self class lastSelection: clsName.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   530
        self listOfResourceMethods contents:
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   531
            ((((Smalltalk at: clsName) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   532
                class methodDictionary
cf47d420764a initial checkin
tz
parents:
diff changeset
   533
                asOrderedCollection select: 
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   534
                    [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   535
             collect: [:m| (ResourceMethod new method: m)]).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   536
    ]
cf47d420764a initial checkin
tz
parents:
diff changeset
   537
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   538
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   539
createClass: what
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   540
    "creates a class, a subclass, or a private class of the selected class"
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   541
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   542
    |clsCandidat cls|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   543
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   544
    clsCandidat := self valueOfClassName value asSymbol.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   545
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   546
    (Smalltalk at: clsCandidat) notNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   547
	ifTrue: [^self warn: 'Cannot create class ', clsCandidat asBoldText,
905c3b4ba565 revised
tz
parents: 769
diff changeset
   548
		'!!\Key with that name in dictionary ' withCRs, 'Smalltalk' asBoldText, ' detected.'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   549
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   550
    cls := self selectionOfClass value contents.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   551
    what = 'class' ifTrue: [cls := cls superclass].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   552
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   553
    cls isNil ifTrue: [^self warn: 'May not create class with superclass ', 'nil' asBoldText, '!!'].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   554
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   555
    what = 'private' 
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   556
    ifFalse: 
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   557
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   558
	cls subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   559
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   560
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   561
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   562
	    category: cls category
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   563
    ]
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   564
    ifTrue:
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   565
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   566
	|superClsCandidate|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   567
	superClsCandidate := (Dialog 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   568
		request: 'Enter name of superclass of private class.'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   569
		initialAnswer: 'Object') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   570
	(Smalltalk at: superClsCandidate) isNil ifTrue: [^self warn: 'Class ', superClsCandidate asBoldText, ' does not exist!!'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   571
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   572
	((superClsCandidate := Smalltalk at: superClsCandidate) isClass and: [superClsCandidate isPrivate not])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   573
	    ifFalse: [^self warn: 'May not create private class with superclass ', superClsCandidate asBoldText, '!!'].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   574
	superClsCandidate subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   575
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   576
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   577
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   578
	    privateIn: cls
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   579
    ].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   580
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   581
    allClasses := Object withAllSubclasses.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   582
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   583
    what = 'class' 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   584
	ifTrue:  [self selectionOfClass value parent changed: #children]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   585
	ifFalse: [self selectionOfClass value changed: #children].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   586
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   587
    classSelectionBlock value: self valueOfClassName value 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   588
!
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   589
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   590
resourceDoubleClicked
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   591
    "after a double click on resource method, accept it and close"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   592
cf47d420764a initial checkin
tz
parents:
diff changeset
   593
    accept value: true.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   594
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   595
    self close
cf47d420764a initial checkin
tz
parents:
diff changeset
   596
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   597
cf47d420764a initial checkin
tz
parents:
diff changeset
   598
resourceSelected
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   599
    "after a click on a resource method, set its selector into the field"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   600
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   601
    self selectionOfResourceMethod value notNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   602
	ifTrue: [self valueOfResourceSelector value: self selectionOfResourceMethod value selector]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   603
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   604
cf47d420764a initial checkin
tz
parents:
diff changeset
   605
!ResourceSelectionBrowser methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   606
cf47d420764a initial checkin
tz
parents:
diff changeset
   607
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   608
    "opens a ResourceSelectionBrowser on 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   609
        aSuperclassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   610
        and aClassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   611
        and aSelector,
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   612
        with allowed aResourceTypes"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   613
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   614
    |clsName|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   615
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   616
    resourceMethod := aSelector.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   617
    resourceTypes := aResourceTypes.
cf47d420764a initial checkin
tz
parents:
diff changeset
   618
    resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   619
    resourceClass := nil.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   620
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   621
    aClassOrSymbol isClass 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   622
        ifTrue: [resourceClass := aClassOrSymbol name] 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   623
        ifFalse: [
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   624
            aClassOrSymbol notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   625
                (Smalltalk at: aClassOrSymbol) notNil
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   626
                ifTrue: [resourceClass := aClassOrSymbol]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   627
            ]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   628
        ].            
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   629
    self valueOfResourceSelector value:(aSelector ? '').
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   630
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   631
    self open.
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   632
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   633
    (clsName := self selectionOfClass value) isNil ifTrue: [^nil].
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   634
    clsName := (clsName name upTo: $ ) asSymbol.
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   635
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   636
    ((Smalltalk at: clsName) isClass and: [accept value]) 
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   637
    ifTrue:
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   638
    [            
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   639
        ^clsName, ' ', self valueOfResourceSelector value
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   640
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   641
    ^nil
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   642
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   643
    "Modified: / 22.4.1998 / 14:51:03 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   644
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   645
cf47d420764a initial checkin
tz
parents:
diff changeset
   646
!ResourceSelectionBrowser methodsFor:'startup / release'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   647
cf47d420764a initial checkin
tz
parents:
diff changeset
   648
closeCancel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   649
    "after a cancel, terminate readResourcesProcess"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   650
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   651
    readResourcesProcess notNil ifTrue: [readResourcesProcess terminate].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   652
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   653
    super closeCancel
cf47d420764a initial checkin
tz
parents:
diff changeset
   654
cf47d420764a initial checkin
tz
parents:
diff changeset
   655
cf47d420764a initial checkin
tz
parents:
diff changeset
   656
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   657
!
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   658
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   659
postBuildWith:aBuilder
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   660
    "after building and before opening,  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   661
     create a class selection block, an entry completion block for the class name field, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   662
     and select the class and the resource selector"
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   663
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   664
    |classSelection classNameInputField|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   665
905c3b4ba565 revised
tz
parents: 769
diff changeset
   666
    allClasses := self treeViewContents withAllSubclasses reject: [:cls| cls isPrivate].
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   667
    classSelection :=  resourceClass. 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   668
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   669
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   670
        ifTrue: [classSelection :=  self class lastSelection].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   671
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   672
        ifTrue: [classSelection :=  self treeViewContents].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   673
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   674
    classSelectionBlock := 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   675
    [:clsPattern|                                  
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   676
        |foundClass classes|  
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   677
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   678
        clsPattern notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   679
            foundClass := Smalltalk at:(clsPattern printString asSymbol).
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   680
        ].
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   681
        (foundClass isClass not or:[foundClass name ~= clsPattern])
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   682
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   683
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   684
            classes := allClasses select: [:cls| cls name size >= clsPattern size].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   685
            1 to: clsPattern size do: 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   686
            [:i|    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   687
                 classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   688
            ].    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   689
            foundClass := classes at: 1 ifAbsent: [nil] 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   690
        ].          
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   691
        foundClass notNil
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   692
        ifTrue:
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   693
        [
905c3b4ba565 revised
tz
parents: 769
diff changeset
   694
            |superClasses nonSuperclasses item|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   695
            superClasses := foundClass withAllSuperclasses reverse.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   696
            (nonSuperclasses := self treeViewContents allSuperclasses) notNil 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   697
                ifTrue: [superClasses := superClasses reject: [:cls| nonSuperclasses includes: cls]].
786
17a84830f0ee unsolved model problems
tz
parents: 773
diff changeset
   698
            item := self rootOfClasses detectChild:[:child :arg| child contents == arg] arguments:superClasses.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   699
            item notNil ifTrue:[self selectionOfClass value:item]
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   700
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   701
        self valueOfClassName value: clsPattern
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   702
    ].
635
47ffd4e4f387 do select method row after opening
tz
parents: 632
diff changeset
   703
    self valueOfClassName value: classSelection.  
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   704
905c3b4ba565 revised
tz
parents: 769
diff changeset
   705
    (classNameInputField := builder componentAt: #classNameInputField) entryCompletionBlock:
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   706
    [:value|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   707
        |what|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   708
        what := Smalltalk classnameCompletion: value withoutSpaces.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   709
        classNameInputField contents:what first.
812
c1c6844ddd57 dont access Display directly
Claus Gittinger <cg@exept.de>
parents: 802
diff changeset
   710
        (what at:2) size ~~ 1 ifTrue:[Screen current beep].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   711
        classSelectionBlock value: classNameInputField contents
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   712
    ].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   713
905c3b4ba565 revised
tz
parents: 769
diff changeset
   714
    mayReadResources := false.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   715
    classSelectionBlock value: classSelection.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   716
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   717
    readResourcesProcess := 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   718
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   719
        mayReadResources := true.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   720
        self classSelected.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   721
        self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   722
        readResourcesProcess := nil.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   723
    ] forkAt: 4. 
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   724
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   725
    ^super postBuildWith:aBuilder
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   726
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   727
    "Modified: / 22.4.1998 / 14:48:22 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   728
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   729
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   730
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'!
523
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
iconOn:aGC
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   733
    "registers and returns an icon indicating the resource type"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   734
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   735
    self resourceType isNil ifTrue: [^nil].
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   736
    icon isNil 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   737
    ifTrue: 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   738
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   739
	|cls sel image imageKey|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   740
	((self resourceType = #image) or: [resourceType = #fileImage])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   741
	ifTrue: 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   742
	[  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   743
	    cls := method who methodClass soleInstance.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   744
	    sel := method who methodSelector.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   745
	]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   746
	ifFalse:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   747
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   748
	    cls := BrowserView.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   749
	    sel := (resourceType, 'Icon') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   750
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   751
	imageKey := (cls name, sel) asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   752
	(icon := aGC registeredImageAt: imageKey) isNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   753
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   754
	[       
905c3b4ba565 revised
tz
parents: 769
diff changeset
   755
	    image := cls perform: sel.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   756
	    image extent y > 18
905c3b4ba565 revised
tz
parents: 769
diff changeset
   757
	    ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   758
	    [         
905c3b4ba565 revised
tz
parents: 769
diff changeset
   759
		image := image magnifiedBy: 18/image extent y
905c3b4ba565 revised
tz
parents: 769
diff changeset
   760
	    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   761
	    aGC registerImage: image key: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   762
	    icon := aGC registeredImageAt: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   763
	].
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   764
    ].
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   765
    ^icon
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   766
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   767
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   768
method: aMethod
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   769
    "sets aMethod"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   770
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   771
    method := aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   772
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   773
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   774
resourceType
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   775
    "returns resourceType"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   776
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   777
    resourceType isNil ifTrue: [resourceType := method resourceType].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   778
    ^resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   779
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   780
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   781
selector
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   782
    "returns selector"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   783
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   784
    selector isNil ifTrue: [selector := method who methodSelector].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   785
    ^selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   786
! !
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   787
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   788
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   789
cf47d420764a initial checkin
tz
parents:
diff changeset
   790
version
cf47d420764a initial checkin
tz
parents:
diff changeset
   791
    ^ '$Header$'
cf47d420764a initial checkin
tz
parents:
diff changeset
   792
! !