#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 30 Oct 2018 16:30:12 +0100
changeset 3628dae68c3b50a6
parent 3627 9ee9d719f243
child 3629 3b7a40bf90cb
#FEATURE by cg
class: Tools::ViewTreeInspectorApplication
added:
#doEditLanguageResources
#hasMasterApplication
comment/format in:
#doBrowse:
#hasApplication
changed: #objectToInspectOrBrowse:

class: Tools::ViewTreeInspectorApplication class
changed: #middleButtonMenu
Tools__ViewTreeApplication.st
     1.1 --- a/Tools__ViewTreeApplication.st	Tue Oct 30 16:29:49 2018 +0100
     1.2 +++ b/Tools__ViewTreeApplication.st	Tue Oct 30 16:30:12 2018 +0100
     1.3 @@ -634,123 +634,146 @@
     1.4  
     1.5      ^
     1.6       #(Menu
     1.7 -	(
     1.8 -	 (MenuItem
     1.9 -	    label: 'Browse View Class'
    1.10 -	    itemValue: doBrowse:
    1.11 -	    argument: view
    1.12 -	  )
    1.13 -	 (MenuItem
    1.14 -	    label: 'Browse Model Class'
    1.15 -	    itemValue: doBrowse:
    1.16 -	    isVisible: hasModel
    1.17 -	    argument: model
    1.18 -	  )
    1.19 -	 (MenuItem
    1.20 -	    label: 'Browse Application Class'
    1.21 -	    itemValue: doBrowse:
    1.22 -	    isVisible: hasApplication
    1.23 -	    argument: application
    1.24 -	  )
    1.25 -	 (MenuItem
    1.26 -	    label: 'Browse Controller Class'
    1.27 -	    itemValue: doBrowse:
    1.28 -	    isVisible: hasController
    1.29 -	    argument: controller
    1.30 -	  )
    1.31 -	 (MenuItem
    1.32 -	    label: '-'
    1.33 -	  )
    1.34 -	 (MenuItem
    1.35 -	    label: 'Inspect View'
    1.36 -	    itemValue: doInspect:
    1.37 -	    argument: view
    1.38 -	  )
    1.39 -	 (MenuItem
    1.40 -	    label: 'Inspect Window Group'
    1.41 -	    itemValue: doInspect:
    1.42 -	    argument: group
    1.43 -	  )
    1.44 -	 (MenuItem
    1.45 -	    label: 'Inspect Model'
    1.46 -	    itemValue: doInspect:
    1.47 -	    isVisible: hasModel
    1.48 -	    argument: model
    1.49 -	  )
    1.50 -	 (MenuItem
    1.51 -	    label: 'Inspect Application'
    1.52 -	    itemValue: doInspect:
    1.53 -	    isVisible: hasApplication
    1.54 -	    argument: application
    1.55 -	  )
    1.56 -	 (MenuItem
    1.57 -	    label: 'Inspect Controller'
    1.58 -	    itemValue: doInspect:
    1.59 -	    isVisible: hasController
    1.60 -	    argument: controller
    1.61 -	  )
    1.62 -	 (MenuItem
    1.63 -	    label: '-'
    1.64 -	  )
    1.65 -	 (MenuItem
    1.66 -	    label: 'Flash'
    1.67 -	    itemValue: doFlash
    1.68 -	  )
    1.69 -	 (MenuItem
    1.70 -	    label: '-'
    1.71 -	  )
    1.72 -	 (MenuItem
    1.73 -	    label: 'Destroy'
    1.74 -	    itemValue: doDestroy
    1.75 -	    labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
    1.76 -	  )
    1.77 -	 (MenuItem
    1.78 -	    label: '-'
    1.79 -	  )
    1.80 -	 (MenuItem
    1.81 -	    label: 'Geometry'
    1.82 -	    submenuChannel: submenuGeometry:
    1.83 -	    keepLinkedMenu: true
    1.84 -	  )
    1.85 -	 (MenuItem
    1.86 -	    label: 'Interface'
    1.87 -	    submenuChannel: submenuInterface:
    1.88 -	    keepLinkedMenu: true
    1.89 -	  )
    1.90 -	 (MenuItem
    1.91 -	    label: 'Visibility'
    1.92 -	    submenuChannel: submenuVisibility:
    1.93 -	    keepLinkedMenu: true
    1.94 -	  )
    1.95 -	 (MenuItem
    1.96 -	    label: 'Instance Variables'
    1.97 -	    submenuChannel: submenuInspector:
    1.98 -	    keepLinkedMenu: true
    1.99 -	  )
   1.100 -	 (MenuItem
   1.101 -	    label: '='
   1.102 -	  )
   1.103 -	 (MenuItem
   1.104 -	    label: ''
   1.105 -	  )
   1.106 -	 (MenuItem
   1.107 -	    enabled: selectedComponentHasChildren
   1.108 -	    label: 'Applications'
   1.109 -	    nameKey: single
   1.110 -	    submenuChannel: submenuApplications:
   1.111 -	    keepLinkedMenu: true
   1.112 -	  )
   1.113 -	 (MenuItem
   1.114 -	    enabled: selectedComponentHasChildren
   1.115 -	    label: 'Components'
   1.116 -	    nameKey: single
   1.117 -	    submenuChannel: submenuComponents:
   1.118 -	    keepLinkedMenu: true
   1.119 -	  )
   1.120 -	 )
   1.121 -	nil
   1.122 -	nil
   1.123 +        (
   1.124 +         (MenuItem
   1.125 +            label: 'Browse View Class'
   1.126 +            itemValue: doBrowse:
   1.127 +            argument: view
   1.128 +          )
   1.129 +         (MenuItem
   1.130 +            label: 'Browse Model Class'
   1.131 +            itemValue: doBrowse:
   1.132 +            isVisible: hasModel
   1.133 +            argument: model
   1.134 +          )
   1.135 +         (MenuItem
   1.136 +            label: 'Browse Application Class'
   1.137 +            itemValue: doBrowse:
   1.138 +            isVisible: hasApplication
   1.139 +            argument: application
   1.140 +          )
   1.141 +         (MenuItem
   1.142 +            label: 'Browse Master Application Class'
   1.143 +            itemValue: doBrowse:
   1.144 +            isVisible: hasApplication
   1.145 +            enabled: hasMasterApplication
   1.146 +            argument: masterApplication
   1.147 +          )
   1.148 +         (MenuItem
   1.149 +            label: 'Browse Controller Class'
   1.150 +            itemValue: doBrowse:
   1.151 +            isVisible: hasController
   1.152 +            argument: controller
   1.153 +          )
   1.154 +         (MenuItem
   1.155 +            label: '-'
   1.156 +          )
   1.157 +         (MenuItem
   1.158 +            label: 'Inspect View'
   1.159 +            itemValue: doInspect:
   1.160 +            argument: view
   1.161 +          )
   1.162 +         (MenuItem
   1.163 +            label: 'Inspect Window Group'
   1.164 +            itemValue: doInspect:
   1.165 +            argument: group
   1.166 +          )
   1.167 +         (MenuItem
   1.168 +            label: 'Inspect Model'
   1.169 +            itemValue: doInspect:
   1.170 +            isVisible: hasModel
   1.171 +            argument: model
   1.172 +          )
   1.173 +         (MenuItem
   1.174 +            label: 'Inspect Application'
   1.175 +            itemValue: doInspect:
   1.176 +            isVisible: hasApplication
   1.177 +            argument: application
   1.178 +          )
   1.179 +         (MenuItem
   1.180 +            label: 'Inspect Master Application'
   1.181 +            itemValue: doInspect:
   1.182 +            isVisible: hasApplication
   1.183 +            enabled: hasMasterApplication
   1.184 +            argument: masterApplication
   1.185 +          )
   1.186 +         (MenuItem
   1.187 +            label: 'Inspect Controller'
   1.188 +            itemValue: doInspect:
   1.189 +            isVisible: hasController
   1.190 +            argument: controller
   1.191 +          )
   1.192 +         (MenuItem
   1.193 +            label: '-'
   1.194 +          )
   1.195 +         (MenuItem
   1.196 +            label: 'Edit Language Resources'
   1.197 +            itemValue: doEditLanguageResources
   1.198 +          )
   1.199 +         (MenuItem
   1.200 +            label: '-'
   1.201 +          )
   1.202 +         (MenuItem
   1.203 +            label: 'Flash'
   1.204 +            itemValue: doFlash
   1.205 +          )
   1.206 +         (MenuItem
   1.207 +            label: '-'
   1.208 +          )
   1.209 +         (MenuItem
   1.210 +            label: 'Destroy'
   1.211 +            itemValue: doDestroy
   1.212 +            labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
   1.213 +          )
   1.214 +         (MenuItem
   1.215 +            label: '-'
   1.216 +          )
   1.217 +         (MenuItem
   1.218 +            label: 'Geometry'
   1.219 +            submenuChannel: submenuGeometry:
   1.220 +            keepLinkedMenu: true
   1.221 +          )
   1.222 +         (MenuItem
   1.223 +            label: 'Interface'
   1.224 +            submenuChannel: submenuInterface:
   1.225 +            keepLinkedMenu: true
   1.226 +          )
   1.227 +         (MenuItem
   1.228 +            label: 'Visibility'
   1.229 +            submenuChannel: submenuVisibility:
   1.230 +            keepLinkedMenu: true
   1.231 +          )
   1.232 +         (MenuItem
   1.233 +            label: 'Instance Variables'
   1.234 +            submenuChannel: submenuInspector:
   1.235 +            keepLinkedMenu: true
   1.236 +          )
   1.237 +         (MenuItem
   1.238 +            label: '='
   1.239 +          )
   1.240 +         (MenuItem
   1.241 +            label: ''
   1.242 +          )
   1.243 +         (MenuItem
   1.244 +            enabled: selectedComponentHasChildren
   1.245 +            label: 'Applications'
   1.246 +            nameKey: single
   1.247 +            submenuChannel: submenuApplications:
   1.248 +            keepLinkedMenu: true
   1.249 +          )
   1.250 +         (MenuItem
   1.251 +            enabled: selectedComponentHasChildren
   1.252 +            label: 'Components'
   1.253 +            nameKey: single
   1.254 +            submenuChannel: submenuComponents:
   1.255 +            keepLinkedMenu: true
   1.256 +          )
   1.257 +         )
   1.258 +        nil
   1.259 +        nil
   1.260        )
   1.261 +
   1.262 +    "Modified: / 30-10-2018 / 16:24:49 / Claus Gittinger"
   1.263  !
   1.264  
   1.265  middleButtonMenuForMenuItems
   1.266 @@ -1534,7 +1557,9 @@
   1.267      |view|
   1.268  
   1.269      view := self selectedView.
   1.270 -  ^ (view notNil and:[view application notNil])
   1.271 +    ^ (view notNil and:[view application notNil])
   1.272 +
   1.273 +    "Modified (format): / 30-10-2018 / 16:20:26 / Claus Gittinger"
   1.274  !
   1.275  
   1.276  hasController
   1.277 @@ -1552,6 +1577,19 @@
   1.278      ^ false
   1.279  !
   1.280  
   1.281 +hasMasterApplication
   1.282 +    "returns true if the current selected view has an application"
   1.283 +
   1.284 +    |view|
   1.285 +
   1.286 +    view := self selectedView.
   1.287 +    ^ (view notNil 
   1.288 +        and:[view application notNil
   1.289 +        and:[view application masterApplication notNil]])
   1.290 +
   1.291 +    "Created: / 30-10-2018 / 16:20:23 / Claus Gittinger"
   1.292 +!
   1.293 +
   1.294  hasModel
   1.295      "returns true if the current selected view has a model"
   1.296  
   1.297 @@ -2130,10 +2168,11 @@
   1.298  
   1.299  doBrowse:what
   1.300      "open browser on:
   1.301 -	#view           browse class
   1.302 -	#model          browse model class
   1.303 -	#application    browse application class
   1.304 -	#controller     browse controller class
   1.305 +        #view           browse class
   1.306 +        #model          browse model class
   1.307 +        #application    browse application class
   1.308 +        #masterApplication    browse master application class
   1.309 +        #controller     browse controller class
   1.310      "
   1.311      |inst|
   1.312  
   1.313 @@ -2141,6 +2180,7 @@
   1.314      inst class browserClass openInClass:(inst class) selector:nil
   1.315  
   1.316      "Modified: / 28-08-2013 / 23:57:42 / cg"
   1.317 +    "Modified (comment): / 30-10-2018 / 16:21:25 / Claus Gittinger"
   1.318  !
   1.319  
   1.320  doBrowseWindowSpecMethod
   1.321 @@ -2206,6 +2246,18 @@
   1.322      ].
   1.323  !
   1.324  
   1.325 +doEditLanguageResources
   1.326 +    "open language editor on the application's resources:
   1.327 +    "
   1.328 +    |inst|
   1.329 +
   1.330 +    (inst := self objectToInspectOrBrowse:#application) isNil ifTrue:[^ self].
   1.331 +    Tools::InternationalLanguageTranslationEditor 
   1.332 +        openOnPackage:inst class package
   1.333 +
   1.334 +    "Created: / 30-10-2018 / 16:26:17 / Claus Gittinger"
   1.335 +!
   1.336 +
   1.337  doEditWindowSpec
   1.338      |mthd|
   1.339  
   1.340 @@ -2342,19 +2394,20 @@
   1.341  
   1.342  objectToInspectOrBrowse:what
   1.343      "return one of:
   1.344 -	#view           for inspect/browse view/widget
   1.345 -	#group          for inspect/browse windowGroup
   1.346 -	#model          for inspect/browse model
   1.347 -	#application    for inspect/browse application
   1.348 -	#controller     for inspect/browse controller
   1.349 -	#process        for inspect/browse application's process
   1.350 -	#widgetClass    for inspect/browse widget's class
   1.351 -	#menuItem       for inspect/browse menuItem
   1.352 +        #view           for inspect/browse view/widget
   1.353 +        #group          for inspect/browse windowGroup
   1.354 +        #model          for inspect/browse model
   1.355 +        #application    for inspect/browse application
   1.356 +        #masterApplication    for inspect/browse master application
   1.357 +        #controller     for inspect/browse controller
   1.358 +        #process        for inspect/browse application's process
   1.359 +        #widgetClass    for inspect/browse widget's class
   1.360 +        #menuItem       for inspect/browse menuItem
   1.361      "
   1.362      |view|
   1.363  
   1.364      what == #menuItem       ifTrue:[
   1.365 -	^ model selectedItem menuItem
   1.366 +        ^ model selectedItem menuItem
   1.367      ].
   1.368  
   1.369      view := self selectedView.
   1.370 @@ -2366,11 +2419,13 @@
   1.371      what == #process     ifTrue:[ ^ view windowGroup process ].
   1.372      what == #sensor      ifTrue:[ ^ view sensor ].
   1.373      what == #application ifTrue:[ ^ view application ? view topView ].
   1.374 +    what == #masterApplication ifTrue:[ ^ view application masterApplication ].
   1.375      what == #applicationClass ifTrue:[ ^ view application ? view topView ].
   1.376  
   1.377      ^ view
   1.378  
   1.379      "Modified: / 16-08-2017 / 13:57:36 / cg"
   1.380 +    "Modified: / 30-10-2018 / 16:22:13 / Claus Gittinger"
   1.381  !
   1.382  
   1.383  openDocumentation