Tools__ViewTreeApplication.st
changeset 3112 80453ab62df9
parent 3105 b33e0b8e6038
child 3123 5bdc0a26498c
equal deleted inserted replaced
3111:618a32168c9c 3112:80453ab62df9
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 ToolApplicationModel subclass:#ViewTreeInspectorApplication
    16 ToolApplicationModel subclass:#ViewTreeInspectorApplication
    17 	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
    17 	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
    18 		motionAction process followFocusChannel showNamesHolder
    18 		motionAction process followFocusChannel showNamesHolder
    19 		inspectorView inspectorModeIndexHolder'
    19 		inspectorView inspectorModeIndexHolder path'
    20 	classVariableNames:''
    20 	classVariableNames:''
    21 	poolDictionaries:''
    21 	poolDictionaries:''
    22 	category:'Interface-Smalltalk'
    22 	category:'Interface-Smalltalk'
    23 !
    23 !
    24 
    24 
   328       (WindowSpec
   328       (WindowSpec
   329          label: 'View Tree Inspector'
   329          label: 'View Tree Inspector'
   330          name: 'View Tree Inspector'
   330          name: 'View Tree Inspector'
   331          min: (Point 10 10)
   331          min: (Point 10 10)
   332          max: (Point 1024 9999)
   332          max: (Point 1024 9999)
   333          bounds: (Rectangle 0 0 381 654)
   333          bounds: (Rectangle 0 0 693 643)
   334          menu: menu
   334          menu: menu
   335        )
   335        )
   336        component: 
   336        component: 
   337       (SpecCollection
   337       (SpecCollection
   338          collection: (
   338          collection: (
   346              name: 'VariableVerticalPanel1'
   346              name: 'VariableVerticalPanel1'
   347              layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 0 1.0)
   347              layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 0 1.0)
   348              component: 
   348              component: 
   349             (SpecCollection
   349             (SpecCollection
   350                collection: (
   350                collection: (
   351                 (HierarchicalListViewSpec
   351                 (ViewSpec
   352                    name: 'List'
   352                    name: 'PathAndListPane'
   353                    level: 1
   353                    component: 
   354                    model: model
   354                   (SpecCollection
   355                    menu: middleButtonMenu
   355                      collection: (
   356                    hasHorizontalScrollBar: true
   356                       (ViewSpec
   357                    hasVerticalScrollBar: true
   357                          name: 'PathPane'
   358                    miniScrollerHorizontal: true
   358                          layout: (LayoutFrame 0 0 0 0 0 1 25 0)
   359                    miniScrollerVertical: false
   359                          component: 
   360                    listModel: listOfItems
   360                         (SpecCollection
   361                    multipleSelectOk: true
   361                            collection: (
   362                    useIndex: false
   362                             (InputFieldSpec
   363                    highlightMode: label
   363                                name: 'Path'
   364                    showLeftIndicators: false
   364                                layout: (LayoutFrame 0 0 0 0 0 1 0 1)
   365                    indicatorSelector: indicatorClicked:
   365                                model: path
   366                    useDefaultIcons: false
   366                                acceptOnReturn: true
   367                    postBuildCallback: postBuildTree:
   367                                acceptOnTab: true
       
   368                                acceptOnPointerLeave: true
       
   369                                emptyFieldReplacementText: 'No View Selected'
       
   370                              )
       
   371                             )
       
   372                           
       
   373                          )
       
   374                        )
       
   375                       (HierarchicalListViewSpec
       
   376                          name: 'List'
       
   377                          layout: (LayoutFrame 0 0 25 0 0 1 0 1)
       
   378                          level: 1
       
   379                          model: model
       
   380                          menu: middleButtonMenu
       
   381                          hasHorizontalScrollBar: true
       
   382                          hasVerticalScrollBar: true
       
   383                          miniScrollerHorizontal: true
       
   384                          miniScrollerVertical: false
       
   385                          listModel: listOfItems
       
   386                          multipleSelectOk: true
       
   387                          useIndex: false
       
   388                          highlightMode: label
       
   389                          showLeftIndicators: false
       
   390                          indicatorSelector: indicatorClicked:
       
   391                          useDefaultIcons: false
       
   392                          postBuildCallback: postBuildTree:
       
   393                        )
       
   394                       )
       
   395                     
       
   396                    )
   368                  )
   397                  )
   369                 (ViewSpec
   398                 (ViewSpec
   370                    name: 'Box2'
   399                    name: 'Box2'
   371                    component: 
   400                    component: 
   372                   (SpecCollection
   401                   (SpecCollection
   380                          translateLabel: true
   409                          translateLabel: true
   381                        )
   410                        )
   382                       (ViewSpec
   411                       (ViewSpec
   383                          name: 'Inspector'
   412                          name: 'Inspector'
   384                          layout: (LayoutFrame 0 0 26 0 0 1 0 1)
   413                          layout: (LayoutFrame 0 0 26 0 0 1 0 1)
       
   414                          postBuildCallback: postBuildInspectorView:
   385                          viewClassName: 'InspectorView'
   415                          viewClassName: 'InspectorView'
   386                          postBuildCallback: postBuildInspectorView:
       
   387                        )
   416                        )
   388                       )
   417                       )
   389                     
   418                     
   390                    )
   419                    )
   391                  )
   420                  )
   946     "returns my selection model, a ViewTreeModel"
   975     "returns my selection model, a ViewTreeModel"
   947 
   976 
   948     ^ model
   977     ^ model
   949 !
   978 !
   950 
   979 
       
   980 path
       
   981     <resource: #uiAspect>
       
   982 
       
   983     path isNil ifTrue:[
       
   984         path := PluggableAdaptor on: self model getter:[ :model | model path ]
       
   985     ].
       
   986     ^ path.
       
   987 
       
   988     "Modified: / 19-05-2014 / 18:40:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   989 !
       
   990 
   951 selectOnClickHolder
   991 selectOnClickHolder
   952     "boolean holder, which indicates whether the selection will change on click"
   992     "boolean holder, which indicates whether the selection will change on click"
   953 
   993 
   954     ^ model selectOnClickHolder
   994     ^ model selectOnClickHolder
   955 !
   995 !
  3087     aBoolean ifFalse:[
  3127     aBoolean ifFalse:[
  3088         self redrawUnselected:selection andLock:false checkTestMode:false.
  3128         self redrawUnselected:selection andLock:false checkTestMode:false.
  3089     ].
  3129     ].
  3090 !
  3130 !
  3091 
  3131 
       
  3132 path
       
  3133     "Return a XPath like path to this item"
       
  3134 
       
  3135     | view views|
       
  3136 
       
  3137     selection isNil ifTrue:[ ^ nil ].
       
  3138     selection isCollection ifTrue:[ 
       
  3139         selection size ~~ 1 ifTrue:[ ^ nil ].
       
  3140         view := selection anElement widget.
       
  3141     ] ifFalse:[ 
       
  3142         view := selection widget.
       
  3143     ].
       
  3144     views := OrderedCollection new.
       
  3145     [ view notNil ] whileTrue:[ 
       
  3146         views add: view.
       
  3147         view := view superView.
       
  3148     ].
       
  3149     views removeLast.
       
  3150     ^ String streamContents:[ :s|
       
  3151         views reverseDo:[:each |
       
  3152             s nextPutAll:' / '.
       
  3153             s nextPutAll: each name asString storeString.
       
  3154         ].
       
  3155     ]
       
  3156 
       
  3157     "Created: / 19-05-2014 / 18:15:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3158 !
       
  3159 
  3092 rootItem
  3160 rootItem
  3093     "get the rootItem the event viewer is established on
  3161     "get the rootItem the event viewer is established on
  3094     "
  3162     "
  3095     ^ listOfItems root
  3163     ^ listOfItems root
  3096 !
  3164 !