|
2 | 2 |
|
3 | 3 | import com.openfin.desktop.*; |
4 | 4 | import com.openfin.desktop.System; |
| 5 | +import com.openfin.desktop.Window; |
5 | 6 | import com.openfin.desktop.animation.AnimationTransitions; |
6 | 7 | import com.openfin.desktop.animation.OpacityTransition; |
7 | 8 | import com.openfin.desktop.animation.PositionTransition; |
@@ -653,6 +654,38 @@ public void eventReceived(com.openfin.desktop.ActionEvent actionEvent) { |
653 | 654 | public void onError(Ack ack) { |
654 | 655 | } |
655 | 656 | }); |
| 657 | + |
| 658 | + // add a window event listener |
| 659 | + java.lang.System.out.println("Adding app-loaded event"); |
| 660 | + Window w = Window.wrap(options.getUUID(), "child0", desktopConnection); |
| 661 | + w.addEventListener("app-loaded", new EventListener() { |
| 662 | + public void eventReceived(com.openfin.desktop.ActionEvent actionEvent) { |
| 663 | + java.lang.System.out.println("Received " + actionEvent.getType()); |
| 664 | + } |
| 665 | + }, new AckListener() { |
| 666 | + public void onSuccess(Ack ack) { |
| 667 | + java.lang.System.out.println("app-loaded added"); |
| 668 | + } |
| 669 | + public void onError(Ack ack) { |
| 670 | + java.lang.System.out.println("failed to app-loaded"); |
| 671 | + } |
| 672 | + }); |
| 673 | + |
| 674 | + // add a window event listener |
| 675 | + java.lang.System.out.println("Adding app-connected event"); |
| 676 | + w.addEventListener("app-connected", new EventListener() { |
| 677 | + public void eventReceived(com.openfin.desktop.ActionEvent actionEvent) { |
| 678 | + java.lang.System.out.println("Received " + actionEvent.getType()); |
| 679 | + } |
| 680 | + }, new AckListener() { |
| 681 | + public void onSuccess(Ack ack) { |
| 682 | + java.lang.System.out.println("app-connected added"); |
| 683 | + } |
| 684 | + public void onError(Ack ack) { |
| 685 | + java.lang.System.out.println("failed to app-connected"); |
| 686 | + } |
| 687 | + }); |
| 688 | + |
656 | 689 | } catch (Exception e) { |
657 | 690 | e.printStackTrace(); |
658 | 691 | } |
|
0 commit comments