Extract #getProcessList to support easy subclasses.
authorStefan Vogel <sv@exept.de>
Mon, 29 Mar 1999 16:52:58 +0200
changeset 2084 0445a6a61d45
parent 2083 3ebaf8eceeaf
child 2085 ec4daf11d3b6
Extract #getProcessList to support easy subclasses.
ProcMonitor.st
ProcessMonitor.st
--- a/ProcMonitor.st	Mon Mar 29 12:07:18 1999 +0200
+++ b/ProcMonitor.st	Mon Mar 29 16:52:58 1999 +0200
@@ -117,32 +117,28 @@
     |newList|
 
     shown ifTrue:[
-	showDetail ifTrue:[
-	    newList := Process allSubInstances asOrderedCollection.
-	] ifFalse:[
-	    newList := ProcessorScheduler knownProcesses asOrderedCollection.
-	].
+        newList := self getProcessList.
 
-	"sort by id - take care of nil ids of dead processes"
-	newList sort:[:p1 :p2 |
-			 |id1 id2|
+        "sort by id - take care of nil ids of dead processes"
+        newList sort:[:p1 :p2 |
+                         |id1 id2|
 
-			 (p1 isNil or:[(id1 := p1 id) isNil])
-			     ifTrue:[true]
-			     ifFalse:[
-				 (p2 isNil or:[(id2 := p2 id) isNil])
-				     ifTrue:[false]
-				     ifFalse:[id1 < id2]
-			 ]
-		     ].
-	newList ~= processes ifTrue:[
-	    processes := WeakArray withAll:newList.
-	    self updateStatus
-	].
+                         (p1 isNil or:[(id1 := p1 id) isNil])
+                             ifTrue:[true]
+                             ifFalse:[
+                                 (p2 isNil or:[(id2 := p2 id) isNil])
+                                     ifTrue:[false]
+                                     ifFalse:[id1 < id2]
+                         ]
+                     ].
+        newList ~= processes ifTrue:[
+            processes := WeakArray withAll:newList.
+            self updateStatus
+        ].
     ].
     updateBlock notNil ifTrue:[
-	Processor removeTimedBlock:listUpdateBlock.
-	Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay
+        Processor removeTimedBlock:listUpdateBlock.
+        Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay
     ].
 
     "Modified: 3.7.1996 / 13:37:29 / stefan"
@@ -698,6 +694,22 @@
     "Modified: 23.1.1997 / 02:34:49 / cg"
 ! !
 
+!ProcessMonitor methodsFor:'process selection'!
+
+getProcessList
+    "select processes to display.
+     Subclasses may redefine this"
+
+    |coll|
+
+    showDetail ifTrue:[
+        coll := Process allSubInstances asOrderedCollection.
+    ] ifFalse:[
+        coll := ProcessorScheduler knownProcesses asOrderedCollection.
+    ].
+    ^ coll
+! !
+
 !ProcessMonitor methodsFor:'user actions'!
 
 doubleClicked
@@ -711,5 +723,5 @@
 !ProcessMonitor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/ProcMonitor.st,v 1.68 1999-02-14 10:24:45 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/ProcMonitor.st,v 1.69 1999-03-29 14:52:58 stefan Exp $'
 ! !
--- a/ProcessMonitor.st	Mon Mar 29 12:07:18 1999 +0200
+++ b/ProcessMonitor.st	Mon Mar 29 16:52:58 1999 +0200
@@ -117,32 +117,28 @@
     |newList|
 
     shown ifTrue:[
-	showDetail ifTrue:[
-	    newList := Process allSubInstances asOrderedCollection.
-	] ifFalse:[
-	    newList := ProcessorScheduler knownProcesses asOrderedCollection.
-	].
+        newList := self getProcessList.
 
-	"sort by id - take care of nil ids of dead processes"
-	newList sort:[:p1 :p2 |
-			 |id1 id2|
+        "sort by id - take care of nil ids of dead processes"
+        newList sort:[:p1 :p2 |
+                         |id1 id2|
 
-			 (p1 isNil or:[(id1 := p1 id) isNil])
-			     ifTrue:[true]
-			     ifFalse:[
-				 (p2 isNil or:[(id2 := p2 id) isNil])
-				     ifTrue:[false]
-				     ifFalse:[id1 < id2]
-			 ]
-		     ].
-	newList ~= processes ifTrue:[
-	    processes := WeakArray withAll:newList.
-	    self updateStatus
-	].
+                         (p1 isNil or:[(id1 := p1 id) isNil])
+                             ifTrue:[true]
+                             ifFalse:[
+                                 (p2 isNil or:[(id2 := p2 id) isNil])
+                                     ifTrue:[false]
+                                     ifFalse:[id1 < id2]
+                         ]
+                     ].
+        newList ~= processes ifTrue:[
+            processes := WeakArray withAll:newList.
+            self updateStatus
+        ].
     ].
     updateBlock notNil ifTrue:[
-	Processor removeTimedBlock:listUpdateBlock.
-	Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay
+        Processor removeTimedBlock:listUpdateBlock.
+        Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay
     ].
 
     "Modified: 3.7.1996 / 13:37:29 / stefan"
@@ -698,6 +694,22 @@
     "Modified: 23.1.1997 / 02:34:49 / cg"
 ! !
 
+!ProcessMonitor methodsFor:'process selection'!
+
+getProcessList
+    "select processes to display.
+     Subclasses may redefine this"
+
+    |coll|
+
+    showDetail ifTrue:[
+        coll := Process allSubInstances asOrderedCollection.
+    ] ifFalse:[
+        coll := ProcessorScheduler knownProcesses asOrderedCollection.
+    ].
+    ^ coll
+! !
+
 !ProcessMonitor methodsFor:'user actions'!
 
 doubleClicked
@@ -711,5 +723,5 @@
 !ProcessMonitor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.68 1999-02-14 10:24:45 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.69 1999-03-29 14:52:58 stefan Exp $'
 ! !