Skip to content

Commit a2ddd3d

Browse files
author
Wenjun Che
committed
ADAP-43: update comments for JUnit example
1 parent 70e403c commit a2ddd3d

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ private Application openWindow(String uuid, String url) throws Exception {
120120
return openWindow(uuid, url, left, top, width, height, withFrame, resizable);
121121
}
122122

123+
/**
124+
* Create an OpenFin Application
125+
* @param uuid uuid of the app
126+
* @param url url of the app
127+
* @param left
128+
* @param top
129+
* @param width
130+
* @param height
131+
* @param withFrame
132+
* @param resizable
133+
* @return
134+
* @throws Exception
135+
*/
123136
private Application openWindow(final String uuid, final String url, final int left, final int top, final int width, final int height, boolean withFrame, boolean resizable) throws Exception {
124137
final WindowOptions windowOptions = new WindowOptions();
125138
windowOptions.setAutoShow(true);
@@ -147,7 +160,7 @@ private Application openWindow(final String uuid, final String url, final int le
147160
public void onSuccess(Ack ack) {
148161
try {
149162
Application application = (Application) ack.getSource();
150-
163+
// use app-connected event to wait for the app to be connected to OpenFin Runtime
151164
application.getWindow().addEventListener("app-connected", new EventListener() {
152165
public void eventReceived(ActionEvent actionEvent) {
153166
printf("eventReceived: %s", actionEvent.getType());
@@ -513,6 +526,19 @@ public void onSuccess(WindowBounds result) {
513526
return windowBounds;
514527
}
515528

529+
/**
530+
* Create a child window for an Application
531+
*
532+
* @param application owner application
533+
* @param name name of the child window
534+
* @param url url of the child window
535+
* @param width
536+
* @param height
537+
* @param left
538+
* @param top
539+
* @return
540+
* @throws Exception
541+
*/
516542
private Window createChildWindow(Application application, final String name, String url, int width, int height, int left, int top) throws Exception {
517543

518544
WindowOptions options = new WindowOptions(name, url);
@@ -524,6 +550,7 @@ private Window createChildWindow(Application application, final String name, Str
524550
options.setDefaultTop(top);
525551

526552
final CountDownLatch onWindowCreatedLatch = new CountDownLatch(1);
553+
// use window-end-load event to wait for the window to finish loading
527554
application.addEventListener("window-end-load", new EventListener() {
528555
public void eventReceived(ActionEvent actionEvent) {
529556
printf("eventReceived: %s for window %s to listener %s", actionEvent.getType(), actionEvent.getEventObject().getString("name"), name);

0 commit comments

Comments
 (0)