src/share/classes/java/awt/dnd/DragSourceContext.java

Print this page

        

*** 574,586 **** } if (newTrigger.getComponent() == null) { throw new InvalidObjectException("Null trigger component"); } ! int DGRActions = newTrigger.getSourceAsDragGestureRecognizer().getSourceActions() & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK); ! if (DGRActions == DnDConstants.ACTION_NONE) { throw new InvalidObjectException("Invalid source actions"); } int triggerActions = newTrigger.getDragAction(); if (triggerActions != DnDConstants.ACTION_COPY && triggerActions != DnDConstants.ACTION_MOVE && --- 574,586 ---- } if (newTrigger.getComponent() == null) { throw new InvalidObjectException("Null trigger component"); } ! int newSourceActions = f.get("sourceActions", 0) & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK); ! if (newSourceActions == DnDConstants.ACTION_NONE) { throw new InvalidObjectException("Invalid source actions"); } int triggerActions = newTrigger.getDragAction(); if (triggerActions != DnDConstants.ACTION_COPY && triggerActions != DnDConstants.ACTION_MOVE &&
*** 589,600 **** } trigger = newTrigger; cursor = (Cursor)f.get("cursor", null); useCustomCursor = f.get("useCustomCursor", false); ! sourceActions = f.get("sourceActions", 0) ! & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK); transferable = (Transferable)s.readObject(); listener = (DragSourceListener)s.readObject(); // Implementation assumes 'transferable' is never null. --- 589,599 ---- } trigger = newTrigger; cursor = (Cursor)f.get("cursor", null); useCustomCursor = f.get("useCustomCursor", false); ! sourceActions = newSourceActions; transferable = (Transferable)s.readObject(); listener = (DragSourceListener)s.readObject(); // Implementation assumes 'transferable' is never null.