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 |
|