本文整理匯總了Java中java.awt.datatransfer.ClipboardOwner.lostOwnership方法的典型用法代碼示例。如果您正苦於以下問題:Java ClipboardOwner.lostOwnership方法的具體用法?Java ClipboardOwner.lostOwnership怎麽用?Java ClipboardOwner.lostOwnership使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.datatransfer.ClipboardOwner
的用法示例。
在下文中一共展示了ClipboardOwner.lostOwnership方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: lostOwnershipNow
import java.awt.datatransfer.ClipboardOwner; //導入方法依賴的package包/類
protected void lostOwnershipNow(final AppContext disposedContext) {
final SunClipboard sunClipboard = SunClipboard.this;
ClipboardOwner owner = null;
Transferable contents = null;
synchronized (sunClipboard) {
final AppContext context = sunClipboard.contentsContext;
if (context == null) {
return;
}
if (disposedContext == null || context == disposedContext) {
owner = sunClipboard.owner;
contents = sunClipboard.contents;
sunClipboard.contentsContext = null;
sunClipboard.owner = null;
sunClipboard.contents = null;
sunClipboard.clearNativeContext();
context.removePropertyChangeListener
(AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
} else {
return;
}
}
if (owner != null) {
owner.lostOwnership(sunClipboard, contents);
}
}