class: Tools::NewSystemBrowser
authorClaus Gittinger <cg@exept.de>
Tue, 06 Nov 2012 18:50:29 +0100
changeset 12038 5d7a7fca1314
parent 12037 ca4d1532f6c1
child 12039 23a6414c2eef
class: Tools::NewSystemBrowser added:7 methods comment/format in: #browseProfilerStatistics: changed:7 methods
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Tue Nov 06 18:49:11 2012 +0100
+++ b/Tools__NewSystemBrowser.st	Tue Nov 06 18:50:29 2012 +0100
@@ -6847,6 +6847,13 @@
             keepLinkedMenu: true
           )
          (MenuItem
+            enabled: hasClassSelectedHolder
+            label: 'Check Compilability'
+            itemValue: classMenuCheckCompilability
+            translateLabel: true
+            showBusyCursorWhilePerforming: true
+          )
+         (MenuItem
             enabled: hasClassSelectedAndInstrumentingCompilerExistsHolder
             label: 'Recompile all Methods with Instrumentation'
             itemValue: classMenuRecompileInstrumented
@@ -8673,6 +8680,14 @@
             label: '-'
           )
          (MenuItem
+            enabled: hasSingleLoadedClassSelectedHolder
+            label: 'Edit Resource File(s)...'
+            itemValue: classMenuEditResourceFiles
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
             enabled: hasClassSelectedHolder
             label: 'Do...'
             itemValue: classMenuDoUserProvidedAction
@@ -9095,16 +9110,6 @@
             itemValue: classMenuCheckIndividual
             translateLabel: true
           )
-         (MenuItem
-            label: '-'
-          )
-         (MenuItem
-            enabled: hasClassSelectedHolder
-            label: 'Check Compilability'
-            itemValue: classMenuCheckCompilability
-            translateLabel: true
-            showBusyCursorWhilePerforming: true
-          )
          )
         nil
         nil
@@ -9163,55 +9168,51 @@
             label: 'Package'
             isVisible: projectMenuVisible
             submenuChannel: projectMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Namespace'
             isVisible: nameSpaceMenuVisible
             submenuChannel: nameSpaceMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Category'
             isVisible: categoryMenuVisible
             submenuChannel: categoryMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Hierarchy'
             isVisible: classHierarchyMenuVisible
             submenuChannel: classHierarchyMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Class'
             isVisible: classMenuVisible
             submenuChannel: classMenu
