Package ghidra.framework.main

# Class OpenVersionedFileDialog<T extends DomainObject>

java.lang.Object
docking.DialogComponentProvider
ghidra.framework.main.AbstractDataTreeDialog
ghidra.framework.main.OpenVersionedFileDialog<T>

Type Parameters:
  `T` - domain object class

All Implemented Interfaces:
  `ActionContextProvider`, `GTreeSelectionListener`, `StatusListener`, `TaskListener`, `ActionListener`, `EventListener`

public class OpenVersionedFileDialog<T extends DomainObject> extends AbstractDataTreeDialog
Dialog to open a file that is versioned and allow a version to be opened.

- ## Field Summary

  ### Fields inherited from class ghidra.framework.main.AbstractDataTreeDialog

  `HEIGHT, treePanel, WIDTH`

  ### Fields inherited from class docking.DialogComponentProvider

  `applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OpenVersionedFileDialog(PluginTool tool, String title, Class<T> domainObjectClass)`
  Constructor
  `OpenVersionedFileDialog(PluginTool tool, String title, Class<T> domainObjectClass, List<T> openDomainObjects)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addTreeListeners()`
  `protected JPanel`
  `buildMainPanel()`
  `void`
  `close()`
  `protected void`
  `dialogClosed()`
  Override this method if you want to do something when the dialog is made invisible
  `protected void`
  `dialogShown()`
  Override this method if you want to do something when the dialog is made visible
  `ActionContext`
  `getActionContext(MouseEvent event)`
  An optional extension point for subclasses to provider action context for the actions used by this provider.
  `DomainFile`
  `getDomainFile()`
  Get the selected domain file.
  `DomainFolder`
  `getDomainFolder()`
  Get the selected folder.
  `T`
  `getDomainObject(Object consumer, boolean immutable)`
  Get the selected domain object for read-only or immutable use.
  `int`
  `getVersion()`
  Return the selected version number from the history panel.

  ### Methods inherited from class ghidra.framework.main.AbstractDataTreeDialog

  `actionPerformed, addOkActionListener, buildDataTreePanel, cancelCallback, getNameText, getTree, initializeFocusedComponent, okCallback, selectDomainFile, selectFolder, setNameText, setSearchText, setSelectedFolder, setTreeSelectionMode, show, showComponent, valueChanged, wasCancelled`

  ### Methods inherited from class docking.DialogComponentProvider

  `addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, closeDialog, createSharedActions, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, 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, isDialogKeyBindingAction, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setAccessibleDescription, 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`

- ## Constructor Details

  - ### OpenVersionedFileDialog

    public OpenVersionedFileDialog(PluginTool tool, String title, Class<T> domainObjectClass)
    Constructor
    Parameters:
      `tool` - tool where the file is being opened.
      `title` - title to use
      `domainObjectClass` - allowed domain object class which corresponds to `<T>`

  - ### OpenVersionedFileDialog

    public OpenVersionedFileDialog(PluginTool tool, String title, Class<T> domainObjectClass, List<T> openDomainObjects)
    Constructor
    Parameters:
      `tool` - tool where the file is being opened.
      `title` - title to use
      `domainObjectClass` - allowed domain object class which corresponds to `<T>`
      `openDomainObjects` - if non-null, will cause an additional tab showing the given list of open domain objects that the user can select from

- ## Method Details

  - ### getDomainObject

    public T getDomainObject(Object consumer, boolean immutable)
    Get the selected domain object for read-only or immutable use. If an existing open object is selected its original mode applies but consumer will be added. The caller/consumer is responsible for releasing the returned domain object when done using it (see `DomainObject.release(Object)`).
    Parameters:
      `consumer` - domain object consumer
      `immutable` - true if the domain object should be opened immutable, else false for read-only. Immutable mode should not be used for content that will be modified. If read-only indicated an upgrade will always be performed if required.
    Returns:
      opened domain object or null if a file was not selected or if open failed to complete.

  - ### getVersion

    public int getVersion()
    Return the selected version number from the history panel.
    Returns:
      -1 if a version history was not selected

  - ### getDomainFile

    public DomainFile getDomainFile()
    Description copied from class: `AbstractDataTreeDialog`
    Get the selected domain file.
    Overrides:
      `getDomainFile` in class `AbstractDataTreeDialog`
    Returns:
      null if there was no domain file selected

  - ### getDomainFolder

    public DomainFolder getDomainFolder()
    Description copied from class: `AbstractDataTreeDialog`
    Get the selected folder.
    Overrides:
      `getDomainFolder` in class `AbstractDataTreeDialog`
    Returns:
      null if there was no domain folder selected

  - ### buildMainPanel

    protected JPanel buildMainPanel()

  - ### close

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

  - ### dialogShown

    protected void dialogShown()
    Description copied from class: `DialogComponentProvider`
    Override this method if you want to do something when the dialog is made visible
    Overrides:
      `dialogShown` in class `DialogComponentProvider`

  - ### dialogClosed

    protected void dialogClosed()
    Description copied from class: `DialogComponentProvider`
    Override this method if you want to do something when the dialog is made invisible
    Overrides:
      `dialogClosed` in class `DialogComponentProvider`

  - ### addTreeListeners

    protected void addTreeListeners()
    Overrides:
      `addTreeListeners` in class `AbstractDataTreeDialog`

  - ### getActionContext

    public ActionContext getActionContext(MouseEvent event)
    Description copied from class: `DialogComponentProvider`
    An optional extension point for subclasses to provider action context for the actions used by this provider.
    Specified by:
      `getActionContext` in interface `ActionContextProvider`
    Overrides:
      `getActionContext` in class `AbstractDataTreeDialog`
    Parameters:
      `event` - The mouse event used (may be null) to generate a popup menu