1 11 package org.eclipse.debug.internal.ui.views.breakpoints; 12 13 import org.eclipse.jface.viewers.IStructuredSelection; 14 import org.eclipse.jface.viewers.ViewerDropAdapter; 15 import org.eclipse.swt.dnd.DropTargetEvent; 16 import org.eclipse.swt.dnd.TransferData; 17 import org.eclipse.swt.widgets.Item; 18 import org.eclipse.ui.views.navigator.LocalSelectionTransfer; 19 20 23 public class BreakpointsDropAdapter extends ViewerDropAdapter { 24 25 private Item fTarget = null; 26 27 30 protected BreakpointsDropAdapter(BreakpointsViewer viewer) { 31 super(viewer); 32 setFeedbackEnabled(false); 33 } 34 35 38 public boolean performDrop(Object data) { 39 return ((BreakpointsViewer)getViewer()).performDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getInstance().getSelection()); 40 } 41 42 45 protected Object determineTarget(DropTargetEvent event) { 46 fTarget = (Item) event.item; 47 return fTarget; 48 } 49 50 53 public boolean validateDrop(Object target, int operation, TransferData transferType) { 54 return ((BreakpointsViewer)getViewer()).canDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getInstance().getSelection()); 55 } 56 } 57 | Popular Tags |