Package ghidra.app.util
Class FileOpenDropHandler
java.lang.Object
ghidra.app.util.FileOpenDropHandler
- All Implemented Interfaces:
Droppable,DropTargetHandler,ContainerListener,EventListener
public class FileOpenDropHandler
extends Object
implements DropTargetHandler, Droppable, ContainerListener
Handles drag/drop events on a given component such that a file
dropped on the component from the front end tool will cause
that file to be opened. Properly handles drop events with
child components and listens for components being added/removed
in order to properly support drag/drop with all components.
-
Constructor Summary
ConstructorsConstructorDescriptionFileOpenDropHandler(PluginTool tool, Component component) Construct a new FileOpenDropHandler. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Object obj, DropTargetDropEvent e, DataFlavor f) Add the object to the droppable component.static voidaddDataFlavorHandler(DataFlavor dataFlavor, FileOpenDataFlavorHandler handler) voidvoidvoiddispose()Dispose this drop handler.voiddragUnderFeedback(boolean ok, DropTargetDragEvent e) Set drag feedback according to the ok parameterbooleanReturn true if is OK to drop the transferable at the location specified the eventstatic FileOpenDataFlavorHandlerremoveDataFlavorHandler(DataFlavor dataFlavor) voidRevert back to normal if any drag feedback was set
-
Constructor Details
-
FileOpenDropHandler
Construct a new FileOpenDropHandler.- Parameters:
tool- plugin toolcomponent- component that is the drop target
-
-
Method Details
-
dispose
public void dispose()Dispose this drop handler.- Specified by:
disposein interfaceDropTargetHandler
-
isDropOk
Description copied from interface:DroppableReturn true if is OK to drop the transferable at the location specified the event -
add
Description copied from interface:DroppableAdd the object to the droppable component. The DropTargetAdapter calls this method from its drop() method. -
dragUnderFeedback
Description copied from interface:DroppableSet drag feedback according to the ok parameter- Specified by:
dragUnderFeedbackin interfaceDroppable- Parameters:
ok- true means the drop action is OKe- event that has current state of drag and drop operation
-
undoDragUnderFeedback
public void undoDragUnderFeedback()Description copied from interface:DroppableRevert back to normal if any drag feedback was set- Specified by:
undoDragUnderFeedbackin interfaceDroppable
-
componentAdded
- Specified by:
componentAddedin interfaceContainerListener
-
componentRemoved
- Specified by:
componentRemovedin interfaceContainerListener
-
addDataFlavorHandler
-
removeDataFlavorHandler
-