added:5 methods
authorClaus Gittinger <cg@exept.de>
Tue, 10 Aug 2010 15:07:19 +0200
changeset 9539 39ae73fc1d8b
parent 9538 1c979c56c36b
child 9540 9fb5a6c0f3bf
added:5 methods changed: #classMenuRecompileInstrumented #methodDebugMenu #runTestCasesForCoverage
NewSystemBrowser.st
Tools__NewSystemBrowser.st
--- a/NewSystemBrowser.st	Tue Aug 10 14:08:54 2010 +0200
+++ b/NewSystemBrowser.st	Tue Aug 10 15:07:19 2010 +0200
@@ -14,35 +14,35 @@
 "{ NameSpace: Tools }"
 
 SystemBrowser subclass:#NewSystemBrowser
-        instanceVariableNames:'navigationState bufferNameList selectedBuffer buffers
-                bufferUsageOrder browserCanvas immediateUpdate showClassPackages
-                lastMethodCategory lastMethodMoveClass browserCanvasType
-                syntaxColoringProcessRunning syntaxColoringProcess
-                methodInfoProcess'
-        classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
-                LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
-                LastNameSpaceMove LastMethodMoveOrCopyTargetClass
-                LastSearchPatterns LastClassFilterBlockString
-                LastMethodFilterBlockString LastBreakPointConditionString
-                LastIndividualChecks LastAcceptPackage LastVariableRenames
-                LastVisitorClassName LastTemporaryVariableName BookMarks
-                FindHistory CheckForInstancesWhenRemovingClasses
-                SynchronousUpdate DefaultIsNewBuffer DoubleClickIsOpenBrowser
-                ShowMethodTemplateWhenProtocolIsSelected
-                DefaultShowMethodTemplate DefaultShowMethodInheritance
-                DefaultEmphasizeUnloadedClasses DefaultImmediateSyntaxColoring
-                DefaultImmediateExplaining DefaultSyntaxColoring
-                DefaultToolBarVisible DefaultCodeInfoVisible
-                DefaultShortNameInTabs DefaultHideUnloadedClasses
-                DefaultMarkApplications DefaultAutoFormat
-                DefaultShowMethodComplexity DefaultShowMethodTypeIcon
-                DefaultShowSpecialResourceEditors SharedMethodCategoryCache
-                LastMethodProcessingBlockString PreviousBuildDirectory
-                LastLoadedPackage DefaultShortAllClassesInNameSpaceOrganisation
-                LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
-                LastRenamedOld LastRenamedNew'
-        poolDictionaries:''
-        category:'Interface-Browsers-New'
+	instanceVariableNames:'navigationState bufferNameList selectedBuffer buffers
+		bufferUsageOrder browserCanvas immediateUpdate showClassPackages
+		lastMethodCategory lastMethodMoveClass browserCanvasType
+		syntaxColoringProcessRunning syntaxColoringProcess
+		methodInfoProcess'
+	classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
+		LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
+		LastNameSpaceMove LastMethodMoveOrCopyTargetClass
+		LastSearchPatterns LastClassFilterBlockString
+		LastMethodFilterBlockString LastBreakPointConditionString
+		LastIndividualChecks LastAcceptPackage LastVariableRenames
+		LastVisitorClassName LastTemporaryVariableName BookMarks
+		FindHistory CheckForInstancesWhenRemovingClasses
+		SynchronousUpdate DefaultIsNewBuffer DoubleClickIsOpenBrowser
+		ShowMethodTemplateWhenProtocolIsSelected
+		DefaultShowMethodTemplate DefaultShowMethodInheritance
+		DefaultEmphasizeUnloadedClasses DefaultImmediateSyntaxColoring
+		DefaultImmediateExplaining DefaultSyntaxColoring
+		DefaultToolBarVisible DefaultCodeInfoVisible
+		DefaultShortNameInTabs DefaultHideUnloadedClasses
+		DefaultMarkApplications DefaultAutoFormat
+		DefaultShowMethodComplexity DefaultShowMethodTypeIcon
+		DefaultShowSpecialResourceEditors SharedMethodCategoryCache
+		LastMethodProcessingBlockString PreviousBuildDirectory
+		LastLoadedPackage DefaultShortAllClassesInNameSpaceOrganisation
+		LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
+		LastRenamedOld LastRenamedNew'
+	poolDictionaries:''
+	category:'Interface-Browsers-New'
 !
 
 !NewSystemBrowser class methodsFor:'documentation'!
@@ -7381,8 +7381,22 @@
             showBusyCursorWhilePerforming: true
             "/ enabled: hasAnyClassWithCoverageInfoSelectedHolder
           )
