This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 177506
Collapse All | Expand All

(-)a/openide.explorer/src/org/openide/explorer/view/OutlineView.java (+11 lines)
Lines 44-49 Link Here
44
import java.awt.Component;
44
import java.awt.Component;
45
import java.awt.Point;
45
import java.awt.Point;
46
import java.awt.Rectangle;
46
import java.awt.Rectangle;
47
import java.awt.datatransfer.Transferable;
47
import java.awt.event.ActionEvent;
48
import java.awt.event.ActionEvent;
48
import java.awt.event.MouseEvent;
49
import java.awt.event.MouseEvent;
49
import java.awt.dnd.DnDConstants;
50
import java.awt.dnd.DnDConstants;
Lines 734-739 Link Here
734
        return allowedDropActions;
735
        return allowedDropActions;
735
    }
736
    }
736
737
738
    /** Actions constants from {@link java.awt.dnd.DnDConstants}.
739
    * @param t The transferable for which the allowed drop actions are requested,
740
    *          or <code>null</code> to get actions for the creation of DropTarget for the view.
741
    * @return int representing set of actions which are allowed when dropping
742
    * into the asociated component. By default it returns {@link #getAllowedDropActions()}.
743
    */
744
    protected int getAllowedDropActions(Transferable t) {
745
        return getAllowedDropActions();
746
    }
747
737
    /** Sets allowed actions for dropping.
748
    /** Sets allowed actions for dropping.
738
    * @param actions new allowed drop actions, using {@link java.awt.dnd.DnDConstants}
749
    * @param actions new allowed drop actions, using {@link java.awt.dnd.DnDConstants}
739
    */
750
    */
(-)a/openide.explorer/src/org/openide/explorer/view/OutlineViewDropSupport.java (-5 / +5 lines)
Lines 161-167 Link Here
161
        ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true );
161
        ExplorerDnDManager.getDefault().setMaybeExternalDragAndDrop( true );
162
162
163
        int dropAction = dtde.getDropAction();
163
        int dropAction = dtde.getDropAction();
164
        int allowedDropActions = view.getAllowedDropActions();
164
        int allowedDropActions = view.getAllowedDropActions(dtde.getTransferable());
165
        dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
165
        dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
166
                dropAction, allowedDropActions);
166
                dropAction, allowedDropActions);
167
167
Lines 385-396 Link Here
385
        if( null == nodes )
385
        if( null == nodes )
386
            return;
386
            return;
387
        int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
387
        int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
388
                dtde.getDropAction(), view.getAllowedDropActions()
388
                dtde.getDropAction(), view.getAllowedDropActions(dtde.getTransferable())
389
            );
389
            );
390
390
391
        for (int i = 0; i < nodes.length; i++) {
391
        for (int i = 0; i < nodes.length; i++) {
392
            if (
392
            if (
393
                ((view.getAllowedDropActions() & dropAction) == 0) ||
393
                ((view.getAllowedDropActions(dtde.getTransferable()) & dropAction) == 0) ||
394
                    !DragDropUtilities.checkNodeForAction(nodes[i], dropAction)
394
                    !DragDropUtilities.checkNodeForAction(nodes[i], dropAction)
395
            ) {
395
            ) {
396
                // this action is not supported
396
                // this action is not supported
Lines 583-589 Link Here
583
        }
583
        }
584
584
585
        // Test to see if the target node supports the drop action
585
        // Test to see if the target node supports the drop action
586
        if ((view.getAllowedDropActions() & dropAction) == 0) {
586
        if ((view.getAllowedDropActions(dndEventTransferable) & dropAction) == 0) {
587
            return false;
587
            return false;
588
        }
588
        }
589
589
Lines 640-646 Link Here
640
640
641
            Node[] dragNodes = ExplorerDnDManager.getDefault().getDraggedNodes();
641
            Node[] dragNodes = ExplorerDnDManager.getDefault().getDraggedNodes();
642
            int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
642
            int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction(
643
                    dtde.getDropAction(), view.getAllowedDropActions()
643
                    dtde.getDropAction(), view.getAllowedDropActions(dtde.getTransferable())
644
                );
644
                );
645
645
646
            if (!canDrop(dropNode, dropAction, dtde.getTransferable())) {
646
            if (!canDrop(dropNode, dropAction, dtde.getTransferable())) {

Return to bug 177506