ResourceSelectionBrowser.st
author tz
Mon, 29 Jun 1998 17:01:33 +0200
changeset 883 10afc79658a6
parent 867 1ba402cdb5be
child 906 8be0b8d1a2fd
permissions -rw-r--r--
images moved to class Icon
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
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   389
tableColumnsForResourceMethodAttributes
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   390
    "This resource specification was automatically generated
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   391
     by the DataSetBuilder of ST/X."
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   392
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   393
    "Do not manually edit this!! If it is corrupted,
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   394
     the DataSetBuilder may not be able to read the specification."
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   395
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   396
    "
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   397
     DataSetBuilder new openOnClass:ResourceSelectionBrowser andSelector:#tableColumnsForResourceMethodAttributes
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   398
    "
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   399
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   400
    <resource: #tableColumns>
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   401
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   402
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   403
    ^ #(
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   404
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   405
           #width: 20
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   406
           #height: 20
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   407
           #printSelector: #iconOn:
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   408
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   409
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   410
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   411
           #label: ' Selector'
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   412
           #labelAlignment: #left
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   413
           #model: #selector
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   414
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   415
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   416
        #(#DataSetColumnSpec
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   417
           #label: ' Resource Type'
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   418
           #labelAlignment: #left
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   419
           #model: #resourceType
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   420
           #canSelect: false
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   421
       )
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   422
     )
648
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   423
! !
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   424
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   425
!ResourceSelectionBrowser methodsFor:'aspects'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   426
773
tz
parents: 771
diff changeset
   427
helpEnabled
tz
parents: 771
diff changeset
   428
    "returns whether there is a documentation file"
tz
parents: 771
diff changeset
   429
tz
parents: 771
diff changeset
   430
    ^true
tz
parents: 771
diff changeset
   431
!
tz
parents: 771
diff changeset
   432
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   433
listOfResourceMethods
905c3b4ba565 revised
tz
parents: 769
diff changeset
   434
    "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
   435
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   436
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   437
    (holder := builder bindingAt:#listOfResourceMethods) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   438
	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
   439
    ].
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   440
    ^ holder
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   441
!
d0724edba450 some changes for the lib builder and for its new subclass
tz
parents: 641
diff changeset
   442
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   443
resourceMethodColumns
905c3b4ba565 revised
tz
parents: 769
diff changeset
   444
    "returns the columns for the table of the resource methods as value holder"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   445
