src/macosx/classes/sun/lwawt/LWComponentPeer.java

Print this page

        

*** 983,993 **** } // DropTargetPeer Method @Override public void addDropTarget(DropTarget dt) { ! synchronized (dropTargetLock){ // 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only // if it's the first (or last) one for the component. Otherwise this call is a no-op. if (++fNumDropTargets == 1) { // Having a non-null drop target would be an error but let's check just in case: if (fDropTarget != null) --- 983,999 ---- } // DropTargetPeer Method @Override public void addDropTarget(DropTarget dt) { ! LWWindowPeer winPeer = getWindowPeerOrSelf(); ! if (winPeer != null && winPeer != this) { ! // We need to register the DropTarget in the ! // peer of the window ancestor of the component ! winPeer.addDropTarget(dt); ! } else { ! synchronized (dropTargetLock) { // 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only // if it's the first (or last) one for the component. Otherwise this call is a no-op. if (++fNumDropTargets == 1) { // Having a non-null drop target would be an error but let's check just in case: if (fDropTarget != null)
*** 996,1009 **** --- 1002,1022 ---- // Create a new drop target: fDropTarget = CDropTarget.createDropTarget(dt, target, this); } } } + } // DropTargetPeer Method @Override public void removeDropTarget(DropTarget dt) { + LWWindowPeer winPeer = getWindowPeerOrSelf(); + if (winPeer != null && winPeer != this) { + // We need to unregister the DropTarget in the + // peer of the window ancestor of the component + winPeer.removeDropTarget(dt); + } else { synchronized (dropTargetLock){ // 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only // if it's the first (or last) one for the component. Otherwise this call is a no-op. if (--fNumDropTargets == 0) { // Having a null drop target would be an error but let's check just in case:
*** 1014,1023 **** --- 1027,1037 ---- } else System.err.println("CComponent.removeDropTarget(): current drop target is null."); } } } + } // ---- PEER NOTIFICATIONS ---- // /** * Called when this peer's location has been changed either as a result