VDBThreadGroupPresenter.st
changeset 38 9b861cb882c8
parent 34 cda31dfd5386
child 40 d766d4c854a2
--- a/VDBThreadGroupPresenter.st	Fri Feb 27 16:50:43 2015 +0100
+++ b/VDBThreadGroupPresenter.st	Mon Mar 02 07:12:38 2015 +0000
@@ -1,5 +1,9 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'jv:vdb' }"
 
+"{ NameSpace: Smalltalk }"
+
 VDBModelPresenter subclass:#VDBThreadGroupPresenter
 	instanceVariableNames:'threadGroup'
 	classVariableNames:''
@@ -7,6 +11,7 @@
 	category:'VDB-Presentation'
 !
 
+
 !VDBThreadGroupPresenter methodsFor:'accessing'!
 
 icon
@@ -20,9 +25,31 @@
 !
 
 label
-    ^ threadGroup displayString
+    | pidOrEmpty state |
+
+    (threadGroup type = 'process' and:[ threadGroup pid notNil ]) ifTrue:[
+        pidOrEmpty := 'pid ', threadGroup pid printString , ', '.
+    ].
+    threadGroup isRunning ifTrue:[ 
+        state := 'running'
+    ] ifFalse:[ 
+        threadGroup isStopped ifTrue:[ 
+            state := 'stopped'
+        ] ifFalse:[ 
+            threadGroup isDead ifTrue:[ 
+                state := 'terminated'
+            ] ifFalse:[
+                state := 'not run'
+            ]
+        ].
+    ].
+
+    ^ 'thread group %1 [%2%3]' bindWith: threadGroup id 
+                                   with: pidOrEmpty ? ''
+                                   with: state
 
     "Created: / 22-09-2014 / 00:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-03-2015 / 06:58:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 threadGroup
@@ -58,3 +85,10 @@
     "Created: / 21-09-2014 / 23:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!VDBThreadGroupPresenter class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+