org.eclipse.mylar.internal.tasks.ui.views
Class TaskListDropAdapter
java.lang.Object
org.eclipse.swt.dnd.DropTargetAdapter
org.eclipse.jface.viewers.ViewerDropAdapter
org.eclipse.mylar.internal.tasks.ui.views.TaskListDropAdapter
- All Implemented Interfaces:
- java.util.EventListener, org.eclipse.swt.dnd.DropTargetListener, org.eclipse.swt.internal.SWTEventListener
public class TaskListDropAdapter
- extends org.eclipse.jface.viewers.ViewerDropAdapter
- Author:
- Mik Kersten, Rob Elves (added URL based task creation support)
Fields inherited from class org.eclipse.jface.viewers.ViewerDropAdapter |
LOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON |
Method Summary |
boolean |
createTaskFromString(java.lang.String title)
|
boolean |
createTaskFromUrl(java.lang.Object data)
|
boolean |
isUrl(java.lang.Object data)
|
boolean |
performDrop(java.lang.Object data)
|
protected void |
retrieveTaskDescription(java.lang.String url)
Attempts to set the task pageTitle to the title from the specified url |
boolean |
validateDrop(java.lang.Object targetObject,
int operation,
org.eclipse.swt.dnd.TransferData transferType)
|
Methods inherited from class org.eclipse.jface.viewers.ViewerDropAdapter |
determineLocation, determineTarget, dragEnter, dragOperationChanged, dragOver, drop, dropAccept, getBounds, getCurrentLocation, getCurrentOperation, getCurrentTarget, getFeedbackEnabled, getSelectedObject, getViewer, handleException, setFeedbackEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled |
Methods inherited from class org.eclipse.swt.dnd.DropTargetAdapter |
dragLeave |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
newTask
private Task newTask
currentTransfer
private org.eclipse.swt.dnd.TransferData currentTransfer
TaskListDropAdapter
public TaskListDropAdapter(org.eclipse.jface.viewers.Viewer viewer)
performDrop
public boolean performDrop(java.lang.Object data)
- Specified by:
performDrop
in class org.eclipse.jface.viewers.ViewerDropAdapter
isUrl
public boolean isUrl(java.lang.Object data)
- Returns:
- true if string is a http(s) url
createTaskFromUrl
public boolean createTaskFromUrl(java.lang.Object data)
- Parameters:
data
- string containing url and title separated by \n
- Returns:
- true if task succesfully created, false otherwise
createTaskFromString
public boolean createTaskFromString(java.lang.String title)
validateDrop
public boolean validateDrop(java.lang.Object targetObject,
int operation,
org.eclipse.swt.dnd.TransferData transferType)
- Specified by:
validateDrop
in class org.eclipse.jface.viewers.ViewerDropAdapter
retrieveTaskDescription
protected void retrieveTaskDescription(java.lang.String url)
- Attempts to set the task pageTitle to the title from the specified url