#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 09 Nov 2017 22:17:36 +0100
changeset 8216 5e3ca2c2a0c5
parent 8215 a7e0abee3cb8
child 8217 ed76c62a1bd2
#FEATURE by cg class: DisplaySurface added: #instanceUuid #uuid #uuid:
DisplaySurface.st
--- a/DisplaySurface.st	Thu Nov 09 09:17:41 2017 +0100
+++ b/DisplaySurface.st	Thu Nov 09 22:17:36 2017 +0100
@@ -715,6 +715,27 @@
     "Modified: / 15.3.1999 / 08:25:10 / cg"
 !
 
+instanceUuid
+    "return my unique uuid.
+     This will be assigned once and only once per instance
+     (i.e. the same type of view within different applications will
+      have different instanceUuids)"
+
+    |id|
+
+    (id := self getAttribute:#instanceUuid) isNil ifTrue:[
+        self setAttribute:#instanceUuid to:(id := UUID new).
+    ].
+    ^ id
+
+    "
+     Transcript topView getAttribute:#instanceUuid    
+     Transcript topView instanceUuid    
+    "
+
+    "Created: / 09-11-2017 / 22:13:54 / cg"
+!
+
 isInputOnly
     "return true, if the receiver is an input only view - that is:
      the view will realize as a transparent view, into which you cannot
@@ -776,6 +797,35 @@
         Transcript setPointerPosition:Transcript extent // 2.
         Screen current rootView setPointerPosition:100@100.
     "
+!
+
+uuid
+    "return my uuid (for automation and the pollonium st/x capture/replay tool).
+     This is a widget id, as specified in the uispec (if it is defined there).
+     Will be the same for all instances 
+     (i.e. the same in different instances of the application).
+     Contrast this with the instanceUuid, which is unique for each view."
+
+    ^ uuid
+
+    "
+     Transcript topView uuid    
+     Transcript topView instanceUuid    
+    "
+
+    "Modified (comment): / 09-11-2017 / 22:16:56 / cg"
+!
+
+uuid:aUUID
+    "set my uuid (for automation and the pollonium st/x capture/replay tool).
+     This is a widget id, as specified in the uispec (if it is definedthere).
+     Will be the same for all instances 
+     (i.e. the same in different instances of the application).
+     Contrast this with the instanceUuid, which is unique for each view."
+
+    uuid := aUUID
+
+    "Modified (comment): / 09-11-2017 / 22:16:08 / cg"
 ! !
 
 !DisplaySurface methodsFor:'accessing-names'!