-         #(#MenuItem
-            #label: '-'
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            enabled: hasMethodSelectedAndInstrumentingCompilerExistsHolder
+            label: 'Recompile with Instrumentation'
+            itemValue: debugMenuRecompileMethodsInstrumented
+            translateLabel: true
+            showBusyCursorWhilePerforming: true
+          )
+         (MenuItem
+            enabled: hasMethodSelectedAndInstrumentingCompilerExistsAndOOMPackageLoadedHolder
+            label: 'Call Graph'
+            itemValue: debugMenuOpenCallGraphForMethods
+            translateLabel: true
+            showBusyCursorWhilePerforming: true
           )
          (MenuItem
             label: 'Clear all Coverage Info (Systemwide)'
@@ -7396,7 +7410,7 @@
       )
 
     "Created: / 11-09-2007 / 11:43:37 / cg"
-    "Modified: / 11-07-2010 / 17:43:50 / cg"
+    "Modified: / 10-08-2010 / 14:42:53 / cg"
 !
 
 methodListMenu
@@ -14071,6 +14085,20 @@
     "Created: / 4.2.2000 / 22:23:39 / cg"
 !
 
+hasMethodSelectedAndInstrumentingCompilerExistsAndOOMPackageLoadedHolder
+    ^ [ self hasMethodSelectedAndInstrumentingCompilerExistsHolder value 
+        and:[ OOM::MetricVisualizer notNil ] 
+      ]
+
+    "Created: / 10-08-2010 / 14:42:18 / cg"
+!
+
+hasMethodSelectedAndInstrumentingCompilerExistsHolder
+    ^ [ self hasMethodSelected and:[ self instrumentingCompilerExists] ]
+
+    "Created: / 10-08-2010 / 14:42:38 / cg"
+!
+
 hasMethodSelectedAndIsMethodListBrowser
     ^ self hasMethodSelected
       and:[navigationState isMethodListBrowser ]
@@ -21287,8 +21315,10 @@
 
 classMenuRecompileInstrumented
     self selectedClassesDo:[:eachClass |
-        self recompileWithInstrumentation:eachClass
-    ].
+        self recompileClassWithInstrumentation:eachClass
+    ].
+
+    "Modified: / 10-08-2010 / 14:36:42 / cg"
 !
 
 classMenuRegenerateProjectContentsDefinitions
@@ -21927,6 +21957,14 @@
     "Modified: / 11-08-2006 / 14:41:09 / cg"
 !
 
+debugMenuRecompileMethodsInstrumented
+    self selectedMethodsDo:[:eachMethod |
+        self recompileMethodWithInstrumentation:eachMethod
+    ].
+
+    "Created: / 10-08-2010 / 14:36:33 / cg"
+!
+
 doCompareClass:class1 withClass:class2
     "open a diff-textView comparing the two classes (useful when refactoring)."
 
@@ -22448,7 +22486,7 @@
     ]
 !
 
-recompileWithInstrumentation:aClass
+recompileClassWithInstrumentation:aClass
     |cls compile|
 
 "/    aClass theNonMetaclass recompileUsingCompilerClass:InstrumentingCompiler.
@@ -22474,6 +22512,20 @@
                 compile value:cls value:aSelector value:aMethod.
             ]
         ].
+
+    "Created: / 10-08-2010 / 14:36:45 / cg"
+!
+
+recompileMethodWithInstrumentation:aMethod
+    (aMethod sends:#subclassResponsibility) ifFalse:[
+        aMethod hasPrimitiveCode ifFalse:[
+            aMethod mclass 
+                recompile:aMethod selector
+                usingCompilerClass:InstrumentingCompiler
+        ]
+    ]
+
+    "Created: / 10-08-2010 / 14:41:17 / cg"
 !
 
 removeClasses:classesToRemove pullUpSubclasses:pullUpSubclasses
@@ -26729,7 +26781,7 @@
     testedClasses := testedClassNames collect:[:eachClassName | Smalltalk at:eachClassName].
 
     testedClasses do:[:eachClass | 
-        self recompileWithInstrumentation:eachClass
+        self recompileClassWithInstrumentation:eachClass
     ].
 
     self runTestCasesWithDebug:false protocols:nil.
@@ -26737,6 +26789,8 @@
     browser := self class browseClasses:testedClasses.
     browser showCoverageInformation value:true.
     browser windowLabel:'Coverage Info after Test Execution'.
+
+    "Modified: / 10-08-2010 / 14:36:51 / cg"
 !
 
 runTestCasesWithDebug
