Package ghidra.app.util
Class ByteCopier
- java.lang.Object
-
- ghidra.app.util.ByteCopier
-
public abstract class ByteCopier extends java.lang.Object
Base class that can copy bytes into a Transferable object, and paste bytes into a program.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ByteCopier.ByteStringTransferable
static class
ByteCopier.ProgrammingByteStringTransferable
-
Field Summary
Fields Modifier and Type Field Description static java.awt.datatransfer.DataFlavor
BYTE_STRING_FLAVOR
static ClipboardType
BYTE_STRING_NO_SPACE_TYPE
static java.awt.datatransfer.DataFlavor
BYTE_STRING_NO_SPACES_FLAVOR
static ClipboardType
BYTE_STRING_TYPE
static java.awt.datatransfer.DataFlavor
CPP_BYTE_ARRAY_FLAVOR
static ClipboardType
CPP_BYTE_ARRAY_TYPE
protected ProgramLocation
currentLocation
protected Program
currentProgram
protected ProgramSelection
currentSelection
protected static java.util.List<ClipboardType>
EMPTY_LIST
static java.awt.datatransfer.DataFlavor
PYTHON_BYTE_STRING_FLAVOR
static ClipboardType
PYTHON_BYTE_STRING_TYPE
static java.awt.datatransfer.DataFlavor
PYTHON_LIST_FLAVOR
static ClipboardType
PYTHON_LIST_TYPE
protected PluginTool
tool
-
Constructor Summary
Constructors Modifier Constructor Description protected
ByteCopier()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.datatransfer.Transferable
copyBytes(ClipboardType copyType, TaskMonitor monitor)
protected java.awt.datatransfer.Transferable
copyBytes(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)
protected java.lang.String
copyBytesAsString(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)
protected java.lang.String
copyBytesAsString(AddressSetView addresses, java.lang.String delimiter, TaskMonitor monitor)
static java.awt.datatransfer.Transferable
createStringTransferable(java.lang.String text)
Create a Transferable from the given text.protected AddressSetView
getSelectedAddresses()
protected boolean
pasteBytes(java.awt.datatransfer.Transferable pasteData)
protected boolean
pasteByteString(java.lang.String string)
-
-
-
Field Detail
-
BYTE_STRING_FLAVOR
public static java.awt.datatransfer.DataFlavor BYTE_STRING_FLAVOR
-
BYTE_STRING_NO_SPACES_FLAVOR
public static java.awt.datatransfer.DataFlavor BYTE_STRING_NO_SPACES_FLAVOR
-
PYTHON_BYTE_STRING_FLAVOR
public static java.awt.datatransfer.DataFlavor PYTHON_BYTE_STRING_FLAVOR
-
PYTHON_LIST_FLAVOR
public static java.awt.datatransfer.DataFlavor PYTHON_LIST_FLAVOR
-
CPP_BYTE_ARRAY_FLAVOR
public static java.awt.datatransfer.DataFlavor CPP_BYTE_ARRAY_FLAVOR
-
EMPTY_LIST
protected static final java.util.List<ClipboardType> EMPTY_LIST
-
BYTE_STRING_TYPE
public static final ClipboardType BYTE_STRING_TYPE
-
BYTE_STRING_NO_SPACE_TYPE
public static final ClipboardType BYTE_STRING_NO_SPACE_TYPE
-
PYTHON_BYTE_STRING_TYPE
public static final ClipboardType PYTHON_BYTE_STRING_TYPE
-
PYTHON_LIST_TYPE
public static final ClipboardType PYTHON_LIST_TYPE
-
CPP_BYTE_ARRAY_TYPE
public static final ClipboardType CPP_BYTE_ARRAY_TYPE
-
tool
protected PluginTool tool
-
currentProgram
protected Program currentProgram
-
currentSelection
protected ProgramSelection currentSelection
-
currentLocation
protected ProgramLocation currentLocation
-
-
Method Detail
-
getSelectedAddresses
protected AddressSetView getSelectedAddresses()
-
copyBytes
protected java.awt.datatransfer.Transferable copyBytes(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)
-
copyBytesAsString
protected java.lang.String copyBytesAsString(AddressSetView addresses, boolean includeSpaces, TaskMonitor monitor)
-
copyBytesAsString
protected java.lang.String copyBytesAsString(AddressSetView addresses, java.lang.String delimiter, TaskMonitor monitor)
-
copyBytes
protected java.awt.datatransfer.Transferable copyBytes(ClipboardType copyType, TaskMonitor monitor)
-
pasteBytes
protected boolean pasteBytes(java.awt.datatransfer.Transferable pasteData) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
pasteByteString
protected boolean pasteByteString(java.lang.String string)
-
createStringTransferable
public static java.awt.datatransfer.Transferable createStringTransferable(java.lang.String text)
Create a Transferable from the given text.- Parameters:
text
- text used to create a Transferable- Returns:
- a Transferable
-
-