Package ghidra.util
Class CascadedDropTarget
- java.lang.Object
-
- java.awt.dnd.DropTarget
-
- ghidra.util.CascadedDropTarget
-
- All Implemented Interfaces:
java.awt.dnd.DropTargetListener
,java.io.Serializable
,java.util.EventListener
public class CascadedDropTarget extends java.awt.dnd.DropTarget
Combines two drop targets and sends events to them in priority order. If the first drop target accepts the event, then the second drop target is not accessed.Either of the given drop targets can be an instance of CascadedDropTarget, effectively creating a tree structure of drop targets.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CascadedDropTarget(java.awt.Component comp, java.awt.dnd.DropTarget firstDropTarget, java.awt.dnd.DropTarget secondDropTarget)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
void
dragExit(java.awt.dnd.DropTargetEvent dte)
void
dragOver(java.awt.dnd.DropTargetDragEvent dtde)
void
drop(java.awt.dnd.DropTargetDropEvent dtde)
void
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
java.awt.dnd.DropTarget
getPrimaryDropTarget()
java.awt.dnd.DropTarget
getSecondaryDropTarget()
java.awt.dnd.DropTarget
removeDropTarget(java.awt.dnd.DropTarget dropTarget)
Removes the given drop target from anywhere within the tree of CascadedDropTargets.-
Methods inherited from class java.awt.dnd.DropTarget
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeDropTargetListener, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll
-
-
-
-
Method Detail
-
drop
public void drop(java.awt.dnd.DropTargetDropEvent dtde)
- Specified by:
drop
in interfacejava.awt.dnd.DropTargetListener
- Overrides:
drop
in classjava.awt.dnd.DropTarget
-
dragEnter
public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
- Specified by:
dragEnter
in interfacejava.awt.dnd.DropTargetListener
- Overrides:
dragEnter
in classjava.awt.dnd.DropTarget
-
dragOver
public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
- Specified by:
dragOver
in interfacejava.awt.dnd.DropTargetListener
- Overrides:
dragOver
in classjava.awt.dnd.DropTarget
-
dropActionChanged
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
- Specified by:
dropActionChanged
in interfacejava.awt.dnd.DropTargetListener
- Overrides:
dropActionChanged
in classjava.awt.dnd.DropTarget
-
dragExit
public void dragExit(java.awt.dnd.DropTargetEvent dte)
- Specified by:
dragExit
in interfacejava.awt.dnd.DropTargetListener
- Overrides:
dragExit
in classjava.awt.dnd.DropTarget
-
getPrimaryDropTarget
public java.awt.dnd.DropTarget getPrimaryDropTarget()
-
getSecondaryDropTarget
public java.awt.dnd.DropTarget getSecondaryDropTarget()
-
removeDropTarget
public java.awt.dnd.DropTarget removeDropTarget(java.awt.dnd.DropTarget dropTarget)
Removes the given drop target from anywhere within the tree of CascadedDropTargets. If the given dropTarget is an immediate child of this CascadedDropTarget (CDT), then the other child is returned. Otherwise, a reference to this CDT will be returned with the given dropTarget having been removed from one of this CDT's children. This method effectively removes the given dropTarget from the hierarchy and collapses the tree structure as needed.- Parameters:
dropTarget
- The target to remove- Returns:
- the new drop target reference
-
-