@@ -44532,11 +44586,11 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1472 2010-08-08 13:25:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1473 2010-08-10 13:07:19 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1472 2010-08-08 13:25:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1473 2010-08-10 13:07:19 cg Exp $'
 ! !
 
 NewSystemBrowser initialize!
--- a/Tools__NewSystemBrowser.st	Tue Aug 10 14:08:54 2010 +0200
+++ b/Tools__NewSystemBrowser.st	Tue Aug 10 15:07:19 2010 +0200
@@ -14,35 +14,35 @@
 "{ NameSpace: Tools }"
 
 SystemBrowser subclass:#NewSystemBrowser
-        instanceVariableNames:'navigationState bufferNameList selectedBuffer buffers
-                bufferUsageOrder browserCanvas immediateUpdate showClassPackages
-                lastMethodCategory lastMethodMoveClass browserCanvasType
-                syntaxColoringProcessRunning syntaxColoringProcess
-                methodInfoProcess'
-        classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
-                LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
-                LastNameSpaceMove LastMethodMoveOrCopyTargetClass
-                LastSearchPatterns LastClassFilterBlockString
-                LastMethodFilterBlockString LastBreakPointConditionString
-                LastIndividualChecks LastAcceptPackage LastVariableRenames
-                LastVisitorClassName LastTemporaryVariableName BookMarks
-                FindHistory CheckForInstancesWhenRemovingClasses
-                SynchronousUpdate DefaultIsNewBuffer DoubleClickIsOpenBrowser
-                ShowMethodTemplateWhenProtocolIsSelected
-                DefaultShowMethodTemplate DefaultShowMethodInheritance
-                DefaultEmphasizeUnloadedClasses DefaultImmediateSyntaxColoring
-                DefaultImmediateExplaining DefaultSyntaxColoring
-                DefaultToolBarVisible DefaultCodeInfoVisible
-                DefaultShortNameInTabs DefaultHideUnloadedClasses
-                DefaultMarkApplications DefaultAutoFormat
-                DefaultShowMethodComplexity DefaultShowMethodTypeIcon
-                DefaultShowSpecialResourceEditors SharedMethodCategoryCache
-                LastMethodProcessingBlockString PreviousBuildDirectory
-                LastLoadedPackage DefaultShortAllClassesInNameSpaceOrganisation
-                LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
-                LastRenamedOld LastRenamedNew'
-        poolDictionaries:''
-        category:'Interface-Browsers-New'
+	instanceVariableNames:'navigationState bufferNameList selectedBuffer buffers
+		bufferUsageOrder browserCanvas immediateUpdate showClassPackages
+		lastMethodCategory lastMethodMoveClass browserCanvasType
+		syntaxColoringProcessRunning syntaxColoringProcess
+		methodInfoProcess'
+	classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
+		LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
+		LastNameSpaceMove LastMethodMoveOrCopyTargetClass
+		LastSearchPatterns LastClassFilterBlockString
+		LastMethodFilterBlockString LastBreakPointConditionString
+		LastIndividualChecks LastAcceptPackage LastVariableRenames
+		LastVisitorClassName LastTemporaryVariableName BookMarks
+		FindHistory CheckForInstancesWhenRemovingClasses
+		SynchronousUpdate DefaultIsNewBuffer DoubleClickIsOpenBrowser
+		ShowMethodTemplateWhenProtocolIsSelected
+		DefaultShowMethodTemplate DefaultShowMethodInheritance
+		DefaultEmphasizeUnloadedClasses DefaultImmediateSyntaxColoring
+		DefaultImmediateExplaining DefaultSyntaxColoring
+		DefaultToolBarVisible DefaultCodeInfoVisible
+		DefaultShortNameInTabs DefaultHideUnloadedClasses
+		DefaultMarkApplications DefaultAutoFormat
+		DefaultShowMethodComplexity DefaultShowMethodTypeIcon
+		DefaultShowSpecialResourceEditors SharedMethodCategoryCache
+		LastMethodProcessingBlockString PreviousBuildDirectory
+		LastLoadedPackage DefaultShortAllClassesInNameSpaceOrganisation
+		LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
+		LastRenamedOld LastRenamedNew'
+	poolDictionaries:''
+	category:'Interface-Browsers-New'
 !
 
 !NewSystemBrowser class methodsFor:'documentation'!
@@ -7381,8 +7381,22 @@
             showBusyCursorWhilePerforming: true
             "/ enabled: hasAnyClassWithCoverageInfoSelectedHolder
           )
