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

Collapse All | Expand All

(-)a/org.eclipse.mylyn.tasks.ui/plugin.xml (+1 lines)
Lines 22-27 Link Here
22
    <extension-point id="taskEditorPageContribution" name="Task Editor Page Contribution" schema="schema/taskEditorPageContribution.exsd"/>
22
    <extension-point id="taskEditorPageContribution" name="Task Editor Page Contribution" schema="schema/taskEditorPageContribution.exsd"/>
23
    <extension-point id="searchProvider" name="Search Handling Provider" schema="schema/searchProvider.exsd"/>
23
    <extension-point id="searchProvider" name="Search Handling Provider" schema="schema/searchProvider.exsd"/>
24
    <extension-point id="searchHandler" name="Search Handler" schema="schema/searchHandler.exsd"/>
24
    <extension-point id="searchHandler" name="Search Handler" schema="schema/searchHandler.exsd"/>
25
    <extension-point id="taskDropListener" name="Task Drop Listener" schema="schema/taskDropListener.exsd"/>
25
26
26
    <extension
27
    <extension
27
          point="org.eclipse.mylyn.context.core.bridges">
28
          point="org.eclipse.mylyn.context.core.bridges">
(-)a/org.eclipse.mylyn.tasks.ui/schema/taskDropListener.exsd (+102 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.mylyn.tasks.ui" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.mylyn.tasks.ui" id="taskDropListener" name="Task Drop Listener"/>
7
      </appInfo>
8
      <documentation>
9
         Allows clients to be notified when a task is dropped onto another task.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appInfo>
16
            <meta.element internal="true" />
17
         </appInfo>
18
      </annotation>
19
      <complexType>
20
         <sequence minOccurs="1" maxOccurs="unbounded">
21
            <element ref="listener"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appInfo>
43
                  <meta.attribute translatable="true"/>
44
               </appInfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="listener">
51
      <complexType>
52
         <attribute name="class" type="string">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appInfo>
58
                  <meta.attribute kind="java" basedOn="org.eclipse.mylyn.internal.tasks.ui.TaskDropListener:"/>
59
               </appInfo>
60
            </annotation>
61
         </attribute>
62
      </complexType>
63
   </element>
64
65
   <annotation>
66
      <appInfo>
67
         <meta.section type="since"/>
68
      </appInfo>
69
      <documentation>
70
         [Enter the first release in which this extension point appears.]
71
      </documentation>
72
   </annotation>
73
74
   <annotation>
75
      <appInfo>
76
         <meta.section type="examples"/>
77
      </appInfo>
78
      <documentation>
79
         [Enter extension point usage example here.]
80
      </documentation>
81
   </annotation>
82
83
   <annotation>
84
      <appInfo>
85
         <meta.section type="apiinfo"/>
86
      </appInfo>
87
      <documentation>
88
         [Enter API information here.]
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appInfo>
94
         <meta.section type="implementation"/>
95
      </appInfo>
96
      <documentation>
97
         [Enter information about supplied implementation of this extension point.]
98
      </documentation>
99
   </annotation>
100
101
102
</schema>
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskAttachmentDropListener.java (-2 / +18 lines)
Lines 14-24 Link Here
14
package org.eclipse.mylyn.internal.tasks.ui.editors;
14
package org.eclipse.mylyn.internal.tasks.ui.editors;
15
15
16
import java.io.File;
16
import java.io.File;
17
import java.util.List;
17
18
18
import org.eclipse.jface.dialogs.IMessageProvider;
19
import org.eclipse.jface.dialogs.IMessageProvider;
20
import org.eclipse.jface.util.LocalSelectionTransfer;
21
import org.eclipse.jface.viewers.ISelection;
19
import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource;
22
import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource;
20
import org.eclipse.mylyn.internal.tasks.core.data.TextTaskAttachmentSource;
23
import org.eclipse.mylyn.internal.tasks.core.data.TextTaskAttachmentSource;
24
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
21
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewAttachmentWizardDialog;
25
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewAttachmentWizardDialog;
26
import org.eclipse.mylyn.tasks.core.ITask;
27
import org.eclipse.mylyn.tasks.ui.TaskDropListener.Operation;
22
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
28
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
23
import org.eclipse.swt.dnd.DND;
29
import org.eclipse.swt.dnd.DND;
24
import org.eclipse.swt.dnd.DropTargetEvent;
30
import org.eclipse.swt.dnd.DropTargetEvent;
Lines 50-58 Link Here
50
		}
