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
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
ConstructorDescriptionOpenVersionedFileDialog
(PluginTool tool, String title, Class<T> domainObjectClass) ConstructorOpenVersionedFileDialog
(PluginTool tool, String title, Class<T> domainObjectClass, List<T> openDomainObjects) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected JPanel
void
close()
protected void
Override this method if you want to do something when the dialog is made invisibleprotected void
Override this method if you want to do something when the dialog is made visiblegetActionContext
(MouseEvent event) An optional extension point for subclasses to provider action context for the actions used by this provider.Get the selected domain file.Get the selected folder.getDomainObject
(Object consumer, boolean immutable) Get the selected domain object for read-only or immutable use.int
Return the selected version number from the history panel.Methods inherited from class ghidra.framework.main.AbstractDataTreeDialog
actionPerformed, addOkActionListener, buildDataTreePanel, cancelCallback, getDefaultFilter, getNameText, initializeFocusedComponent, okCallback, selectDomainFile, selectFolder, selectRootDataFolder, 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, 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, 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
-
Constructor Details
-
OpenVersionedFileDialog
Constructor- Parameters:
tool
- tool where the file is being opened.title
- title to usedomainObjectClass
- 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 usedomainObjectClass
- 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
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 (seeDomainObject.release(Object)
).- Parameters:
consumer
- domain object consumerimmutable
- 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
Description copied from class:AbstractDataTreeDialog
Get the selected domain file.- Overrides:
getDomainFile
in classAbstractDataTreeDialog
- Returns:
- null if there was no domain file selected
-
getDomainFolder
Description copied from class:AbstractDataTreeDialog
Get the selected folder.- Overrides:
getDomainFolder
in classAbstractDataTreeDialog
- Returns:
- null if there was no domain folder selected
-
buildMainPanel
-
close
public void close()- Overrides:
close
in classAbstractDataTreeDialog
-
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 classDialogComponentProvider
-
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 classDialogComponentProvider
-
addTreeListeners
protected void addTreeListeners()- Overrides:
addTreeListeners
in classAbstractDataTreeDialog
-
getActionContext
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 interfaceActionContextProvider
- Overrides:
getActionContext
in classAbstractDataTreeDialog
- Parameters:
event
- The mouse event used (may be null) to generate a popup menu
-