src/java.desktop/share/classes/java/awt/dnd/DropTargetContext.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 88,110 **** */ public Component getComponent() { return dropTarget.getComponent(); } /** ! * Called when associated with the <code>DropTargetContextPeer</code>. * ! * @param dtcp the <code>DropTargetContextPeer</code> */ ! ! public void addNotify(DropTargetContextPeer dtcp) { ! dropTargetContextPeer = dtcp; } /** * Called when disassociated with the <code>DropTargetContextPeer</code>. */ - public void removeNotify() { dropTargetContextPeer = null; transferable = null; } --- 88,113 ---- */ public Component getComponent() { return dropTarget.getComponent(); } /** ! * Called when associated with the peer object. * ! * @param dtcp the peer object ! * @throws IllegalArgumentException if provided peer is not supported */ ! public void addNotify(final Object dtcp) throws IllegalArgumentException { ! if (dtcp instanceof DropTargetContextPeer) { ! dropTargetContextPeer = (DropTargetContextPeer) dtcp; ! } else { ! throw new IllegalArgumentException("Unsupported peer"); ! } } /** * Called when disassociated with the <code>DropTargetContextPeer</code>. */ public void removeNotify() { dropTargetContextPeer = null; transferable = null; }
*** 410,420 **** /** * The DropTarget associated with this DropTargetContext. * * @serial */ ! private DropTarget dropTarget; private transient DropTargetContextPeer dropTargetContextPeer; private transient Transferable transferable; } --- 413,423 ---- /** * The DropTarget associated with this DropTargetContext. * * @serial */ ! private final DropTarget dropTarget; private transient DropTargetContextPeer dropTargetContextPeer; private transient Transferable transferable; }