56
		}
51
		// will accept text but prefer to have files dropped
57
		// will accept text but prefer to have files dropped
52
		for (TransferData dataType : event.dataTypes) {
58
		for (TransferData dataType : event.dataTypes) {
53
			if (FileTransfer.getInstance().isSupportedType(dataType)) {
59
			if (LocalSelectionTransfer.getTransfer().isSupportedType(dataType)
60
					|| FileTransfer.getInstance().isSupportedType(dataType)) {
54
				event.currentDataType = dataType;
61
				event.currentDataType = dataType;
55
				// files should only be copied
62
				// files and tasks should only be copied
56
				if (event.detail != DND.DROP_COPY) {
63
				if (event.detail != DND.DROP_COPY) {
57
					event.detail = DND.DROP_NONE;
64
					event.detail = DND.DROP_NONE;
58
				}
65
				}
Lines 86-91 Link Here
86
	}
93
	}
87
94
88
	public void drop(DropTargetEvent event) {
95
	public void drop(DropTargetEvent event) {
96
		if (LocalSelectionTransfer.getTransfer().isSupportedType(event.currentDataType)) {
97
			TasksUiInternal.getTaskDropHandler().loadTaskDropListeners();
98
			ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
99
			List<ITask> tasksToMove = TasksUiInternal.getTasksFromSelection(selection);
100
			if (!tasksToMove.isEmpty()) {
101
				TasksUiInternal.getTaskDropHandler().fireTaskDropped(tasksToMove, page.getTask(),
102
						Operation.DROP_ON_TASK_EDITOR);
103
			}
104
		}
89
		if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
105
		if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
90
			String text = (String) event.data;
106
			String text = (String) event.data;
91
			EditorUtil.openNewAttachmentWizard(page, null, new TextTaskAttachmentSource(text));
107
			EditorUtil.openNewAttachmentWizard(page, null, new TextTaskAttachmentSource(text));
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDropHandler.java (+62 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.util;
13
14
import java.util.List;
15
16
import org.eclipse.core.runtime.ISafeRunnable;
17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.SafeRunner;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.mylyn.commons.core.ExtensionPointReader;
21
import org.eclipse.mylyn.commons.core.StatusHandler;
22
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
23
import org.eclipse.mylyn.tasks.core.ITask;
24
import org.eclipse.mylyn.tasks.ui.TaskDropListener;
25
import org.eclipse.mylyn.tasks.ui.TaskDropListener.TaskDropEvent;
26
27
public class TaskDropHandler {
28
29
	private List<TaskDropListener> taskDropListeners;
30
31
	TaskDropHandler() {// package visible
32
	}
33
34
	public void loadTaskDropListeners() {
35
		if (taskDropListeners == null) {
36
			ExtensionPointReader<TaskDropListener> reader = new ExtensionPointReader<TaskDropListener>(
37
					TasksUiPlugin.ID_PLUGIN, "taskDropListener", "listener", TaskDropListener.class); //$NON-NLS-1$//$NON-NLS-2$
38
			IStatus status = reader.read();
39
			if (!status.isOK()) {
40
				StatusHandler.log(status);
41
			}
42
			taskDropListeners = reader.getItems();
43
		}
44
	}
45
46
	public void fireTaskDropped(final List<ITask> tasksToMove, final ITask currentTarget,
47
			TaskDropListener.Operation operation) {
48
		final TaskDropEvent event = new TaskDropEvent(tasksToMove, currentTarget, operation);
49
		for (final TaskDropListener listener : taskDropListeners) {
50
			SafeRunner.run(new ISafeRunnable() {
51
				public void run() throws Exception {
52
					listener.tasksDropped(event);
53
				}
54
55
				public void handleException(Throwable exception) {
56
					StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, exception.getMessage(),
57
							exception));
58
				}
59
			});
60
		}
61
	}
62
}
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java (+6 lines)
Lines 149-154 Link Here
149
149
150
	private static SynchronizationScheduler synchronizationScheduler = new SynchronizationScheduler();
150
	private static SynchronizationScheduler synchronizationScheduler = new SynchronizationScheduler();
151
151
152
	private static final TaskDropHandler taskDropHandler = new TaskDropHandler();
153
152
	// TODO e3.5 replace by SWT.SHEET
154
	// TODO e3.5 replace by SWT.SHEET
153
	public static final int SWT_SHEET = 1 << 28;
155
	public static final int SWT_SHEET = 1 << 28;
154
156
Lines 1440-1443 Link Here
1440
				&& MonitorUiPlugin.getDefault().isActivityTrackingEnabled();
1442
				&& MonitorUiPlugin.getDefault().isActivityTrackingEnabled();
1441
	}
1443
	}
1442
1444
1445
	public static TaskDropHandler getTaskDropHandler() {
1446
		return taskDropHandler;
1447
	}
1448
1443
}
1449
}
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java (-48 / +50 lines)
Lines 38-46 Link Here
38
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
38
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
39
import org.eclipse.mylyn.tasks.core.ITask;
39
import org.eclipse.mylyn.tasks.core.ITask;
40
import org.eclipse.mylyn.tasks.core.ITaskContainer;
40
import org.eclipse.mylyn.tasks.core.ITaskContainer;
41
import org.eclipse.mylyn.tasks.ui.TaskDropListener.Operation;
41
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
42
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
42
import org.eclipse.swt.dnd.DND;
43
import org.eclipse.swt.dnd.DND;
43
import org.eclipse.swt.dnd.DropTargetEvent;
44
import org.eclipse.swt.dnd.FileTransfer;
44
import org.eclipse.swt.dnd.FileTransfer;
45
import org.eclipse.swt.dnd.TextTransfer;
45
import org.eclipse.swt.dnd.TextTransfer;
46
import org.eclipse.swt.dnd.TransferData;
46
import org.eclipse.swt.dnd.TransferData;
Lines 51-56 Link Here
51
 * @author Mik Kersten
