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 Change Modifier and Type Field Description NEW protected ByteProviderbyteProviderNEW protected javax.swing.JTextFieldfilenameTextFieldNEW protected javax.swing.JButtonfolderButtonNEW protected javax.swing.JTextFieldfolderNameTextFieldNEW protected FSRLfsrlNEW protected javax.swing.JButtonlanguageButtonNEW protected javax.swing.JTextFieldlanguageTextFieldstatic java.lang.StringLAST_IMPORTFILE_PREFERENCE_KEYNEW protected GhidraComboBox<Loader>loaderComboBoxNEW protected java.util.List<Option>optionsNEW protected javax.swing.JButtonoptionsButtonNEW protected LanguageCompilerSpecPairselectedLanguageNEW protected PluginTooltool-
Fields inherited from class docking.DialogComponentProvider
applyButton, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Change Modifier Constructor Description ImporterDialog(PluginTool tool, ProgramManager programManager, java.util.Map<Loader,java.util.Collection<LoadSpec>> loadMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)Construct a new dialog for importing a file as a new program into Ghidra.protectedImporterDialog(java.lang.String title, PluginTool tool, java.util.Map<Loader,java.util.Collection<LoadSpec>> loadMap, ByteProvider byteProvider, java.lang.String suggestedDestinationPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Change Modifier and Type Method Description voidclose()NEW protected java.util.List<Option>getOptions(LoadSpec loadSpec)NEW protected LoadergetSelectedLoader()NEW protected LoadSpecgetSelectedLoadSpec(Loader loader)NEW protected booleanisSupported(Loader loader)NEW protected voidokCallback()The callback method for when the "OK" button is pressed.NEW protected voidselectedLoaderChanged()voidsetDestinationFolder(DomainFolder folder)Sets the destination folder for the imported program.NEW protected voidsetSelectedLanguage(LanguageCompilerSpecPair lcsPair)NEW protected booleanvalidateFormInput()-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, dialogClosed, dialogShown, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getIntialLocation, getLocationOnScreen, getPreferredSize, getRemberSize, getRememberLocation, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, main, 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 NEW
protected PluginTool tool
-
fsrl NEW
protected FSRL fsrl
-
options NEW
protected java.util.List<Option> options
-
selectedLanguage NEW
protected LanguageCompilerSpecPair selectedLanguage
-
byteProvider NEW
protected ByteProvider byteProvider
Constructor Detail
-
ImporterDialog
public ImporterDialog(PluginTool tool, ProgramManager programManager, java.util.Map<Loader,java.util.Collection<LoadSpec>> loadMap, 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 nullloadMap- the loaders and their corresponding load specificationsbyteProvider- the ByteProvider for getting the bytes from the file to be imported.suggestedDestinationPath- 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 folderoption 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, java.util.Map<Loader,java.util.Collection<LoadSpec>> loadMap, 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 NEW
protected boolean isSupported(Loader loader)
-
okCallback NEW
protected void okCallback()
Description copied from class:DialogComponentProviderThe callback method for when the "OK" button is pressed.- Overrides:
okCallbackin classDialogComponentProvider
-
close
public void close()
- Overrides:
closein classDialogComponentProvider
-
getSelectedLoader NEW
protected Loader getSelectedLoader()
-
setSelectedLanguage NEW
protected void setSelectedLanguage(LanguageCompilerSpecPair lcsPair)
-
-