Skip to content

Commit b02fb5a

Browse files
author
Wenjun Che
committed
ADAP-23: keep up with adapter version 4.40.2.7
1 parent 66ab631 commit b02fb5a

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<dependency>
2121
<groupId>co.openfin</groupId>
2222
<artifactId>openfin-desktop-java-adapter</artifactId>
23-
<version>3.0.1.5</version>
23+
<version>4.40.2.7</version>
2424
</dependency>
2525
<dependency>
2626
<groupId>tablelayout</groupId>

src/main/java/com/openfin/desktop/demo/OpenFinDesktopDemo.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ protected JScrollPane layoutStatusPanel() {
289289

290290
private void closeWebSocket() {
291291
if (controller != null && controller.isConnected()) {
292-
controller.disconnect();
292+
try {
293+
controller.disconnect();
294+
} catch (DesktopException e) {
295+
e.printStackTrace();
296+
}
293297
}
294298
}
295299

@@ -376,7 +380,7 @@ public void run() {
376380
}
377381

378382

379-
private void createAdminApplication() {
383+
private void createAdminApplication() throws DesktopException {
380384
updateMessagePanel("Creating InterAppBus");
381385
bus = controller.getInterApplicationBus();
382386
openfinSystem = new System(controller);
@@ -396,6 +400,7 @@ public void eventReceived(com.openfin.desktop.ActionEvent actionEvent) {
396400
updateMessagePanel("startup app closed");
397401
}
398402
}, null);
403+
399404
}
400405

401406
openfinSystem.addEventListener("desktop-icon-clicked", new EventListener() {
@@ -423,8 +428,12 @@ private void runStartAction() {
423428
final DesktopStateListener listener = new DesktopStateListener() {
424429
@Override
425430
public void onReady() {
426-
updateMessagePanel("Connection authorized.");
427-
createAdminApplication();
431+
try {
432+
updateMessagePanel("Connection authorized.");
433+
createAdminApplication();
434+
} catch (DesktopException e) {
435+
e.printStackTrace();
436+
}
428437
}
429438
@Override
430439
public void onError(String reason) {

src/main/java/com/openfin/desktop/demo/WindowEmbedDemo.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,26 @@ public void onOutgoingMessage(String message) {
207207
}
208208
}
209209

210+
private boolean trayIconAdded = false;
211+
private Application startupHtml5app;
212+
210213
private void embedStartupApp() {
211214
try {
215+
if (startupHtml5app == null) {
216+
startupHtml5app = Application.wrap(this.startupUuid, this.controller);
217+
}
218+
if (!trayIconAdded) {
219+
startupHtml5app.setTrayIcon("http://icons.iconarchive.com/icons/marcus-roberto/google-play/512/Google-Search-icon.png", new EventListener() {
220+
public void eventReceived(ActionEvent actionEvent) {
221+
java.lang.System.out.println("Tray icon clicked");
222+
}
223+
}, null);
224+
trayIconAdded = true;
225+
} else {
226+
startupHtml5app.removeTrayIcon(null);
227+
trayIconAdded = false;
228+
}
229+
212230
Window html5Wnd = Window.wrap(startupUuid, startupUuid, controller);
213231
long parentHWndId = Native.getComponentID(this.embedCanvas);
214232
System.out.println("Canvas HWND " + Long.toHexString(parentHWndId));

0 commit comments

Comments
 (0)