51
 * @author Mik Kersten
52
 * @author Rob Elves (added URL based task creation support)
52
 * @author Rob Elves (added URL based task creation support)
53
 * @author Jevgeni Holodkov
53
 * @author Jevgeni Holodkov
54
 * @author Sam Davis
54
 */
55
 */
55
public class TaskListDropAdapter extends ViewerDropAdapter {
56
public class TaskListDropAdapter extends ViewerDropAdapter {
56
57
Lines 64-81 Link Here
64
	}
65
	}
65
66
66
	@Override
67
	@Override
67
	public void dragOver(DropTargetEvent event) {
68
		// support dragging from sources only supporting DROP_LINK
69
		if (event.detail == DND.DROP_NONE && (event.operations & DND.DROP_LINK) == DND.DROP_LINK) {
70
			event.detail = DND.DROP_LINK;
71
		}
72
		super.dragOver(event);
73
	}
74
75
	@Override
76
	public boolean performDrop(final Object data) {
68
	public boolean performDrop(final Object data) {
77
		List<ITask> tasksToMove = new ArrayList<ITask>();
69
		List<ITask> tasksToMove = new ArrayList<ITask>();
78
79
		if (localTransfer) {
70
		if (localTransfer) {
80
			ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
71
			ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
81
			List<ITask> tasks = TasksUiInternal.getTasksFromSelection(selection);
72
			List<ITask> tasks = TasksUiInternal.getTasksFromSelection(selection);
Lines 107-155 Link Here
107
				}
98
				}
108
			}
99
			}
