public synchronized void addFlavorListener(FlavorListener listener) {
if (listener == null) {
return;
}
AppContext appContext = AppContext.getAppContext();
Set<FlavorListener> flavorListeners = getFlavorListeners(appContext);
if (flavorListeners == null) {
flavorListeners = new HashSet<>();
appContext.put(CLIPBOARD_FLAVOR_LISTENER_KEY, flavorListeners);
}
flavorListeners.add(listener);
if (numberOfFlavorListeners++ == 0) {
long[] currentFormats = null;
try {
openClipboard(null);
currentFormats = getClipboardFormats();
} catch (final IllegalStateException ignored) {
} finally {
closeClipboard();
}
this.currentFormats = currentFormats;
registerClipboardViewerChecked();
}
}
SunClipboard.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:openjdk-jdk10
作者:
评论列表
文章目录