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