Package ghidra.plugin.importer
Class ImporterDialog
- java.lang.Object
-
- docking.DialogComponentProvider
-
- ghidra.plugin.importer.ImporterDialog
-
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
- Direct Known Subclasses:
AddToProgramDialog
public class ImporterDialog extends DialogComponentProvider
Dialog for importing a file into Ghidra as a program.
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteProvider
byteProvider
protected javax.swing.JTextField
filenameTextField
protected javax.swing.JButton
folderButton
protected javax.swing.JTextField
folderNameTextField
protected FSRL
fsrl
protected javax.swing.JButton
languageButton
protected javax.swing.JTextField
languageTextField
static java.lang.String
LAST_IMPORTFILE_PREFERENCE_KEY
protected GhidraComboBox<Loader>
loaderComboBox
protected java.util.List<Option>
options
protected javax.swing.JButton
optionsButton
protected LanguageCompilerSpecPair
selectedLanguage
protected PluginTool
tool
-
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Modifier Constructor Description ImporterDialog(PluginTool tool, ProgramManager programManager, LoaderMap loaderMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)
Construct a new dialog for importing a file as a new program into Ghidra.protected
ImporterDialog(java.lang.String title, PluginTool tool, LoaderMap loaderMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected java.util.List<Option>
getOptions(LoadSpec loadSpec)
protected Loader
getSelectedLoader()
protected LoadSpec
getSelectedLoadSpec(Loader loader)
protected boolean
isSupported(Loader loader)
protected void
okCallback()
The callback method for when the "OK" button is pressed.protected void
selectedLoaderChanged()
void
setDestinationFolder(DomainFolder folder)
Sets the destination folder for the imported program.protected void
setSelectedLanguage(LanguageCompilerSpecPair lcsPair)
protected boolean
validateFormInput()
-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, dialogClosed, dialogShown, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocatdion, getId, getIntialLocation, getLocationOnScreen, getParent, getPreferredSize, getRemberSize, getRememberLocation, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setApplyEnabled, setApplyToolTip, setBackground, setCancelButtonText, setCancelEnabled, setCancelToolTip, setCursor, setDefaultButton, setDefaultSize, setDialogSize, setDismissToolTip, setFocusComponent, setGlassPane, setHelpLocation, setInitialLocation, setMinimumSize, setMinimumSize, setOkButtonText, setOkEnabled, setOkToolTip, setPreferredSize, setRememberLocation, setRememberSize, setResizable, setStatusJustification, setStatusText, setStatusText, setStatusText, setTitle, setTransient, setUseSharedLocation, showProgressBar, showTaskMonitorComponent, stopProgressTimer, taskCancelled, taskCompleted, toFront, toString, waitForCurrentTask
-
-
-
-
Field Detail
-
LAST_IMPORTFILE_PREFERENCE_KEY
public static final java.lang.String LAST_IMPORTFILE_PREFERENCE_KEY
- See Also:
- Constant Field Values
-
tool
protected PluginTool tool
-
fsrl
protected FSRL fsrl
-
options
protected java.util.List<Option> options
-
selectedLanguage
protected LanguageCompilerSpecPair selectedLanguage
-
byteProvider
protected ByteProvider byteProvider
-
filenameTextField
protected javax.swing.JTextField filenameTextField
-
folderButton
protected javax.swing.JButton folderButton
-
languageButton
protected javax.swing.JButton languageButton
-
languageTextField
protected javax.swing.JTextField languageTextField
-
optionsButton
protected javax.swing.JButton optionsButton
-
folderNameTextField
protected javax.swing.JTextField folderNameTextField
-
loaderComboBox
protected GhidraComboBox<Loader> loaderComboBox
-
-
Constructor Detail
-
ImporterDialog
public ImporterDialog(PluginTool tool, ProgramManager programManager, LoaderMap loaderMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)
Construct a new dialog for importing a file as a new program into Ghidra.- Parameters:
tool
- the active tool that spawned this dialog.programManager
- program manager to open imported file with or nullloaderMap
- the loaders and their corresponding load specificationsbyteProvider
- the ByteProvider for getting the bytes from the file to be imported. The dialog takes ownership of the ByteProvider and it will be closed when the dialog is closedsuggestedDestinationPath
- optional string path that will be pre-pended to the destination filename. Any path specified in the destination filename field will be created when the user performs the import (as opposed to thedestination folder
option which requires the DomainFolder to already exist). The two destination paths work together to specify the final Ghidra project folder where the imported binary is placed.
-
ImporterDialog
protected ImporterDialog(java.lang.String title, PluginTool tool, LoaderMap loaderMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)
-
-
Method Detail
-
setDestinationFolder
public void setDestinationFolder(DomainFolder folder)
Sets the destination folder for the imported program.- Parameters:
folder
- the folder to store the imported program.
-
isSupported
protected boolean isSupported(Loader loader)
-
selectedLoaderChanged
protected void selectedLoaderChanged()
-
okCallback
protected void okCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "OK" button is pressed.- Overrides:
okCallback
in classDialogComponentProvider
-
close
public void close()
- Overrides:
close
in classDialogComponentProvider
-
getSelectedLoader
protected Loader getSelectedLoader()
-
validateFormInput
protected boolean validateFormInput()
-
setSelectedLanguage
protected void setSelectedLanguage(LanguageCompilerSpecPair lcsPair)
-
-