ElectronWorkstation.st
changeset 8771 cc7e3bf4b7ec
child 8772 4bfdf08ef358
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ElectronWorkstation.st	Thu Aug 15 14:06:30 2019 +0200
@@ -0,0 +1,62 @@
+"{ Package: 'stx:libview' }"
+
+"{ NameSpace: Smalltalk }"
+
+DeviceWorkstation subclass:#ElectronWorkstation
+	instanceVariableNames:'bridge'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Graphics'
+!
+
+!ElectronWorkstation class methodsFor:'documentation'!
+
+documentation
+"
+    ElectronWorkstation newFor:nil
+"
+! !
+
+!ElectronWorkstation methodsFor:'accessing & queries'!
+
+isOpen
+    "return true, if there is a valid connection to the display"
+
+    ^ bridge notNil
+! !
+
+!ElectronWorkstation methodsFor:'initialization & release'!
+
+closeConnection
+    "close down connection to Display - usually never done"
+
+    |b|
+
+    (b := bridge) notNil ifTrue:[
+        bridge := nil.
+        b close
+    ].
+
+    "Created: 13.1.1997 / 22:10:07 / cg"
+!
+
+initializeFor:aHostAndPortStringOrNil
+    bridge := NodeJSBridge newBridgeForHostAndPort:aHostAndPortStringOrNil.
+    bridge 
+        startBridgeIn:'.'
+        command:'node' 
+        environment:nil 
+        debug:false.
+    bridge connect.
+
+    "
+     ElectronWorkstation newFor:'localhost:8098'
+    "
+! !
+
+!ElectronWorkstation class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header$'
+! !
+