cf47d420764a initial checkin
tz
parents:
diff changeset
   446
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   447
    (holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[
821
950e6fbbc1f0 table columns formatted
tz
parents: 812
diff changeset
   448
        builder aspectAt:#resourceMethodColumns put:(holder := List new).
822
be574ef48217 checkin from browser
tz
parents: 821
diff changeset
   449
        holder addAll: (self class tableColumnsForResourceMethodAttributes collect: [:i| i decodeAsLiteralArray]).
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   450
    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   451
    ^ holder
905c3b4ba565 revised
tz
parents: 769
diff changeset
   452
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   453
905c3b4ba565 revised
tz
parents: 769
diff changeset
   454
rootOfClasses
905c3b4ba565 revised
tz
parents: 769
diff changeset
   455
    "returns the value holder for the root of the class tree list"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   456
905c3b4ba565 revised
tz
parents: 769
diff changeset
   457
    |holder|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   458
    (holder := builder bindingAt:#rootOfClasses) isNil ifTrue:[
786
17a84830f0ee unsolved model problems
tz
parents: 773
diff changeset
   459
        builder aspectAt:#rootOfClasses put: (holder := TreeItem new)
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   460
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   461
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   462
cf47d420764a initial checkin
tz
parents:
diff changeset
   463
cf47d420764a initial checkin
tz
parents:
diff changeset
   464
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   465
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   466
selectionOfClass
905c3b4ba565 revised
tz
parents: 769
diff changeset
   467
    "returns the value holder for the selected class of the class tree list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   468
cf47d420764a initial checkin
tz
parents:
diff changeset
   469
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   470
    (holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   471
	builder aspectAt:#selectionOfClass put:(holder :=  ValueHolder new).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   472
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   473
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   474
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   475
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   476
selectionOfResourceMethod
905c3b4ba565 revised
tz
parents: 769
diff changeset
   477
    "returns the value holder for the selected resource method of the resource method list"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   478
cf47d420764a initial checkin
tz
parents:
diff changeset
   479
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   480
    (holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   481
	builder aspectAt:#selectionOfResourceMethod put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   482
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   483
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   484
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   485
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   486
valueOfClassName
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   487
    "returns the value holder for the name of the class"
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   488
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   489
    |holder|
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   490
    (holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   491
	builder aspectAt:#valueOfClassName put:(holder :=  '' asValue).
467
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   492
    ].
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   493
    ^ holder
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   494
!
ddb605aaf94a class retrieval support added
tz
parents: 463
diff changeset
   495
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   496
valueOfResourceSelector
905c3b4ba565 revised
tz
parents: 769
diff changeset
   497
    "returns the value holder for the name of the selector"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   498
cf47d420764a initial checkin
tz
parents:
diff changeset
   499
    |holder|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   500
    (holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   501
	builder aspectAt:#valueOfResourceSelector put:(holder :=  '' asValue).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   502
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   503
    ^ holder
cf47d420764a initial checkin
tz
parents:
diff changeset
   504
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   505
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   506
!ResourceSelectionBrowser methodsFor:'callbacks - class list'!
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   507
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   508
treeViewContents
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   509
    "returns the contents of the root of the class tree list"
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   510
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   511
    |cls|
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   512
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   513
    resourceSuperclass notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   514
        cls := Smalltalk at: resourceSuperclass.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   515
    ].
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   516
    ^ cls ? self class treeViewContents
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   517
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   518
    "Modified: / 22.4.1998 / 14:43:19 / cg"
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   519
!
905c3b4ba565 revised
tz
parents: 769
diff changeset
   520
905c3b4ba565 revised
tz
parents: 769
diff changeset
   521
validateDoubleClick: aTreeItem
905c3b4ba565 revised
tz
parents: 769
diff changeset
   522
    "returns whether a class may be selected"
905c3b4ba565 revised
tz
parents: 769
diff changeset
   523
905c3b4ba565 revised
tz
parents: 769
diff changeset
   524
    ^aTreeItem contents ~~ self treeViewContents
905c3b4ba565 revised
tz
parents: 769
diff changeset
   525
905c3b4ba565 revised
tz
parents: 769
diff changeset
   526
905c3b4ba565 revised
tz
parents: 769
diff changeset
   527
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   528
! !
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   529
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   530
!ResourceSelectionBrowser methodsFor:'callbacks - user'!
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   531
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   532
classSelected
905c3b4ba565 revised
tz
parents: 769
diff changeset
   533
    "after a class selection, read the allowed resource methods of the selected class"
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   534
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   535
    (mayReadResources not or: [self selectionOfClass value isNil]) ifTrue: [^nil].
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   536
    self withWaitCursorDo:
cf47d420764a initial checkin
tz
parents:
diff changeset
   537
    [
cf47d420764a initial checkin
tz
parents:
diff changeset
   538
        |clsName|
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   539
        resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes].
789
ee325d04f292 do not show the braces
tz
parents: 786
diff changeset
   540
        clsName := (self selectionOfClass value name upTo: $ ) asSymbol.
477
857d4289a2bd improved class name completion routine
tz
parents: 472
diff changeset
   541
        self valueOfClassName value: clsName.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   542
        self class lastSelection: clsName.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   543
        self listOfResourceMethods contents:
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   544
            ((((Smalltalk at: clsName) 
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   545
                class methodDictionary
cf47d420764a initial checkin
tz
parents:
diff changeset
   546
                asOrderedCollection select: 
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   547
                    [:m| m resources notNil and: [resourceTypes includes: m resourceType]]))
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   548
             collect: [:m| (ResourceMethod new method: m)]).
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   549
    ]
cf47d420764a initial checkin
tz
parents:
diff changeset
   550
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   551
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   552
createClass: what
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   553
    "creates a class, a subclass, or a private class of the selected class"
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   554
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   555
    |clsCandidat cls|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   556
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   557
    clsCandidat := self valueOfClassName value asSymbol.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   558
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   559
    (Smalltalk at: clsCandidat) notNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   560
	ifTrue: [^self warn: 'Cannot create class ', clsCandidat asBoldText,
905c3b4ba565 revised
tz
parents: 769
diff changeset
   561
		'!!\Key with that name in dictionary ' withCRs, 'Smalltalk' asBoldText, ' detected.'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   562
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   563
    cls := self selectionOfClass value contents.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   564
    what = 'class' ifTrue: [cls := cls superclass].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   565
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   566
    cls isNil ifTrue: [^self warn: 'May not create class with superclass ', 'nil' asBoldText, '!!'].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   567
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   568
    what = 'private' 
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   569
    ifFalse: 
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   570
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   571
	cls subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   572
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   573
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   574
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   575
	    category: cls category
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   576
    ]
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   577
    ifTrue:
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   578
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   579
	|superClsCandidate|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   580
	superClsCandidate := (Dialog 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   581
		request: 'Enter name of superclass of private class.'
905c3b4ba565 revised
tz
parents: 769
diff changeset
   582
		initialAnswer: 'Object') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   583
	(Smalltalk at: superClsCandidate) isNil ifTrue: [^self warn: 'Class ', superClsCandidate asBoldText, ' does not exist!!'].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   584
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   585
	((superClsCandidate := Smalltalk at: superClsCandidate) isClass and: [superClsCandidate isPrivate not])
905c3b4ba565 revised
tz
parents: 769
diff changeset
   586
	    ifFalse: [^self warn: 'May not create private class with superclass ', superClsCandidate asBoldText, '!!'].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   587
	superClsCandidate subclass: clsCandidat
905c3b4ba565 revised
tz
parents: 769
diff changeset
   588
	    instanceVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   589
	    classVariableNames:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   590
	    poolDictionaries:''
905c3b4ba565 revised
tz
parents: 769
diff changeset
   591
	    privateIn: cls
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   592
    ].
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   593
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   594
    allClasses := Object withAllSubclasses.
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   595
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   596
    what = 'class' 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   597
	ifTrue:  [self selectionOfClass value parent changed: #children]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   598
	ifFalse: [self selectionOfClass value changed: #children].
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   599
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   600
    classSelectionBlock value: self valueOfClassName value 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   601
!
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   602
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   603
resourceDoubleClicked
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   604
    "after a double click on resource method, accept it and close"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   605
cf47d420764a initial checkin
tz
parents:
diff changeset
   606
    accept value: true.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   607
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   608
    self close
cf47d420764a initial checkin
tz
parents:
diff changeset
   609
!
cf47d420764a initial checkin
tz
parents:
diff changeset
   610
cf47d420764a initial checkin
tz
parents:
diff changeset
   611
resourceSelected
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   612
    "after a click on a resource method, set its selector into the field"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   613
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   614
    self selectionOfResourceMethod value notNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   615
	ifTrue: [self valueOfResourceSelector value: self selectionOfResourceMethod value selector]
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   616
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   617
cf47d420764a initial checkin
tz
parents:
diff changeset
   618
!ResourceSelectionBrowser methodsFor:'instance creation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   619
cf47d420764a initial checkin
tz
parents:
diff changeset
   620
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   621
    "opens a ResourceSelectionBrowser on 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   622
        aSuperclassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   623
        and aClassOrSymbol, 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   624
        and aSelector,
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   625
        with allowed aResourceTypes"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   626
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   627
    |clsName|
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   628
517
91ff807d8a23 set resource selection after opening
tz
parents: 504
diff changeset
   629
    resourceMethod := aSelector.
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   630
    resourceTypes := aResourceTypes.
cf47d420764a initial checkin
tz
parents:
diff changeset
   631
    resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   632
    resourceClass := nil.
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   633
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   634
    aClassOrSymbol isClass 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   635
        ifTrue: [resourceClass := aClassOrSymbol name] 
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   636
        ifFalse: [
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   637
            aClassOrSymbol notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   638
                (Smalltalk at: aClassOrSymbol) notNil
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   639
                ifTrue: [resourceClass := aClassOrSymbol]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   640
            ]
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   641
        ].            
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   642
    self valueOfResourceSelector value:(aSelector ? '').
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   643
463
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   644
    self open.
947f89198464 return complete message even if not implemented
tz
parents: 436
diff changeset
   645
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   646
    (clsName := self selectionOfClass value) isNil ifTrue: [^nil].
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   647
    clsName := (clsName name upTo: $ ) asSymbol.
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   648
733
6454aaabda51 take care for those who do close very quickly
tz
parents: 730
diff changeset
   649
    ((Smalltalk at: clsName) isClass and: [accept value]) 
632
930b778d5e28 uses now dynamic tree items
tz
parents: 623
diff changeset
   650
    ifTrue:
693
bb247cc428c3 also return resource selectors from private classes
tz
parents: 689
diff changeset
   651
    [            
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   652
        ^clsName, ' ', self valueOfResourceSelector value
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   653
    ].
cf47d420764a initial checkin
tz
parents:
diff changeset
   654
    ^nil
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   655
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   656
    "Modified: / 22.4.1998 / 14:51:03 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   657
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   658
cf47d420764a initial checkin
tz
parents:
diff changeset
   659
!ResourceSelectionBrowser methodsFor:'startup / release'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   660
cf47d420764a initial checkin
tz
parents:
diff changeset
   661
closeCancel
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   662
    "after a cancel, terminate readResourcesProcess"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   663
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   664
    readResourcesProcess notNil ifTrue: [readResourcesProcess terminate].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   665
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   666
    super closeCancel
cf47d420764a initial checkin
tz
parents:
diff changeset
   667
cf47d420764a initial checkin
tz
parents:
diff changeset
   668
cf47d420764a initial checkin
tz
parents:
diff changeset
   669
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
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   672
postBuildWith:aBuilder
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   673
    "after building and before opening,  
905c3b4ba565 revised
tz
parents: 769
diff changeset
   674
     create a class selection block, an entry completion block for the class name field, 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   675
     and select the class and the resource selector"
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   676
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   677
    |classSelection classNameInputField|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   678
905c3b4ba565 revised
tz
parents: 769
diff changeset
   679
    allClasses := self treeViewContents withAllSubclasses reject: [:cls| cls isPrivate].
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   680
    classSelection :=  resourceClass. 
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   681
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   682
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
689
ff099c344dd6 try to find out convenient class selection
tz
parents: 680
diff changeset
   683
        ifTrue: [classSelection :=  self class lastSelection].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   684
    (classSelection isNil or:[Smalltalk at: classSelection]) isNil 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   685
        ifTrue: [classSelection :=  self treeViewContents].
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   686
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   687
    classSelectionBlock := 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   688
    [:clsPattern|                                  
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   689
        |foundClass classes|  
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   690
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   691
        clsPattern notNil ifTrue:[
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   692
            foundClass := Smalltalk at:(clsPattern printString asSymbol).
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   693
        ].
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   694
        (foundClass isClass not or:[foundClass name ~= clsPattern])
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   695
        ifTrue:
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   696
        [
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   697
            classes := allClasses select: [:cls| cls name size >= clsPattern size].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   698
            1 to: clsPattern size do: 
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   699
            [:i|    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   700
                 classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   701
            ].    
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   702
            foundClass := classes at: 1 ifAbsent: [nil] 
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   703
        ].          
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   704
        foundClass notNil
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   705
        ifTrue:
866
4b18f2c8478f default selection of private classes
tz
parents: 822
diff changeset
   706
        [                            
4b18f2c8478f default selection of private classes
tz
parents: 822
diff changeset
   707
            |superClasses nonSuperclasses item cls|
867
1ba402cdb5be default selection of private classes (II)
tz
parents: 866
diff changeset
   708
            ((cls := Smalltalk at: classSelection) notNil and: [cls isPrivate])
866
4b18f2c8478f default selection of private classes
tz
parents: 822
diff changeset
   709
                ifFalse: [superClasses := foundClass withAllSuperclasses reverse]
4b18f2c8478f default selection of private classes
tz
parents: 822
diff changeset
   710
                ifTrue:  [superClasses := cls owningClass withAllSuperclasses reverse. superClasses add: cls]
867
1ba402cdb5be default selection of private classes (II)
tz
parents: 866
diff changeset
   711
.                                  
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   712
            (nonSuperclasses := self treeViewContents allSuperclasses) notNil 
905c3b4ba565 revised
tz
parents: 769
diff changeset
   713
                ifTrue: [superClasses := superClasses reject: [:cls| nonSuperclasses includes: cls]].
786
17a84830f0ee unsolved model problems
tz
parents: 773
diff changeset
   714
            item := self rootOfClasses detectChild:[:child :arg| child contents == arg] arguments:superClasses.
867
1ba402cdb5be default selection of private classes (II)
tz
parents: 866
diff changeset
   715
            item notNil ifTrue:[self selectionOfClass value:item]  
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   716
        ].
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   717
        self valueOfClassName value: clsPattern
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   718
    ].
635
47ffd4e4f387 do select method row after opening
tz
parents: 632
diff changeset
   719
    self valueOfClassName value: classSelection.  
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   720
905c3b4ba565 revised
tz
parents: 769
diff changeset
   721
    (classNameInputField := builder componentAt: #classNameInputField) entryCompletionBlock:
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   722
    [:value|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   723
        |what|
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   724
        what := Smalltalk classnameCompletion: value withoutSpaces.
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   725
        classNameInputField contents:what first.
812
c1c6844ddd57 dont access Display directly
Claus Gittinger <cg@exept.de>
parents: 802
diff changeset
   726
        (what at:2) size ~~ 1 ifTrue:[Screen current beep].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   727
        classSelectionBlock value: classNameInputField contents
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   728
    ].
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   729
905c3b4ba565 revised
tz
parents: 769
diff changeset
   730
    mayReadResources := false.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   731
    classSelectionBlock value: classSelection.
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   732
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   733
    readResourcesProcess := 
680
49c81e9cc6f7 create class support added
tz
parents: 664
diff changeset
   734
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   735
        mayReadResources := true.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   736
        self classSelected.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   737
        self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil).
905c3b4ba565 revised
tz
parents: 769
diff changeset
   738
        readResourcesProcess := nil.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   739
    ] forkAt: 4. 
623
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   740
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   741
    ^super postBuildWith:aBuilder
c8a99cea56f7 expand selected class node after opening
tz
parents: 619
diff changeset
   742
802
460dc3bb9cf9 dont send 'Smalltalk at:nil'
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   743
    "Modified: / 22.4.1998 / 14:48:22 / cg"
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   744
! !
cf47d420764a initial checkin
tz
parents:
diff changeset
   745
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   746
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'!
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   747
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   748
iconOn:aGC
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   749
    "registers and returns an icon indicating the resource type"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   750
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   751
    self resourceType isNil ifTrue: [^nil].
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   752
    icon isNil 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   753
    ifTrue: 
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   754
    [
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   755
	|cls sel image imageKey|
905c3b4ba565 revised
tz
parents: 769
diff changeset
   756
	((self resourceType = #image) or: [resourceType = #fileImage])
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
	    cls := method who methodClass soleInstance.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   760
	    sel := method who methodSelector.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   761
	]
905c3b4ba565 revised
tz
parents: 769
diff changeset
   762
	ifFalse:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   763
	[
905c3b4ba565 revised
tz
parents: 769
diff changeset
   764
	    cls := BrowserView.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   765
	    sel := (resourceType, 'Icon') asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   766
	].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   767
	imageKey := (cls name, sel) asSymbol.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   768
	(icon := aGC registeredImageAt: imageKey) isNil
905c3b4ba565 revised
tz
parents: 769
diff changeset
   769
	ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   770
	[       
905c3b4ba565 revised
tz
parents: 769
diff changeset
   771
	    image := cls perform: sel.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   772
	    image extent y > 18
905c3b4ba565 revised
tz
parents: 769
diff changeset
   773
	    ifTrue:
905c3b4ba565 revised
tz
parents: 769
diff changeset
   774
	    [         
905c3b4ba565 revised
tz
parents: 769
diff changeset
   775
		image := image magnifiedBy: 18/image extent y
905c3b4ba565 revised
tz
parents: 769
diff changeset
   776
	    ].
905c3b4ba565 revised
tz
parents: 769
diff changeset
   777
	    aGC registerImage: image key: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   778
	    icon := aGC registeredImageAt: imageKey.
905c3b4ba565 revised
tz
parents: 769
diff changeset
   779
	].
730
238d796c5da0 own #iconOn: method implememted
tz
parents: 727
diff changeset
   780
    ].
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   781
    ^icon
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   782
!
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
method: aMethod
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   785
    "sets aMethod"
523
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
    method := aMethod
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   788
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   789
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   790
resourceType
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   791
    "returns resourceType"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   792
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   793
    resourceType isNil ifTrue: [resourceType := method resourceType].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   794
    ^resourceType
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   795
!
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   796
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   797
selector
771
905c3b4ba565 revised
tz
parents: 769
diff changeset
   798
    "returns selector"
523
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   799
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   800
    selector isNil ifTrue: [selector := method who methodSelector].
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   801
    ^selector
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   802
! !
eec155f1b037 resource methods are now put own rows
tz
parents: 517
diff changeset
   803
425
cf47d420764a initial checkin
tz
parents:
diff changeset
   804
!ResourceSelectionBrowser class methodsFor:'documentation'!
cf47d420764a initial checkin
tz
parents:
diff changeset
   805
cf47d420764a initial checkin
tz
parents:
diff changeset
   806
version
cf47d420764a initial checkin
tz
parents:
diff changeset
   807
    ^ '$Header$'
cf47d420764a initial checkin
tz
parents:
diff changeset
   808
! !