### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.navigator Index: plugin.xml =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/plugin.xml,v retrieving revision 1.10 diff -u -r1.10 plugin.xml --- plugin.xml 22 Feb 2006 17:11:25 -0000 1.10 +++ plugin.xml 24 Feb 2006 16:34:35 -0000 @@ -4,7 +4,6 @@ - - + - - Index: src/org/eclipse/ui/navigator/CommonDragAdapter.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDragAdapter.java,v retrieving revision 1.3 diff -u -r1.3 CommonDragAdapter.java --- src/org/eclipse/ui/navigator/CommonDragAdapter.java 22 Feb 2006 20:39:48 -0000 1.3 +++ src/org/eclipse/ui/navigator/CommonDragAdapter.java 24 Feb 2006 16:34:41 -0000 @@ -86,7 +86,7 @@ * @see LocalSelectionTransfer * @see PluginTransfer */ - public Transfer[] getSupportDragTransfers() { + public Transfer[] getSupportedDragTransfers() { CommonDragAdapterAssistant[] assistants = contentService .getDnDService().getCommonDragAssistants(); @@ -184,8 +184,9 @@ if (DEBUG) System.out .println("CommonDragAdapter.dragSetData set assistant transfer type"); //$NON-NLS-1$ - assistants[i].setDragData(event, - (IStructuredSelection) selection); + if(assistants[i].setDragData(event, + (IStructuredSelection) selection)) + return; } catch (RuntimeException re) { NavigatorPlugin.logError(0, re.getMessage(), re); } Index: src/org/eclipse/ui/navigator/CommonDragAdapterAssistant.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDragAdapterAssistant.java,v retrieving revision 1.2 diff -u -r1.2 CommonDragAdapterAssistant.java --- src/org/eclipse/ui/navigator/CommonDragAdapterAssistant.java 22 Feb 2006 17:11:25 -0000 1.2 +++ src/org/eclipse/ui/navigator/CommonDragAdapterAssistant.java 24 Feb 2006 16:34:42 -0000 @@ -60,10 +60,13 @@ *

* CommonDragAdapterAssistants can extend the available TransferTypes that a * Common Navigator Viewer can generate. Clients should return the set of - * Transfer Types they support.When a match is found for a particular - * {@link DragSourceEvent}, - * {@link #setDragData(DragSourceEvent, IStructuredSelection)} will be - * called directly after. + * Transfer Types they support. When a drop event occurs, the available drag + * assistants will be searched for a enabled assistants for the + * {@link DragSourceEvent}. Only if the drop event occurs will + * {@link #setDragData(DragSourceEvent, IStructuredSelection)} be called. If + * the drop event is cancelled, + * {@link #setDragData(DragSourceEvent, IStructuredSelection)} will not be + * called. *

* * @return The added transfer types. (e.g. FileTransfer.getInstance()). @@ -76,14 +79,20 @@ * returned a matching Transfer Type from * {@link #getSupportedTransferTypes()} for the * {@link DragSourceEvent#dataType}. + *

+ * Clients will only have an opportunity to set the data when the drop event + * occurs. If the drop operation is cancelled, then this method will not be + * called. + *

* * @param anEvent * The event object should have its {@link Event#data} field set * to a value that matches a supported {@link TransferData} type. * @param aSelection * The current selection from the viewer. + * @return True if the data could be set; false otherwise. */ - public abstract void setDragData(DragSourceEvent anEvent, + public abstract boolean setDragData(DragSourceEvent anEvent, IStructuredSelection aSelection); /** Index: src/org/eclipse/ui/navigator/CommonViewer.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewer.java,v retrieving revision 1.15 diff -u -r1.15 CommonViewer.java --- src/org/eclipse/ui/navigator/CommonViewer.java 23 Feb 2006 18:21:45 -0000 1.15 +++ src/org/eclipse/ui/navigator/CommonViewer.java 24 Feb 2006 16:34:42 -0000 @@ -94,7 +94,7 @@ CommonDragAdapter dragAdapter = new CommonDragAdapter(contentService, this); - addDragSupport(operations, dragAdapter.getSupportDragTransfers(), + addDragSupport(operations, dragAdapter.getSupportedDragTransfers(), dragAdapter); CommonDropAdapter dropAdapter = new CommonDropAdapter(contentService, Index: src/org/eclipse/ui/internal/navigator/extensions/SkeletonCommonDragAssistant.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonCommonDragAssistant.java,v retrieving revision 1.1 diff -u -r1.1 SkeletonCommonDragAssistant.java --- src/org/eclipse/ui/internal/navigator/extensions/SkeletonCommonDragAssistant.java 9 Feb 2006 21:32:09 -0000 1.1 +++ src/org/eclipse/ui/internal/navigator/extensions/SkeletonCommonDragAssistant.java 24 Feb 2006 16:34:41 -0000 @@ -50,8 +50,9 @@ * @see org.eclipse.ui.navigator.CommonDragAdapterAssistant#setDragData(org.eclipse.swt.dnd.DragSourceEvent, * org.eclipse.jface.viewers.IStructuredSelection) */ - public void setDragData(DragSourceEvent anEvent, + public boolean setDragData(DragSourceEvent anEvent, IStructuredSelection aSelection) { + return false; } Index: schema/navigatorContent.exsd =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/schema/navigatorContent.exsd,v retrieving revision 1.23 diff -u -r1.23 navigatorContent.exsd --- schema/navigatorContent.exsd 22 Feb 2006 17:11:25 -0000 1.23 +++ schema/navigatorContent.exsd 24 Feb 2006 16:34:38 -0000 @@ -86,7 +86,7 @@ - + @@ -515,7 +515,7 @@ - + Provides a subclass of <code>org.eclipse.ui.navigator.CommonDropAdapterAssistant</code> which can provide programatic validation for a drop operation, request additional transfer types, and handle the drop operation. @@ -524,7 +524,6 @@ <br><br> An extension may have multiple drop adapters with mutually exclusive <b>possibleDropTargets</b> expressions. The first drop adapter found that matches the given drop target and returns an OK status for <code>CommonDropAdapterAssistant.validateDrop(...)</code> will be given an opportunity to handle the drop. <br><br> - Index: schema/viewer.exsd =================================================================== RCS file: /home/eclipse/org.eclipse.ui.navigator/schema/viewer.exsd,v retrieving revision 1.8 diff -u -r1.8 viewer.exsd --- schema/viewer.exsd 9 Feb 2006 21:32:11 -0000 1.8 +++ schema/viewer.exsd 24 Feb 2006 16:34:40 -0000 @@ -379,17 +379,17 @@ - + - Provide an implementation of IDragAssistant. + Provide an implementation of <code>org.eclipse.ui.navigator.CommonDragAdapterAssistant</code>. - + - + Associate this drag assistant with a particular viewer id.