#FEATURE by cg draft
authorClaus Gittinger <cg@exept.de>
Tue, 30 Oct 2018 16:30:12 +0100
changeset 3628 dae68c3b50a6
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
--- a/Tools__ViewTreeApplication.st	Tue Oct 30 16:29:49 2018 +0100
+++ b/Tools__ViewTreeApplication.st	Tue Oct 30 16:30:12 2018 +0100
@@ -634,123 +634,146 @@
 
     ^
      #(Menu
-	(
-	 (MenuItem
-	    label: 'Browse View Class'
-	    itemValue: doBrowse:
-	    argument: view
-	  )
-	 (MenuItem
-	    label: 'Browse Model Class'
-	    itemValue: doBrowse:
-	    isVisible: hasModel
-	    argument: model
-	  )
-	 (MenuItem
-	    label: 'Browse Application Class'
-	    itemValue: doBrowse:
-	    isVisible: hasApplication
-	    argument: application
-	  )
-	 (MenuItem
-	    label: 'Browse Controller Class'
-	    itemValue: doBrowse:
-	    isVisible: hasController
-	    argument: controller
-	  )
-	 (MenuItem
-	    label: '-'
-	  )
-	 (MenuItem
-	    label: 'Inspect View'
-	    itemValue: doInspect:
-	    argument: view
-	  )
-	 (MenuItem
-	    label: 'Inspect Window Group'
-	    itemValue: doInspect:
-	    argument: group
-	  )
-	 (MenuItem
-	    label: 'Inspect Model'
-	    itemValue: doInspect:
-	    isVisible: hasModel
-	    argument: model
-	  )
-	 (MenuItem
-	    label: 'Inspect Application'
-	    itemValue: doInspect:
-	    isVisible: hasApplication
-	    argument: application
-	  )
-	 (MenuItem
-	    label: 'Inspect Controller'
-	    itemValue: doInspect:
-	    isVisible: hasController
-	    argument: controller
-	  )
-	 (MenuItem
-	    label: '-'
-	  )
-	 (MenuItem
-	    label: 'Flash'
-	    itemValue: doFlash
-	  )
-	 (MenuItem
-	    label: '-'
-	  )
-	 (MenuItem
-	    label: 'Destroy'
-	    itemValue: doDestroy
-	    labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
-	  )
-	 (MenuItem
-	    label: '-'
-	  )
-	 (MenuItem
-	    label: 'Geometry'
-	    submenuChannel: submenuGeometry:
-	    keepLinkedMenu: true
-	  )
-	 (MenuItem
-	    label: 'Interface'
-	    submenuChannel: submenuInterface:
-	    keepLinkedMenu: true
-	  )
-	 (MenuItem
-	    label: 'Visibility'
-	    submenuChannel: submenuVisibility:
-	    keepLinkedMenu: true
-	  )
-	 (MenuItem
-	    label: 'Instance Variables'
-	    submenuChannel: submenuInspector:
-	    keepLinkedMenu: true
-	  )
-	 (MenuItem
-	    label: '='
-	  )
-	 (MenuItem
-	    label: ''
-	  )
-	 (MenuItem
-	    enabled: selectedComponentHasChildren
-	    label: 'Applications'
-	    nameKey: single
-	    submenuChannel: submenuApplications:
-	    keepLinkedMenu: true
-	  )
-	 (MenuItem
-	    enabled: selectedComponentHasChildren
-	    label: 'Components'
-	    nameKey: single
-	    submenuChannel: submenuComponents:
-	    keepLinkedMenu: true
-	  )
-	 )
-	nil
-	nil
+        (
+         (MenuItem
+            label: 'Browse View Class'
+            itemValue: doBrowse:
+            argument: view
+          )
+         (MenuItem
+            label: 'Browse Model Class'
+            itemValue: doBrowse:
+            isVisible: hasModel
+            argument: model
+          )
+         (MenuItem
+            label: 'Browse Application Class'
+            itemValue: doBrowse:
+            isVisible: hasApplication
+            argument: application
+          )
+         (MenuItem
+            label: 'Browse Master Application Class'
+            itemValue: doBrowse:
+            isVisible: hasApplication
+            enabled: hasMasterApplication
+            argument: masterApplication
+          )
+         (MenuItem
+            label: 'Browse Controller Class'
+            itemValue: doBrowse:
+            isVisible: hasController
+            argument: controller
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Inspect View'
+            itemValue: doInspect:
+            argument: view
+          )
+         (MenuItem
+            label: 'Inspect Window Group'
+            itemValue: doInspect:
+            argument: group
+          )
+         (MenuItem
+            label: 'Inspect Model'
+            itemValue: doInspect:
+            isVisible: hasModel
+            argument: model
+          )
+         (MenuItem
+            label: 'Inspect Application'
+            itemValue: doInspect:
+            isVisible: hasApplication
+            argument: application
+          )
+         (MenuItem
+            label: 'Inspect Master Application'
+            itemValue: doInspect:
+            isVisible: hasApplication
+            enabled: hasMasterApplication
+            argument: masterApplication
+          )
+         (MenuItem
+            label: 'Inspect Controller'
+            itemValue: doInspect:
+            isVisible: hasController
+            argument: controller
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Edit Language Resources'
+            itemValue: doEditLanguageResources
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Flash'
+            itemValue: doFlash
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Destroy'
+            itemValue: doDestroy
+            labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Geometry'
+            submenuChannel: submenuGeometry:
+            keepLinkedMenu: true
+          )
+         (MenuItem
+            label: 'Interface'
+            submenuChannel: submenuInterface:
+            keepLinkedMenu: true
+          )
+         (MenuItem
+            label: 'Visibility'
+            submenuChannel: submenuVisibility:
+            keepLinkedMenu: true
+          )
+         (MenuItem
+            label: 'Instance Variables'
+            submenuChannel: submenuInspector:
+            keepLinkedMenu: true
+          )
+         (MenuItem
+            label: '='
+          )
+         (MenuItem
+            label: ''
+          )
+         (MenuItem
+            enabled: selectedComponentHasChildren
+            label: 'Applications'
+            nameKey: single
+            submenuChannel: submenuApplications:
+            keepLinkedMenu: true
+          )
+         (MenuItem
+            enabled: selectedComponentHasChildren
+            label: 'Components'
+            nameKey: single
+            submenuChannel: submenuComponents:
+            keepLinkedMenu: true
+          )
+         )
+        nil
+        nil
       )
