another sort option
authorClaus Gittinger <cg@exept.de>
Tue, 05 Sep 2000 21:15:26 +0200
changeset 2757 3c4469a96d66
parent 2756 183efc156402
child 2758 57afd37bf499
another sort option
MemoryUsageView.st
--- a/MemoryUsageView.st	Mon Sep 04 17:46:57 2000 +0200
+++ b/MemoryUsageView.st	Tue Sep 05 21:15:26 2000 +0200
@@ -311,12 +311,39 @@
 
 sortByClass
     self label:'Memory usage; by class'.
-    sortBlock := [:a :b | (a at:1) displayString < (b at:1) displayString].
+    sortBlock := [:a :b | |c1 c2 s1 s2|
+
+                          c1 := (a at:1).
+                          c2 := (b at:1).
+
+                          s1 := c1 isBehavior ifTrue:[ c1 name] ifFalse:[ c1 displayString ].
+                          s2 := c2 isBehavior ifTrue:[ c2 name ] ifFalse:[ c2 displayString ].
+                          s1 < s2].
     self updateDisplay
 
     "Modified: 28.6.1996 / 14:32:38 / cg"
 !
 
+sortByClassNameWithoutPrefix
+    self label:'Memory usage; by className without prefix'.
+    sortBlock := [:a :b | |c1 c2 s1 s2|
+
+                          c1 := (a at:1).
+                          c2 := (b at:1).
+
+                          s1 := c1 isBehavior ifTrue:[ c1 nameWithoutPrefix ] ifFalse:[ c1 displayString ].
+                          s2 := c2 isBehavior ifTrue:[ c2 nameWithoutPrefix ] ifFalse:[ c2 displayString ].
+                          s1 < s2].
+    self updateDisplay
+
+
+
+
+
+
+
+!
+
 sortByInstCount
     self label:'Memory usage; by instance count'.
 "/    sortBlock := [:a :b | (a at:2) > (b at:2) ].
@@ -369,7 +396,8 @@
 
     m := PopUpMenu
                 itemList:#(
-                     ('sort by class'                   sortByClass                             )
+                     ('sort by class name'              sortByClass                             )
+                     ('sort by classes base name'       sortByClassNameWithoutPrefix            )
                      ('sort by inst count'              sortByInstCount                         )
                      ('sort by memory usage'            sortByMemoryUsage                       )
                      ('sort by average size'            sortByAverageSize                       )
@@ -587,5 +615,5 @@
 !MemoryUsageView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.39 2000-08-15 14:15:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.40 2000-09-05 19:15:26 cg Exp $'
 ! !