mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 04:32:12 +00:00
GT-3461 - fix for recent drag-n-drop break
This commit is contained in:
parent
cf0c434d51
commit
638befbfd1
@ -155,10 +155,6 @@ public class DataTypeManagerPlugin extends ProgramPlugin
|
||||
|
||||
editorManager = new DataTypeEditorManager(this);
|
||||
|
||||
CodeViewerService codeViewerService = tool.getService(CodeViewerService.class);
|
||||
if (codeViewerService != null) {
|
||||
codeViewerService.addProgramDropProvider(new DataDropOnBrowserHandler(this));
|
||||
}
|
||||
tool.addPopupActionProvider(this);
|
||||
tool.setMenuGroup(new String[] { SyncRefreshAction.MENU_NAME }, "SYNC");
|
||||
tool.setMenuGroup(new String[] { UpdateAction.MENU_NAME }, "SYNC");
|
||||
|
@ -21,22 +21,25 @@ public class GhidraDataFlavorHandlerService {
|
||||
|
||||
public GhidraDataFlavorHandlerService() {
|
||||
|
||||
try {
|
||||
DataFlavor linuxFileUrlFlavor =
|
||||
new DataFlavor("application/x-java-serialized-object;class=java.lang.String");
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(linuxFileUrlFlavor,
|
||||
new LinuxFileUrlHandler());
|
||||
}
|
||||
catch (ClassNotFoundException cnfe) {
|
||||
// should never happen as it is using java.lang.String
|
||||
}
|
||||
//
|
||||
// Note: the order of the file drop flavors/handlers is intentional. We wish to process
|
||||
// objects first which we know to be transfered from within the current JVM. After
|
||||
// that, then process objects given to us from the OS or another JVM.
|
||||
//
|
||||
|
||||
LocalTreeNodeHandler localNodeHandler = new LocalTreeNodeHandler();
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(
|
||||
DataTreeDragNDropHandler.localDomainFileTreeFlavor, localNodeHandler);
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(DataFlavor.javaFileListFlavor,
|
||||
new JavaFileListHandler());
|
||||
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(
|
||||
VersionInfoTransferable.localVersionInfoFlavor, new LocalVersionInfoHandler());
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(DataFlavor.javaFileListFlavor,
|
||||
new JavaFileListHandler());
|
||||
|
||||
DataFlavor linuxFileUrlFlavor =
|
||||
new DataFlavor("application/x-java-serialized-object;class=java.lang.String",
|
||||
"String file URL");
|
||||
DataTreeDragNDropHandler.addActiveDataFlavorHandler(linuxFileUrlFlavor,
|
||||
new LinuxFileUrlHandler());
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.dnd.*;
|
||||
import java.awt.event.ContainerEvent;
|
||||
import java.awt.event.ContainerListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.CellRendererPane;
|
||||
@ -40,8 +40,10 @@ import ghidra.util.CascadedDropTarget;
|
||||
* in order to properly support drag/drop with all components.
|
||||
*/
|
||||
public class FileOpenDropHandler implements DropTargetHandler, Droppable, ContainerListener {
|
||||
private static HashMap<DataFlavor, FileOpenDataFlavorHandler> handlers =
|
||||
new HashMap<DataFlavor, FileOpenDataFlavorHandler>();
|
||||
|
||||
// note: we wish to maintain insertion order
|
||||
private static LinkedHashMap<DataFlavor, FileOpenDataFlavorHandler> handlers =
|
||||
new LinkedHashMap<DataFlavor, FileOpenDataFlavorHandler>();
|
||||
|
||||
private DropTgtAdapter dropTargetAdapter;
|
||||
private DropTarget globalDropTarget;
|
||||
|
Loading…
Reference in New Issue
Block a user