Skip to content

Commit 3f7136a

Browse files
author
Wenjun Che
committed
ADAP-42: fixed snap and dock example
1 parent 3b223f1 commit 3f7136a

File tree

4 files changed

+139
-377
lines changed

4 files changed

+139
-377
lines changed
4.02 KB
Binary file not shown.
-11.2 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.openfin.desktop.demo;
2+
3+
import com.openfin.desktop.*;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
6+
7+
import java.util.concurrent.CountDownLatch;
8+
import java.util.concurrent.TimeUnit;
9+
import java.util.concurrent.atomic.AtomicReference;
10+
11+
/**
12+
* Created by wche on 2/12/16.
13+
*/
14+
public class DemoUtils {
15+
private static Logger logger = LoggerFactory.getLogger(DemoUtils.class.getName());
16+
17+
public static void addEventListener(Window window, String evenType, EventListener eventListener) throws Exception {
18+
logger.debug("addEventListener " + evenType);
19+
CountDownLatch latch = new CountDownLatch(1);
20+
window.addEventListener(evenType, eventListener, null);
21+
// window.addEventListener(evenType, eventListener, new AckListener() {
22+
// @Override
23+
// public void onSuccess(Ack ack) {
24+
// latch.countDown();
25+
// logger.debug("addEventListener ack " + ack.isSuccessful());
26+
// }
27+
// @Override
28+
// public void onError(Ack ack) {
29+
// logger.error(String.format("Error adding event listener %s %s", evenType, ack.getReason()));
30+
// }
31+
// });
32+
// latch.await(5, TimeUnit.SECONDS);
33+
}
34+
35+
}

0 commit comments

Comments
 (0)