edu.wpi.ebob.internal.dnd
Class ObjBenchDropTargetListener
java.lang.Object
org.eclipse.swt.dnd.DropTargetAdapter
edu.wpi.ebob.internal.dnd.ObjBenchDropTargetListener
- All Implemented Interfaces:
- java.util.EventListener, org.eclipse.swt.dnd.DropTargetListener, org.eclipse.swt.internal.SWTEventListener
public final class ObjBenchDropTargetListener
- extends org.eclipse.swt.dnd.DropTargetAdapter
Responds to users dragging classes and files over the Object Bench. If a Java
class is dropped on the Object Bench view, CreateInstanceAction.run()
is called.
- Author:
- Liam Morley
- See Also:
CreateInstanceAction
Field Summary |
private static org.eclipse.ui.views.navigator.LocalSelectionTransfer |
selectionTransfer
|
private org.eclipse.swt.widgets.Shell |
shell
|
Constructor Summary |
ObjBenchDropTargetListener(org.eclipse.swt.widgets.Shell shell)
Creates a new instance, with a given shell to report errors to, and to
pass on to the wizard. |
Method Summary |
void |
dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
drop(org.eclipse.swt.dnd.DropTargetEvent event)
|
private org.eclipse.jdt.core.IType |
getType(org.eclipse.jface.viewers.IStructuredSelection sel)
Retrieves the compilation unit |
Methods inherited from class org.eclipse.swt.dnd.DropTargetAdapter |
dragLeave, dropAccept |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
selectionTransfer
private static final org.eclipse.ui.views.navigator.LocalSelectionTransfer selectionTransfer
shell
private final org.eclipse.swt.widgets.Shell shell
ObjBenchDropTargetListener
public ObjBenchDropTargetListener(org.eclipse.swt.widgets.Shell shell)
- Creates a new instance, with a given shell to report errors to, and to
pass on to the wizard. All methods in this class are in
DropTargetListener
.
- Parameters:
shell
- the shell to report errors to, and pass on to the wizard
dragEnter
public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
dragEnter
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
dragEnter
in class org.eclipse.swt.dnd.DropTargetAdapter
dragOver
public void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
dragOver
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
dragOver
in class org.eclipse.swt.dnd.DropTargetAdapter
dragOperationChanged
public void dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
dragOperationChanged
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
dragOperationChanged
in class org.eclipse.swt.dnd.DropTargetAdapter
drop
public void drop(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
drop
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
drop
in class org.eclipse.swt.dnd.DropTargetAdapter
getType
private org.eclipse.jdt.core.IType getType(org.eclipse.jface.viewers.IStructuredSelection sel)
- Retrieves the compilation unit
- Parameters:
sel
- the selection
- Returns:
- the compilation unit within the selection