Tools__ViewTreeModel.st
changeset 2453 cc98051589bb
parent 2404 06d51e254934
child 2457 04459d76932e
equal deleted inserted replaced
2452:7892f26996b7 2453:cc98051589bb
    10 	poolDictionaries:''
    10 	poolDictionaries:''
    11 	category:'A-Views-Support'
    11 	category:'A-Views-Support'
    12 !
    12 !
    13 
    13 
    14 HierarchicalList subclass:#ItemList
    14 HierarchicalList subclass:#ItemList
    15 	instanceVariableNames:'treeModel eventHook eventHookInitialized'
    15 	instanceVariableNames:'treeModel eventHook eventHookInitialized showWidgetNames'
    16 	classVariableNames:''
    16 	classVariableNames:''
    17 	poolDictionaries:''
    17 	poolDictionaries:''
    18 	privateIn:ViewTreeModel
    18 	privateIn:ViewTreeModel
    19 !
    19 !
    20 
    20 
  1185     "returne the treeModel, a ViewTreeModel
  1185     "returne the treeModel, a ViewTreeModel
  1186     "
  1186     "
  1187     ^ treeModel
  1187     ^ treeModel
  1188 ! !
  1188 ! !
  1189 
  1189 
       
  1190 !ViewTreeModel::ItemList methodsFor:'accessing look'!
       
  1191 
       
  1192 additionalLabelForItem:anItem
       
  1193     "answer the additional lable for an item or nil"
       
  1194 
       
  1195     |applClass|
       
  1196 
       
  1197     showWidgetNames == true ifTrue:[
       
  1198         ^ '[', anItem widget name, ']'
       
  1199     ].
       
  1200 
       
  1201     anItem isApplicationClass ifTrue:[
       
  1202         applClass := anItem applicationClass.
       
  1203 
       
  1204         applClass notNil ifTrue:[
       
  1205             ^ ('[', applClass name, ']')
       
  1206         ].
       
  1207     ].
       
  1208     ^ nil
       
  1209 !
       
  1210 
       
  1211 showWidgetNames
       
  1212     "answer true if the additional text is the widget name
       
  1213      otherwise the name of the application"
       
  1214 
       
  1215     ^ showWidgetNames ? false
       
  1216 !
       
  1217 
       
  1218 showWidgetNames:aBoolean
       
  1219     "set true if the additional text is the widget name
       
  1220      otherwise the name of the application"
       
  1221 
       
  1222     self showWidgetNames == aBoolean ifFalse:[
       
  1223         showWidgetNames := aBoolean.
       
  1224 
       
  1225         root notNil ifTrue:[
       
  1226             root recursiveAdditionalNameBehaviourChanged.
       
  1227             self changed.
       
  1228         ].
       
  1229     ].
       
  1230 ! !
       
  1231 
  1190 !ViewTreeModel::ItemList methodsFor:'event processing'!
  1232 !ViewTreeModel::ItemList methodsFor:'event processing'!
  1191 
  1233 
  1192 processEvent:anEvent
  1234 processEvent:anEvent
  1193     "post process event
  1235     "post process event
  1194     "
  1236     "
  1200 on:aModel
  1242 on:aModel
  1201     "set the model, a ViewTreeModel
  1243     "set the model, a ViewTreeModel
  1202     "
  1244     "
  1203     treeModel := aModel.
  1245     treeModel := aModel.
  1204     showRoot  := true.
  1246     showRoot  := true.
       
  1247     showWidgetNames := false.
  1205 ! !
  1248 ! !
  1206 
  1249 
  1207 !ViewTreeModel::ItemList methodsFor:'searching'!
  1250 !ViewTreeModel::ItemList methodsFor:'searching'!
  1208 
  1251 
  1209 detectItemRespondsToView:aView
  1252 detectItemRespondsToView:aView