Skip to content

Commit cc42a8b

Browse files
committed
ADAP-159: added launchExternal.html
1 parent fc1dad9 commit cc42a8b

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

release/docking.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ REM batch to run Docking example of OpenFin and Java windows with Layout service
22
REM layout.html is a simple example of OpenFin window that uses Layout service.
33
REM For this example to work, layout.html needs to be hosted by a web server and its URL needs to be configured with -Dcom.openfin.demo.layout.url
44

5-
java -cp openfin-desktop-java-example-7.1.1.jar;openfin-desktop-java-adapter-7.1.1.jar;TableLayout-20050920.jar;jna-4.1.0.jar;jna-platform-4.1.0.jar;json-20140107.jar;slf4j-api-1.7.5.jar;slf4j-jdk14-1.6.1.jar;websocket-api-9.3.12.v20160915.jar;websocket-client-9.3.12.v20160915.jar;websocket-common-9.3.12.v20160915.jar;jetty-io-9.3.12.v20160915.jar;jetty-util-9.3.12.v20160915.jar -Djava.util.logging.config.file=logging.properties -Dcom.openfin.demo.layout.url=http://localhost:8008/layout.html com.openfin.desktop.demo.LayoutServiceDemo
5+
cd /D "%~dp0"
6+
gi
7+
java -cp openfin-desktop-java-example-7.1.1.jar;openfin-desktop-java-adapter-7.1.2.jar;TableLayout-20050920.jar;jna-4.1.0.jar;jna-platform-4.1.0.jar;json-20140107.jar;slf4j-api-1.7.5.jar;slf4j-jdk14-1.6.1.jar;websocket-api-9.3.12.v20160915.jar;websocket-client-9.3.12.v20160915.jar;websocket-common-9.3.12.v20160915.jar;jetty-io-9.3.12.v20160915.jar;jetty-util-9.3.12.v20160915.jar -Djava.util.logging.config.file=logging.properties -Dcom.openfin.demo.layout.url=http://localhost:8008/layout.html com.openfin.desktop.demo.LayoutServiceDemo

release/launchExternal.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<html>
2+
<head>
3+
<title>LaunchExternalProcess example</title>
4+
5+
<script type="text/javascript">
6+
7+
window.addEventListener("DOMContentLoaded", function() {
8+
9+
fin.desktop.InterApplicationBus.subscribe('*', 'messageFromJavaTopic', m => {
10+
document.getElementById("messageFromJava").innerText = JSON.stringify(m);
11+
console.log(m);
12+
});
13+
14+
});
15+
16+
function launch() {
17+
const inputBox = document.getElementById('path');
18+
19+
20+
fin.System.launchExternalProcess({
21+
path: inputBox.value,
22+
arguments: "",
23+
listener: function (result) {
24+
console.log('the exit code', result.exitCode);
25+
}
26+
}).then(processIdentity => console.log(processIdentity)).catch(err => console.log(err));
27+
}
28+
29+
</script>
30+
</head>
31+
<body>
32+
<script>
33+
34+
</script>
35+
36+
<p>LaunchExternalProcess example</p>
37+
<div id="messageFromJava">
38+
</div>
39+
<div>
40+
Full Path <input id="path" type="text" style="width: 400px" ></input>
41+
<Button id="launch" onclick="launch()"> Launch </Button>
42+
</div>
43+
44+
</body>
45+
</html>

0 commit comments

Comments
 (0)