Package ghidra.framework.main
Class AbstractDataTreeDialog
java.lang.Object
docking.DialogComponentProvider
ghidra.framework.main.AbstractDataTreeDialog
- All Implemented Interfaces:
ActionContextProvider,GTreeSelectionListener,StatusListener,TaskListener,ActionListener,EventListener
- Direct Known Subclasses:
DataTreeDialog,OpenVersionedFileDialog
public abstract class AbstractDataTreeDialog
extends DialogComponentProvider
implements GTreeSelectionListener, ActionListener
Base dialog for choosing DomainFiles. Provides and manages the base data tree panel. Subclasses
should call the buildDataTreePanel() when they are constructing their main panels. They should
also call the initializeFocusedComponent() method so that default focus for the dialog is in
the text field if it is enabled or otherwise the focus should be the tree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected ProjectDataTreePanelprotected static final intFields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataTreeDialog(Component parent, String title, DataTreeDialogType type, DomainFileFilter filter, Project project) Construct a new DataTreeDialog for the given project. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidAdd action listener that is called when the OK button is hit.protected voidprotected JPanelprotected voidThe callback method for when the "Cancel" button is pressed.voidclose()getActionContext(MouseEvent event) An optional extension point for subclasses to provider action context for the actions used by this provider.protected static DomainFileFilterGet the selected domain file.Get the selected folder.getTree()protected voidprotected voidThe callback method for when the "OK" button is pressed.voidselectDomainFile(DomainFile file) Select the node that corresponds to the given domain file.voidselectFolder(DomainFolder folder) Select a folder in the tree.voidsetNameText(String name) voidvoidsetSelectedFolder(DomainFolder folder) Sets a domain folder as the initially selected folder when the dialog is first shown.voidsetTreeSelectionMode(int mode) voidshow()voidShows this dialog.voidTreeSelectionListener method that is called whenever the value of the selection changes.booleanMethods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, closeDialog, createSharedActions, dialogClosed, dialogShown, 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
-
Field Details
-
WIDTH
protected static final int WIDTH- See Also:
-
HEIGHT
protected static final int HEIGHT- See Also:
-
treePanel
-
-
Constructor Details
-
AbstractDataTreeDialog
protected AbstractDataTreeDialog(Component parent, String title, DataTreeDialogType type, DomainFileFilter filter, Project project) Construct a new DataTreeDialog for the given project.- Parameters:
parent- dialog's parenttitle- title to usetype- specify OPEN, SAVE, CHOOSE_FOLDER, or CHOOSE_USER_FOLDERfilter- filter used to control what is displayed in the data treeproject- the project to browse- Throws:
IllegalArgumentException- if invalid type is specified
-
-
Method Details
-
initializeFocusedComponent
protected void initializeFocusedComponent() -
setTreeSelectionMode
public void setTreeSelectionMode(int mode) -
addOkActionListener
Add action listener that is called when the OK button is hit.- Parameters:
l- listener to add
-
getActionContext
Description copied from class:DialogComponentProviderAn optional extension point for subclasses to provider action context for the actions used by this provider.- Specified by:
getActionContextin interfaceActionContextProvider- Overrides:
getActionContextin classDialogComponentProvider- Parameters:
event- The mouse event used (may be null) to generate a popup menu
-
show
public void show() -
showComponent
public void showComponent()Shows this dialog. The preferred show method isshow(), as it is the preferred nomenclature. -
getTree
-
getNameText
-
setNameText
-
setSelectedFolder
Sets a domain folder as the initially selected folder when the dialog is first shown.- Parameters:
folder-DomainFolderto select when showing the dialog
-
getDomainFile
Get the selected domain file.- Returns:
- null if there was no domain file selected
-
getDomainFolder
Get the selected folder.- Returns:
- null if there was no domain folder selected
-
valueChanged
TreeSelectionListener method that is called whenever the value of the selection changes.- Specified by:
valueChangedin interfaceGTreeSelectionListener- Parameters:
e- the event that characterizes the change.
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
selectFolder
Select a folder in the tree.- Parameters:
folder- the folder to select
-
selectDomainFile
Select the node that corresponds to the given domain file.- Parameters:
file- the file
-
close
public void close()- Overrides:
closein classDialogComponentProvider
-
buildDataTreePanel
-
okCallback
protected void okCallback()Description copied from class:DialogComponentProviderThe callback method for when the "OK" button is pressed.- Overrides:
okCallbackin classDialogComponentProvider
-
wasCancelled
public boolean wasCancelled() -
cancelCallback
protected void cancelCallback()Description copied from class:DialogComponentProviderThe callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.- Overrides:
cancelCallbackin classDialogComponentProvider
-
addTreeListeners
protected void addTreeListeners() -
setSearchText
-
getDefaultFilter
-