View | Details | Raw Unified | Return to bug 126658 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/navigator/resources/ResourceDragAdapterAssistant.java (-16 / +18 lines)
Lines 67-73 Link Here
67
	 * @see org.eclipse.ui.navigator.CommonDragAdapterAssistant#setDragData(org.eclipse.swt.dnd.DragSourceEvent,
67
	 * @see org.eclipse.ui.navigator.CommonDragAdapterAssistant#setDragData(org.eclipse.swt.dnd.DragSourceEvent,
68
	 *      org.eclipse.jface.viewers.IStructuredSelection)
68
	 *      org.eclipse.jface.viewers.IStructuredSelection)
69
	 */
69
	 */
70
	public void setDragData(DragSourceEvent anEvent,
70
	public boolean setDragData(DragSourceEvent anEvent,
71
			IStructuredSelection aSelection) {
71
			IStructuredSelection aSelection) {
72
72
73
		if (LocalSelectionTransfer.getInstance().isSupportedType(
73
		if (LocalSelectionTransfer.getInstance().isSupportedType(
Lines 76-88 Link Here
76
			if (DEBUG)
76
			if (DEBUG)
77
				System.out
77
				System.out
78
						.println("ResourceDragAdapterAssistant.dragSetData set LocalSelectionTransfer"); //$NON-NLS-1$
78
						.println("ResourceDragAdapterAssistant.dragSetData set LocalSelectionTransfer"); //$NON-NLS-1$
79
			return true;
79
		} else if (ResourceTransfer.getInstance().isSupportedType(
80
		} else if (ResourceTransfer.getInstance().isSupportedType(
80
				anEvent.dataType)) {
81
				anEvent.dataType)) {
81
			anEvent.data = getSelectedResources(aSelection);
82
			anEvent.data = getSelectedResources(aSelection);
82
			if (DEBUG)
83
			if (DEBUG)
83
				System.out
84
				System.out
84
						.println("ResourceDragAdapterAssistant.dragSetData set ResourceTransfer"); //$NON-NLS-1$
85
						.println("ResourceDragAdapterAssistant.dragSetData set ResourceTransfer"); //$NON-NLS-1$
85
86
			return true;
86
		} else if (FileTransfer.getInstance().isSupportedType(anEvent.dataType)) {
87
		} else if (FileTransfer.getInstance().isSupportedType(anEvent.dataType)) {
87
88
88
			IResource[] resources = getSelectedResources(aSelection);
89
			IResource[] resources = getSelectedResources(aSelection);
Lines 97-118 Link Here
97
				if (location != null)
98
				if (location != null)
98
					fileNames[actualLength++] = location.toOSString();
99
					fileNames[actualLength++] = location.toOSString();
99
			}
100
			}
100
			if (actualLength == 0)
101
			if (actualLength > 0) { 
101
				return;
102
				// was one or more of the locations null?
102
			// was one or more of the locations null?
103
				if (actualLength < length) {
103
			if (actualLength < length) {
104
					String[] tempFileNames = fileNames;
104
				String[] tempFileNames = fileNames;
105
					fileNames = new String[actualLength];
105
				fileNames = new String[actualLength];
106
					for (int i = 0; i < actualLength; i++)
106
				for (int i = 0; i < actualLength; i++)
107
						fileNames[i] = tempFileNames[i];
107
					fileNames[i] = tempFileNames[i];
108
				}
109
				anEvent.data = fileNames;
110
	
111
				if (DEBUG)
112
					System.out
113
							.println("ResourceDragAdapterAssistant.dragSetData set FileTransfer"); //$NON-NLS-1$
114
				return true;
108
			}
115
			}
109
			anEvent.data = fileNames;
110
111
			if (DEBUG)
112
				System.out
113
						.println("ResourceDragAdapterAssistant.dragSetData set FileTransfer"); //$NON-NLS-1$
114
115
		}
116
		}
117
		return false;
116
118
117
	}
119
	}
118
120
(-)plugin.xml (-2 / +2 lines)
Lines 100-106 Link Here
100
		         </or>
100
		         </or>
101
		   </parentExpression>
101
		   </parentExpression>
102
        </commonSorter>
102
        </commonSorter>
103
        <commonDropAdapter
103
        <dropAssistant
104
              class="org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant"
104
              class="org.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant"
105
              id="org.eclipse.ui.navigator.resources.resourceDropAdapter">
105
              id="org.eclipse.ui.navigator.resources.resourceDropAdapter">
106
           <possibleDropTargets>
106
           <possibleDropTargets>
Lines 110-116 Link Here
110
                 <instanceof value="org.eclipse.core.resources.IFile"/>
110
                 <instanceof value="org.eclipse.core.resources.IFile"/>
111
              </or>
111
              </or>
112
           </possibleDropTargets>
112
           </possibleDropTargets>
113
        </commonDropAdapter>
113
        </dropAssistant>
114
        <actionProvider
114
        <actionProvider
115
              class="org.eclipse.ui.internal.navigator.resources.actions.RefactorActionProvider"
115
              class="org.eclipse.ui.internal.navigator.resources.actions.RefactorActionProvider"
116
              id="org.eclipse.ui.navigator.resources.actions.RefactorActions"/>
116
              id="org.eclipse.ui.navigator.resources.actions.RefactorActions"/>

Return to bug 126658