38 import sun.misc.Unsafe;
39
40 /**
41 * XDragSourceProtocol implementation for XDnD protocol.
42 *
43 * @since 1.5
44 */
45 class XDnDDragSourceProtocol extends XDragSourceProtocol {
46 private static final PlatformLogger logger =
47 PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
48
49 private static final Unsafe unsafe = XlibWrapper.unsafe;
50
51 protected XDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
52 super(listener);
53 }
54
55 /**
56 * Creates an instance associated with the specified listener.
57 *
58 * @throws NullPointerException if listener is <code>null</code>.
59 */
60 static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) {
61 return new XDnDDragSourceProtocol(listener);
62 }
63
64 public String getProtocolName() {
65 return XDragAndDropProtocols.XDnD;
66 }
67
68 /**
69 * Performs protocol-specific drag initialization.
70 *
71 * @return true if the initialized successfully.
72 */
73 protected void initializeDragImpl(int actions, Transferable contents,
74 Map<Long, DataFlavor> formatMap, long[] formats)
75 throws InvalidDnDOperationException,
76 IllegalArgumentException, XException {
77 assert XToolkit.isAWTLockHeldByCurrentThread();
78
|
38 import sun.misc.Unsafe;
39
40 /**
41 * XDragSourceProtocol implementation for XDnD protocol.
42 *
43 * @since 1.5
44 */
45 class XDnDDragSourceProtocol extends XDragSourceProtocol {
46 private static final PlatformLogger logger =
47 PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
48
49 private static final Unsafe unsafe = XlibWrapper.unsafe;
50
51 protected XDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
52 super(listener);
53 }
54
55 /**
56 * Creates an instance associated with the specified listener.
57 *
58 * @throws NullPointerException if listener is {@code null}.
59 */
60 static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) {
61 return new XDnDDragSourceProtocol(listener);
62 }
63
64 public String getProtocolName() {
65 return XDragAndDropProtocols.XDnD;
66 }
67
68 /**
69 * Performs protocol-specific drag initialization.
70 *
71 * @return true if the initialized successfully.
72 */
73 protected void initializeDragImpl(int actions, Transferable contents,
74 Map<Long, DataFlavor> formatMap, long[] formats)
75 throws InvalidDnDOperationException,
76 IllegalArgumentException, XException {
77 assert XToolkit.isAWTLockHeldByCurrentThread();
78
|