-         #(#MenuItem
-            #label: '-'
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            enabled: hasMethodSelectedAndInstrumentingCompilerExistsHolder
+            label: 'Recompile with Instrumentation'
+            itemValue: debugMenuRecompileMethodsInstrumented
+            translateLabel: true
+            showBusyCursorWhilePerforming: true
+          )
+         (MenuItem
+            enabled: hasMethodSelectedAndInstrumentingCompilerExistsAndOOMPackageLoadedHolder
+            label: 'Call Graph'
+            itemValue: debugMenuOpenCallGraphForMethods
+            translateLabel: true
+            showBusyCursorWhilePerforming: true
           )
          (MenuItem
             label: 'Clear all Coverage Info (Systemwide)'
@@ -7396,7 +7410,7 @@
       )
 
     "Created: / 11-09-2007 / 11:43:37 / cg"
-    "Modified: / 11-07-2010 / 17:43:50 / cg"
+    "Modified: / 10-08-2010 / 14:42:53 / cg"
 !
 
 methodListMenu
@@ -14071,6 +14085,20 @@
     "Created: / 4.2.2000 / 22:23:39 / cg"
 !
 
+hasMethodSelectedAndInstrumentingCompilerExistsAndOOMPackageLoadedHolder
+    ^ [ self hasMethodSelectedAndInstrumentingCompilerExistsHolder value 
+        and:[ OOM::MetricVisualizer notNil ] 
+      ]
+
+    "Created: / 10-08-2010 / 14:42:18 / cg"
+!
+
+hasMethodSelectedAndInstrumentingCompilerExistsHolder
+    ^ [ self hasMethodSelected and:[ self instrumentingCompilerExists] ]
+
+    "Created: / 10-08-2010 / 14:42:38 / cg"
+!
+
 hasMethodSelectedAndIsMethodListBrowser
     ^ self hasMethodSelected
       and:[navigationState isMethodListBrowser ]
@@ -21287,8 +21315,10 @@
 
 classMenuRecompileInstrumented
     self selectedClassesDo:[:eachClass |
-        self recompileWithInstrumentation:eachClass
-    ].
+        self recompileClassWithInstrumentation:eachClass
+    ].
+
+    "Modified: / 10-08-2010 / 14:36:42 / cg"
 !
 
 classMenuRegenerateProjectContentsDefinitions
@@ -21927,6 +21957,14 @@
     "Modified: / 11-08-2006 / 14:41:09 / cg"
 !
 
+debugMenuRecompileMethodsInstrumented
+    self selectedMethodsDo:[:eachMethod |
+        self recompileMethodWithInstrumentation:eachMethod
+    ].
+
+    "Created: / 10-08-2010 / 14:36:33 / cg"
+!
+
 doCompareClass:class1 withClass:class2
     "open a diff-textView comparing the two classes (useful when refactoring)."
 
@@ -22448,7 +22486,7 @@
     ]
 !
 
-recompileWithInstrumentation:aClass
+recompileClassWithInstrumentation:aClass
     |cls compile|
 
 "/    aClass theNonMetaclass recompileUsingCompilerClass:InstrumentingCompiler.
@@ -22474,6 +22512,20 @@
                 compile value:cls value:aSelector value:aMethod.
             ]
         ].
+
+    "Created: / 10-08-2010 / 14:36:45 / cg"
+!
+
+recompileMethodWithInstrumentation:aMethod
+    (aMethod sends:#subclassResponsibility) ifFalse:[
+        aMethod hasPrimitiveCode ifFalse:[
+            aMethod mclass 
+                recompile:aMethod selector
+                usingCompilerClass:InstrumentingCompiler
+        ]
+    ]
+
+    "Created: / 10-08-2010 / 14:41:17 / cg"
 !
 
 removeClasses:classesToRemove pullUpSubclasses:pullUpSubclasses
@@ -26729,7 +26781,7 @@
     testedClasses := testedClassNames collect:[:eachClassName | Smalltalk at:eachClassName].
 
     testedClasses do:[:eachClass | 
-        self recompileWithInstrumentation:eachClass
+        self recompileClassWithInstrumentation:eachClass
     ].
 
     self runTestCasesWithDebug:false protocols:nil.
@@ -26737,6 +26789,8 @@
     browser := self class browseClasses:testedClasses.
     browser showCoverageInformation value:true.
     browser windowLabel:'Coverage Info after Test Execution'.
+
+    "Modified: / 10-08-2010 / 14:36:51 / cg"
 !
 
 runTestCasesWithDebug
@@ -44532,11 +44586,11 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1472 2010-08-08 13:25:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1473 2010-08-10 13:07:19 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1472 2010-08-08 13:25:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1473 2010-08-10 13:07:19 cg Exp $'
 ! !
 
 NewSystemBrowser initialize!