Package ghidra.framework.main
Class DataTreeDialog
- java.lang.Object
-
- docking.DialogComponentProvider
-
- ghidra.framework.main.DataTreeDialog
-
- All Implemented Interfaces:
ActionContextProvider,GTreeSelectionListener,StatusListener,TaskListener,java.awt.event.ActionListener,java.util.EventListener
- Direct Known Subclasses:
OpenVersionedFileDialog
public class DataTreeDialog extends DialogComponentProvider implements GTreeSelectionListener, java.awt.event.ActionListener
Dialog to open or save domain data items to a new location or name.
-
-
Field Summary
Fields Modifier and Type Field Description static intCHOOSE_FOLDERDialog type for choosing a user folder.static intCREATEDialog type for creating domain data files.protected static intHEIGHTstatic intOPENDialog type for opening domain data files.static intSAVEDialog type for saving domain data files.protected ProjectDataTreePaneltreePanelprotected static intWIDTH-
Fields inherited from class docking.DialogComponentProvider
applyButton, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Constructor Description DataTreeDialog(java.awt.Component parent, java.lang.String title, int type)Construct a new DataTreeDialog.DataTreeDialog(java.awt.Component parent, java.lang.String title, int type, DomainFileFilter filter)Construct a new DataTreeDialog.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)Action listener for the project combo box.voidaddOkActionListener(java.awt.event.ActionListener l)Add action listener that is called when the OK button is hit.protected voidaddTreeListeners()protected javax.swing.JPanelbuildMainPanel()Define the Main panel for the dialog here.protected voidcancelCallback()Called when user hits the cancel button.voidclose()protected voiddialogShown()Override this method if you want to do something when the dialog is made visiblevoidfindAndSelect(java.lang.String s)ActionContextgetActionContext(java.awt.event.MouseEvent event)An optional extension point for subclasses to provider action context for the actions used by this provider.DomainFilegetDomainFile()Get the selected domain file.DomainFoldergetDomainFolder()Get the selected folder.java.lang.StringgetNameText()Get the name from the name field.protected voidokCallback()Gets called when the user clicks on the OK Action for the dialog.voidselectDomainFile(DomainFile file)Select the node that corresponds to the given domain file.voidselectRootDataFolder()Select the root folder in the tree.voidsetNameText(java.lang.String name)voidsetSearchText(java.lang.String string)voidsetSelectedFolder(DomainFolder folder)voidsetTreeSelectionMode(int mode)voidshowComponent()voidvalueChanged(GTreeSelectionEvent e)TreeSelectionListener method that is called whenever the value of the selection changes.booleanwasCancelled()-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, dialogClosed, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocatdion, 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
-
OPEN
public static final int OPEN
Dialog type for opening domain data files.- See Also:
- Constant Field Values
-
SAVE
public static final int SAVE
Dialog type for saving domain data files.- See Also:
- Constant Field Values
-
CHOOSE_FOLDER
public static final int CHOOSE_FOLDER
Dialog type for choosing a user folder.- See Also:
- Constant Field Values
-
CREATE
public static final int CREATE
Dialog type for creating domain data files.- See Also:
- Constant Field Values
-
WIDTH
protected static final int WIDTH
- See Also:
- Constant Field Values
-
HEIGHT
protected static final int HEIGHT
- See Also:
- Constant Field Values
-
treePanel
protected ProjectDataTreePanel treePanel
-
-
Constructor Detail
-
DataTreeDialog
public DataTreeDialog(java.awt.Component parent, java.lang.String title, int type)Construct a new DataTreeDialog.- Parameters:
parent- dialog's parenttitle- title to usetype- specify OPEN, SAVE, CHOOSE_FOLDER, CHOOSE_USER_FOLDER, or CREATE- Throws:
java.lang.IllegalArgumentException- if invalid type is specified
-
DataTreeDialog
public DataTreeDialog(java.awt.Component parent, java.lang.String title, int type, DomainFileFilter filter)Construct a new DataTreeDialog.- 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 tree- Throws:
java.lang.IllegalArgumentException- if invalid type is specified
-
-
Method Detail
-
setTreeSelectionMode
public void setTreeSelectionMode(int mode)
-
addOkActionListener
public void addOkActionListener(java.awt.event.ActionListener l)
Add action listener that is called when the OK button is hit.- Parameters:
l- listener to add
-
getActionContext
public ActionContext getActionContext(java.awt.event.MouseEvent event)
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
-
showComponent
public void showComponent()
-
dialogShown
protected void dialogShown()
Description copied from class:DialogComponentProviderOverride this method if you want to do something when the dialog is made visible- Overrides:
dialogShownin classDialogComponentProvider
-
getNameText
public java.lang.String getNameText()
Get the name from the name field.
-
setNameText
public void setNameText(java.lang.String name)
-
setSelectedFolder
public void setSelectedFolder(DomainFolder folder)
-
getDomainFile
public DomainFile getDomainFile()
Get the selected domain file.- Returns:
- null if there was no domain file selected
-
getDomainFolder
public DomainFolder getDomainFolder()
Get the selected folder.- Returns:
- null if there was no domain folder selected
-
valueChanged
public void valueChanged(GTreeSelectionEvent e)
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
public void actionPerformed(java.awt.event.ActionEvent e)
Action listener for the project combo box.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
e- event generated when a selection is made in the combo box
-
selectRootDataFolder
public void selectRootDataFolder()
Select the root folder in the tree.
-
selectDomainFile
public void selectDomainFile(DomainFile file)
Select the node that corresponds to the given domain file.
-
close
public void close()
- Overrides:
closein classDialogComponentProvider
-
buildMainPanel
protected javax.swing.JPanel buildMainPanel()
Define the Main panel for the dialog here.- Returns:
- JPanel the completed
Main Panel<\CODE>
-
okCallback
protected void okCallback()
Gets called when the user clicks on the OK Action for the dialog.- Overrides:
okCallbackin classDialogComponentProvider
-
wasCancelled
public boolean wasCancelled()
-
cancelCallback
protected void cancelCallback()
Called when user hits the cancel button.- Overrides:
cancelCallbackin classDialogComponentProvider
-
addTreeListeners
protected void addTreeListeners()
-
findAndSelect
public void findAndSelect(java.lang.String s)
-
setSearchText
public void setSearchText(java.lang.String string)
-
-