109
		} else {
100
		} else {
110
			for (ITask task : tasksToMove) {
101
			if (currentTarget instanceof ITask && getCurrentLocation() == ViewerDropAdapter.LOCATION_ON
111
				if (currentTarget instanceof UncategorizedTaskContainer) {
102
					&& getCurrentOperation() != DND.DROP_MOVE) {
112
					moveTask(task, (UncategorizedTaskContainer) currentTarget);
103
				TasksUiInternal.getTaskDropHandler().loadTaskDropListeners();
113
				} else if (currentTarget instanceof TaskCategory) {
104
				Operation operation = (getCurrentOperation() == DND.DROP_COPY) ? Operation.COPY : Operation.LINK;
114
					moveTask(task, (TaskCategory) currentTarget);
105
				TasksUiInternal.getTaskDropHandler().fireTaskDropped(tasksToMove, (ITask) currentTarget, operation);
115
				} else if (currentTarget instanceof UnmatchedTaskContainer) {
106
			} else {
116
					if (((UnmatchedTaskContainer) currentTarget).getRepositoryUrl().equals(task.getRepositoryUrl())) {
107
				for (ITask task : tasksToMove) {
117
						moveTask(task, (AbstractTaskCategory) currentTarget);
108
					if (currentTarget instanceof UncategorizedTaskContainer) {
118
					}
109
						moveTask(task, (UncategorizedTaskContainer) currentTarget);
119
				} else if (currentTarget instanceof ITask) {
110
					} else if (currentTarget instanceof TaskCategory) {
120
					ITask targetTask = (ITask) currentTarget;
111
						moveTask(task, (TaskCategory) currentTarget);
121
					TaskListView view = TaskListView.getFromActivePerspective();
112
					} else if (currentTarget instanceof UnmatchedTaskContainer) {
122
					if ((getCurrentLocation() == LOCATION_BEFORE || getCurrentLocation() == LOCATION_AFTER)
113
						if (((UnmatchedTaskContainer) currentTarget).getRepositoryUrl().equals(task.getRepositoryUrl())) {
123
							&& view != null && view.isScheduledPresentation()) {
114
							moveTask(task, (AbstractTaskCategory) currentTarget);
124
						if (targetTask instanceof AbstractTask) {
125
							DateRange targetDate = ((AbstractTask) targetTask).getScheduledForDate();
126
							TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, targetDate);
127
						}
115
						}
128
					} else {
116
					} else if (currentTarget instanceof ITask) {
129
						AbstractTaskCategory targetCategory = null;
117
						ITask targetTask = (ITask) currentTarget;
130
						// TODO: TaskCategory only used what about AbstractTaskCategory descendants?
118
						TaskListView view = TaskListView.getFromActivePerspective();
131
						ITaskContainer container = TaskCategory.getParentTaskCategory(targetTask);
119
						if ((getCurrentLocation() == LOCATION_BEFORE || getCurrentLocation() == LOCATION_AFTER)
132
						if (container instanceof TaskCategory || container instanceof UncategorizedTaskContainer) {
120
								&& view != null && view.isScheduledPresentation()) {
133
							targetCategory = (AbstractTaskCategory) container;
121
							if (targetTask instanceof AbstractTask) {
134
						} else if (container instanceof UnmatchedTaskContainer) {
122
								DateRange targetDate = ((AbstractTask) targetTask).getScheduledForDate();
135
							if (((UnmatchedTaskContainer) container).getRepositoryUrl().equals(task.getRepositoryUrl())) {
123
								TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, targetDate);
124
							}
125
						} else {
126
							AbstractTaskCategory targetCategory = null;
127
							// TODO: TaskCategory only used what about AbstractTaskCategory descendants?
128
							ITaskContainer container = TaskCategory.getParentTaskCategory(targetTask);
129
							if (container instanceof TaskCategory || container instanceof UncategorizedTaskContainer) {
136
								targetCategory = (AbstractTaskCategory) container;
130
								targetCategory = (AbstractTaskCategory) container;
131
							} else if (container instanceof UnmatchedTaskContainer) {
132
								if (((UnmatchedTaskContainer) container).getRepositoryUrl().equals(
133
										task.getRepositoryUrl())) {
134
									targetCategory = (AbstractTaskCategory) container;
135
								}
136
							}
137
							if (targetCategory != null) {
138
								moveTask(task, targetCategory);
137
							}
139
							}
138
						}
140
						}
139
						if (targetCategory != null) {
141
					} else if (currentTarget instanceof ScheduledTaskContainer) {
140
							moveTask(task, targetCategory);
142
						ScheduledTaskContainer container = (ScheduledTaskContainer) currentTarget;
143
						if (container instanceof Unscheduled) {
144
							TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, null);
145
						} else if (isValidTarget(container)) {
146
							TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task,
147
									container.getDateRange());
141
						}
148
						}
149
					} else if (currentTarget == null) {
150
						moveTask(task, TasksUiPlugin.getTaskList().getDefaultCategory());
142
					}
151
					}
143
				} else if (currentTarget instanceof ScheduledTaskContainer) {
144
					ScheduledTaskContainer container = (ScheduledTaskContainer) currentTarget;
145
					if (container instanceof Unscheduled) {
146
						TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, null);
147
					} else if (isValidTarget(container)) {
148
						TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task,
149
								container.getDateRange());
150
					}
151
				} else if (currentTarget == null) {
152
					moveTask(task, TasksUiPlugin.getTaskList().getDefaultCategory());
153
				}
152
				}
154
			}