+
+    "Modified: / 30-10-2018 / 16:24:49 / Claus Gittinger"
 !
 
 middleButtonMenuForMenuItems
@@ -1534,7 +1557,9 @@
     |view|
 
     view := self selectedView.
-  ^ (view notNil and:[view application notNil])
+    ^ (view notNil and:[view application notNil])
+
+    "Modified (format): / 30-10-2018 / 16:20:26 / Claus Gittinger"
 !
 
 hasController
@@ -1552,6 +1577,19 @@
     ^ false
 !
 
+hasMasterApplication
+    "returns true if the current selected view has an application"
+
+    |view|
+
+    view := self selectedView.
+    ^ (view notNil 
+        and:[view application notNil
+        and:[view application masterApplication notNil]])
+
+    "Created: / 30-10-2018 / 16:20:23 / Claus Gittinger"
+!
+
 hasModel
     "returns true if the current selected view has a model"
 
@@ -2130,10 +2168,11 @@
 
 doBrowse:what
     "open browser on:
-	#view           browse class
-	#model          browse model class
-	#application    browse application class
-	#controller     browse controller class
+        #view           browse class
+        #model          browse model class
+        #application    browse application class
+        #masterApplication    browse master application class
+        #controller     browse controller class
     "
     |inst|
 
@@ -2141,6 +2180,7 @@
     inst class browserClass openInClass:(inst class) selector:nil
 
     "Modified: / 28-08-2013 / 23:57:42 / cg"
+    "Modified (comment): / 30-10-2018 / 16:21:25 / Claus Gittinger"
 !
 
 doBrowseWindowSpecMethod
@@ -2206,6 +2246,18 @@
     ].
 !
 
+doEditLanguageResources
+    "open language editor on the application's resources:
+    "
+    |inst|
+
+    (inst := self objectToInspectOrBrowse:#application) isNil ifTrue:[^ self].
+    Tools::InternationalLanguageTranslationEditor 
+        openOnPackage:inst class package
+
+    "Created: / 30-10-2018 / 16:26:17 / Claus Gittinger"
+!
+
 doEditWindowSpec
     |mthd|
 
@@ -2342,19 +2394,20 @@
 
 objectToInspectOrBrowse:what
     "return one of:
-	#view           for inspect/browse view/widget
-	#group          for inspect/browse windowGroup
-	#model          for inspect/browse model
-	#application    for inspect/browse application
-	#controller     for inspect/browse controller
-	#process        for inspect/browse application's process
-	#widgetClass    for inspect/browse widget's class
-	#menuItem       for inspect/browse menuItem
+        #view           for inspect/browse view/widget
+        #group          for inspect/browse windowGroup
+        #model          for inspect/browse model
+        #application    for inspect/browse application
+        #masterApplication    for inspect/browse master application
+        #controller     for inspect/browse controller
+        #process        for inspect/browse application's process
+        #widgetClass    for inspect/browse widget's class
+        #menuItem       for inspect/browse menuItem
     "
     |view|
 
     what == #menuItem       ifTrue:[
-	^ model selectedItem menuItem
+        ^ model selectedItem menuItem
     ].
 
     view := self selectedView.
@@ -2366,11 +2419,13 @@
     what == #process     ifTrue:[ ^ view windowGroup process ].
     what == #sensor      ifTrue:[ ^ view sensor ].
     what == #application ifTrue:[ ^ view application ? view topView ].
+    what == #masterApplication ifTrue:[ ^ view application masterApplication ].
     what == #applicationClass ifTrue:[ ^ view application ? view topView ].
 
     ^ view
 
     "Modified: / 16-08-2017 / 13:57:36 / cg"
+    "Modified: / 30-10-2018 / 16:22:13 / Claus Gittinger"
 !
 
 openDocumentation