Bug 70370 [Viewers] ViewerDropAdapter couples auto-scroll and auto-expand
For some reason, the ViewerDropAdapter provides a single method to enable/disable auto scrolling and expanding when dropping. I have a view that hits the server when expanding a tree, so I don't want the auto-expansion but I still want the scrolling. I will attach a patch to ViewerDropAdapter that separates these.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerDropAdapter.java
if (!(event.item instanceof Item)) {
            return LOCATION_NONE;
        }
        Item item = (Item) event.item;
        Point coordinates = new Point(event.x, event.y);
        coordinates = viewer.getControl().toControl(coordinates);
        if (item != null) {
            Rectangle bounds = getBounds(item);
            if (bounds == null) {
                return LOCATION_NONE;
            }
            if ((coordinates.y - bounds.y) < 5) {
                return LOCATION_BEFORE;
            }
            if ((bounds.y + bounds.height - coordinates.y) < 5) {
                return LOCATION_AFTER;
            }
        }
        return LOCATION_ON;
    }
    /**
     * Returns the target item of the given drop event.
     *
     * @param event the event
     * @return The target of the drop, may be <code>null</code>.
     */
    protected Object determineTarget(DropTargetEvent event) {
        return event.item == null ? null : event.item.getData();
    }
    /* (non-Javadoc)