153
			}
155
		}
154
		}
Lines 260-265 Link Here
260
				return true;
259
				return true;
261
			} else if (target instanceof LocalTask && getCurrentLocation() == ViewerDropAdapter.LOCATION_ON) {
260
			} else if (target instanceof LocalTask && getCurrentLocation() == ViewerDropAdapter.LOCATION_ON) {
262
				return true;
261
				return true;
262
			} else if (target instanceof ITask && getCurrentLocation() == ViewerDropAdapter.LOCATION_ON
263
					&& getCurrentOperation() != DND.DROP_MOVE) {
264
				return true;
263
			} else {
265
			} else {
264
				return false;
266
				return false;
265
			}
267
			}
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskDropListener.java (+72 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.tasks.ui;
13
14
import java.util.ArrayList;
15
import java.util.Collection;
16
import java.util.Collections;
17
18
import org.eclipse.mylyn.tasks.core.ITask;
19
20
/**
21
 * Clients can contribute an extensin of this class to be notified when one task is dropped on a repository task in the
22
 * task list, or when a task is dropped on a task editor.
23
 * 
24
 * @author Sam Davis
25
 */
26
public abstract class TaskDropListener {
27
	public static enum Operation {
28
		COPY, LINK, DROP_ON_TASK_EDITOR
29
	};
30
31
	public static class TaskDropEvent {
32
		private final Collection<ITask> tasks;
33
34
		private final ITask target;
35
36
		private final Operation operation;
37
38
		public TaskDropEvent(Collection<ITask> tasks, ITask target, Operation operation) {
39
			this.tasks = Collections.unmodifiableList(new ArrayList<ITask>(tasks));
40
			this.target = target;
41
			this.operation = operation;
42
		}
43
44
		/**
45
		 * @return the tasks that were dropped
46
		 */
47
		public Collection<ITask> getTasks() {
48
			return tasks;
49
		}
50
51
		/**
52
		 * @return the target task
53
		 */
54
		public ITask getTarget() {
55
			return target;
56
		}
57
58
		/**
59
		 * @return the drop operation that triggered this event
60
		 */
61
		public Operation getOperation() {
62
			return operation;
63
		}
64
	}
65
66
	/**
67
	 * Called when a task drop event occurs.
68
	 * 
69
	 * @param event
70
	 */
71
	public abstract void tasksDropped(TaskDropEvent event);
72
}
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java (-1 / +3 lines)
Lines 41-46 Link Here
41
import org.eclipse.jface.layout.GridDataFactory;
41
import org.eclipse.jface.layout.GridDataFactory;
42
import org.eclipse.jface.layout.GridLayoutFactory;
42
import org.eclipse.jface.layout.GridLayoutFactory;
43
import org.eclipse.jface.text.TextSelection;
43
import org.eclipse.jface.text.TextSelection;
44
import org.eclipse.jface.util.LocalSelectionTransfer;
44
import org.eclipse.jface.util.SafeRunnable;
45
import org.eclipse.jface.util.SafeRunnable;
45
import org.eclipse.jface.viewers.ISelection;
46
import org.eclipse.jface.viewers.ISelection;
46
import org.eclipse.jface.viewers.ISelectionChangedListener;
47
import org.eclipse.jface.viewers.ISelectionChangedListener;
Lines 1487-1495 Link Here
1487
		}
1488
		}
1488
1489
1489
		DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_DEFAULT);
1490
		DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_DEFAULT);
1491
		LocalSelectionTransfer localSelectionTransfer = LocalSelectionTransfer.getTransfer();
1490
		final TextTransfer textTransfer = TextTransfer.getInstance();
1492
		final TextTransfer textTransfer = TextTransfer.getInstance();
1491
		final FileTransfer fileTransfer = FileTransfer.getInstance();
1493
		final FileTransfer fileTransfer = FileTransfer.getInstance();
1492
		Transfer[] types = new Transfer[] { textTransfer, fileTransfer };
1494
		Transfer[] types = new Transfer[] { localSelectionTransfer, textTransfer, fileTransfer };
1493
		target.setTransfer(types);
1495
		target.setTransfer(types);
1494
		if (defaultDropListener == null) {
1496
		if (defaultDropListener == null) {
1495
			defaultDropListener = new TaskAttachmentDropListener(this);
1497
			defaultDropListener = new TaskAttachmentDropListener(this);

Return to bug 370283