src/share/classes/sun/awt/datatransfer/SunClipboard.java

Print this page

        

*** 148,158 **** /** * @return the contents of this clipboard if it has been set from the same * AppContext as it is currently retrieved or null otherwise * @since 1.5 */ ! private synchronized Transferable getContextContents() { AppContext context = AppContext.getAppContext(); return (context == contentsContext) ? contents : null; } --- 148,158 ---- /** * @return the contents of this clipboard if it has been set from the same * AppContext as it is currently retrieved or null otherwise * @since 1.5 */ ! protected synchronized Transferable getContextContents() { AppContext context = AppContext.getAppContext(); return (context == contentsContext) ? contents : null; }
*** 279,290 **** final AppContext context = this.contentsContext; if (context == null) { return; } ! final Runnable runnable = new Runnable() { ! public void run() { final SunClipboard sunClipboard = SunClipboard.this; ClipboardOwner owner = null; Transferable contents = null; synchronized (sunClipboard) { --- 279,293 ---- final AppContext context = this.contentsContext; if (context == null) { return; } ! SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext), ! PeerEvent.PRIORITY_EVENT)); ! } ! ! protected void lostOwnershipNow(final AppContext disposedContext) { final SunClipboard sunClipboard = SunClipboard.this; ClipboardOwner owner = null; Transferable contents = null; synchronized (sunClipboard) {
*** 309,323 **** } if (owner != null) { owner.lostOwnership(sunClipboard, contents); } } - }; - SunToolkit.postEvent(context, new PeerEvent(this, runnable, - PeerEvent.PRIORITY_EVENT)); - } protected abstract void clearNativeContext(); protected abstract void setContentsNative(Transferable contents); --- 312,322 ----