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 JButton`
  `folderButton`
  `protected JTextField`
  `folderNameTextField`
  `protected FSRL`
  `fsrl`
  `protected JButton`
  `languageButton`
  `protected JTextField`
  `languageTextField`
  `protected GhidraComboBox<Loader>`
  `loaderComboBox`
  `protected JTextField`
  `nameTextField`
  `protected List<Option>`
  `options`
  `protected 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, String suggestedDestinationPath)`
  Construct a new dialog for importing a file as a new program into Ghidra.
  `protected`
  `ImporterDialog(String title, PluginTool tool, LoaderMap loaderMap, ByteProvider byteProvider, String suggestedDestinationPath)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected List<Option>`
  `getOptions(LoadSpec loadSpec)`
  `protected Loader`
  `getSelectedLoader()`
  `protected LoadSpec`
  `getSelectedLoadSpec(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, closeDialog, dialogClosed, dialogShown, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocation, getId, getInitialLocation, getLocationOnScreen, getParent, getPreferredSize, getRememberLocation, getRememberSize, 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### tool

    protected PluginTool tool

  - ### fsrl

    protected FSRL fsrl

  - ### options

    protected List<Option> options

  - ### selectedLanguage

    protected LanguageCompilerSpecPair selectedLanguage

  - ### byteProvider

    protected ByteProvider byteProvider

  - ### nameTextField

    protected JTextField nameTextField

  - ### folderButton

    protected JButton folderButton

  - ### languageButton

    protected JButton languageButton

  - ### languageTextField

    protected JTextField languageTextField

  - ### optionsButton

    protected JButton optionsButton

  - ### folderNameTextField

    protected JTextField folderNameTextField

  - ### loaderComboBox

    protected GhidraComboBox<Loader> loaderComboBox

- ## Constructor Details

  - ### ImporterDialog

    public ImporterDialog(PluginTool tool, ProgramManager programManager, LoaderMap loaderMap, ByteProvider byteProvider, 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 null
      `loaderMap` - the loaders and their corresponding load specifications
      `byteProvider` - 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 closed
      `suggestedDestinationPath` - optional string path that will be pre-pended to the destination name. Any path specified in the destination name field will be created when the user performs the import (as opposed to the `destination 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(String title, PluginTool tool, LoaderMap loaderMap, ByteProvider byteProvider, String suggestedDestinationPath)

- ## Method Details

  - ### setDestinationFolder

    public void setDestinationFolder(DomainFolder folder)
    Sets the destination folder for the imported program.
    Parameters:
      `folder` - the folder to store the imported program.

  - ### 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 class `DialogComponentProvider`

  - ### close

    public void close()
    Overrides:
      `close` in class `DialogComponentProvider`

  - ### getOptions

    protected List<Option> getOptions(LoadSpec loadSpec)

  - ### getSelectedLoadSpec

    protected LoadSpec getSelectedLoadSpec(Loader loader)

  - ### getSelectedLoader

    protected Loader getSelectedLoader()

  - ### validateFormInput

    protected boolean validateFormInput()

  - ### setSelectedLanguage

    protected void setSelectedLanguage(LanguageCompilerSpecPair lcsPair)