-            keepLinkedMenu: true
+          )
+         (MenuItem
+            label: 'Variable'
+            isVisible: variablesMenuVisible
+            submenuChannel: variablesMenu
           )
          (MenuItem
             label: 'Protocol'
             isVisible: protocolMenuVisible
             submenuChannel: protocolMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Selector'
             isVisible: selectorMenuVisible
             submenuChannel: selectorMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Code'
             isVisible: codeMenuVisible
             submenuChannel: codeMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Debug'
             isVisible: selectorMenuVisible
             submenuChannel: methodDebugMenu
-            keepLinkedMenu: true
           )
          (MenuItem
             label: 'Operations'
@@ -16644,6 +16645,7 @@
     "Modified: / 29-09-2006 / 16:11:08 / cg"
 ! !
 
+
 !NewSystemBrowser class methodsFor:'menu specs-popup'!
 
 categoryPopUpMenu
@@ -17460,7 +17462,7 @@
 !
 
 browseProfilerStatistics: statistics
-    "launch a single class browser."
+    "launch browser on profiler statistics"
 
     ^ self basicNew spawnProfilerStatistics: statistics in:#newBrowser.
 
@@ -18865,6 +18867,23 @@
     "Modified: / 08-03-2007 / 23:01:39 / cg"
 !
 
+variablesMenuVisible
+    |holder|
+
+    (holder := builder bindingAt:#variablesMenuVisible) isNil ifTrue:[
+        holder := BlockValue
+                        with:[:v | |n|
+                                n := self navigationState.
+                                n isProtocolOrFullProtocolBrowser not
+                                and:[n isMethodBrowser not
+                                and:[n isChainBrowser not]]
+                             ]
+                        argument:(self browserCanvas).
+        builder aspectAt:#variablesMenuVisible put: holder
+    ].
+    ^ holder
+!
+
 viewMenuForMethodListVisible
     |holder|
 
@@ -27302,39 +27321,43 @@
     "Modified: / 28-02-2012 / 16:45:08 / cg"
 !
 
-checkCompilabilityOf:aClass errorsOnly:errorsOnly notify:warningCollector reportFailedMethodsInto:aBlock
+checkCompilabilityOf:aClass withExtensions:withExtensions errorsOnly:errorsOnly notify:warningCollector reportFailedMethodsInto:aBlock
     "check compilability of aClass; write warning and errormessages to outStream.
      (meant for a human to read)"
 
     aClass theNonMetaclass withAllPrivateClassesDo:[:eachClass |
         eachClass instAndClassSelectorsAndMethodsDo:[:aSelector :aMethod | 
-            Parser parseWarningSignal 
-                handle:[:ex | ex proceed ]
-                do:[
-                    aMethod source isEmpty ifTrue:[
-                        aBlock value:aMethod value:('No source for method: ',aMethod whoString).
-                    ] ifFalse:[
-                        eachClass compilerClass new
-                            compile:aMethod source
-                            forClass:aMethod mclass
-                            inCategory:'others'
-                            notifying:warningCollector
-                            install:false
-                            skipIfSame:false
-                            silent:false
-                            foldConstants:true
-                            ifFail:[ 
-                                aBlock value:aMethod value:('not compilable: ',aMethod whoString).
-                            ]
+            (withExtensions
+              or:[ aMethod package = aClass package
+              or:[ aMethod isExtension == PackageId noProjectID ]]) ifTrue:[
+                Parser parseWarningSignal 
+                    handle:[:ex | ex proceed ]
+                    do:[
+                        aMethod source isEmpty ifTrue:[
+                            aBlock value:aMethod value:('No source for method: ',aMethod whoString).
+                        ] ifFalse:[
+                            eachClass compilerClass new
+                                compile:aMethod source
+                                forClass:aMethod mclass
+                                inCategory:'others'
+                                notifying:warningCollector
+                                install:false
+                                skipIfSame:false
+                                silent:false
+                                foldConstants:true
+                                ifFail:[ 
+                                    aBlock value:aMethod value:('not compilable: ',aMethod whoString).
+                                ]
+                        ]
                     ]
-                ]
+            ]
         ].
     ].
 
     "Created: / 13-06-2012 / 13:12:42 / cg"
 !
 
-checkCompilabilityOf:aClass errorsOnly:errorsOnly outputTo:outStream
+checkCompilabilityOf:aClass withExtensions:withExtensions errorsOnly:errorsOnly outputTo:outStream
     "check compilability of aClass; write warning and errormessages to outStream.
      (meant for a human to read).
      Returns a collection of failed methods (for browsing)"
@@ -27348,7 +27371,8 @@
     failedMethods := OrderedCollection new.
 
     self 
-        checkCompilabilityOf:aClass 
+        checkCompilabilityOf:aClass
+        withExtensions:withExtensions
         errorsOnly:errorsOnly 
         notify:warningCollector
         reportFailedMethodsInto:[:failedMethod :message |
@@ -27362,20 +27386,20 @@
     "Modified: / 13-06-2012 / 13:37:18 / cg"
 !
 
-checkCompilabilityOfAll:aCollectionOfClasses errorsOnly:errorsOnly
+checkCompilabilityOfAll:aCollectionOfClasses withExtensions:withExtensions errorsOnly:errorsOnly
     "check compilability of aClass; write warning and errormessages to outStream.
      (meant for a human to read)"
 
     |stream|
 
     stream := WriteStream on:(Text new:100).
-    self checkCompilabilityOfAll:aCollectionOfClasses errorsOnly:errorsOnly outputTo:stream.
+    self checkCompilabilityOfAll:aCollectionOfClasses withExtensions:withExtensions errorsOnly:errorsOnly outputTo:stream.
     ^ stream contents.
 
     "Created: / 02-11-2010 / 13:14:47 / cg"
 !
 
-checkCompilabilityOfAll:aCollectionOfClasses errorsOnly:errorsOnly outputTo:outStream
+checkCompilabilityOfAll:aCollectionOfClasses withExtensions:withExtensions errorsOnly:errorsOnly outputTo:outStream
     "check compilability of aClass; write warning and errormessages to outStream.
      (meant for a human to read)
      Returns a collection of failed methods (for browsing)"
@@ -27385,7 +27409,7 @@
     failedMethods := OrderedCollection new.
 
     aCollectionOfClasses do:[:eachClass |
-        failedMethods addAll:(self checkCompilabilityOf:eachClass errorsOnly:errorsOnly outputTo:outStream).
+        failedMethods addAll:(self checkCompilabilityOf:eachClass withExtensions:withExtensions errorsOnly:errorsOnly outputTo:outStream).
     ].
     ^ failedMethods.
 
@@ -27534,7 +27558,7 @@
     |stream allMessages badMethods|
 
     stream := WriteStream on:(Text new:100).
-    badMethods := self checkCompilabilityOfAll:(self selectedClasses value) errorsOnly:true outputTo:stream.
+    badMethods := self checkCompilabilityOfAll:(self selectedClasses value) withExtensions:true errorsOnly:true outputTo:stream.
     allMessages := stream contents.
 
     (TextBox openOn:allMessages title:'Errors and Warnings' readOnly:true).
@@ -27833,6 +27857,28 @@
             ]
 !
 
+classMenuEditResourceFiles
+    "fetch the class' package resource file for editing"
+
+    |files filename|
+
+    files := Set new.
+    self selectedClassesValue do:[:eachClass |
+        resources := eachClass theNonMetaclass projectDefinitionClass classResources.
+        resources notNil ifTrue:[
+            resources := resources projectPack.
+            resources notNil ifTrue:[
+                filename := resources packsFileName.
+                files add:filename
+            ]
+        ].
+    ].
+    files do:[:eachFile |
+        UserPreferences current fileBrowserClass
+            openOn:eachFile
+    ].
+!
+
 classMenuExcludeFromProject
     |projectDefinitionClasses|
 
@@ -32092,7 +32138,7 @@
 
     |classesNotInPackage utilities msg answer errors|
 
-    errors := self checkCompilabilityOfAll:aCollectionOfClasses errorsOnly:true.
+    errors := self checkCompilabilityOfAll:aCollectionOfClasses withExtensions:true "false" errorsOnly:true.
     errors notEmptyOrNil ifTrue:[
         (TextBox openOn:errors title:'Attention: about to check in class with errors' readOnly:true) isNil
         ifTrue:[
@@ -37077,6 +37123,7 @@
     "Modified: / 28-02-2012 / 16:27:44 / cg"
 ! !
 
+
 !NewSystemBrowser methodsFor:'menu actions-namespace'!
 
 nameSpaceMenuCheckOut
@@ -48468,6 +48515,17 @@
     "Modified: / 03-07-2011 / 14:40:57 / cg"
 !
 
+variablesMenu
+    <resource: #programMenu>
+
+    | menu |
+
+    menu := self class variablesMenu decodeAsLiteralArray.
+    menu receiver:self.
+    menu findGuiResourcesIn:self.
+    ^ menu
+!
+
 visitedClassesMenu
     <resource: #programMenu >
 
@@ -57948,11 +58006,11 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1817 2012-11-03 14:41:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1818 2012-11-06 17:50:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1817 2012-11-03 14:41:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1818 2012-11-06 17:50:29 cg Exp $'
 !
 
 version_SVN