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 int
CHOOSE_FOLDER
Dialog type for choosing a user folder.static int
CREATE
Dialog type for creating domain data files.protected static int
HEIGHT
static int
OPEN
Dialog type for opening domain data files.static int
SAVE
Dialog type for saving domain data files.protected ProjectDataTreePanel
treePanel
protected static int
WIDTH
-
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 void
actionPerformed(java.awt.event.ActionEvent e)
Action listener for the project combo box.void
addOkActionListener(java.awt.event.ActionListener l)
Add action listener that is called when the OK button is hit.protected void
addTreeListeners()
protected javax.swing.JPanel
buildMainPanel()
Define the Main panel for the dialog here.protected void
cancelCallback()
Called when user hits the cancel button.void
close()
protected void
dialogShown()
Override this method if you want to do something when the dialog is made visiblevoid
findAndSelect(java.lang.String s)
ActionContext
getActionContext(java.awt.event.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.java.lang.String
getNameText()
Get the name from the name field.protected void
okCallback()
Gets called when the user clicks on the OK Action for the dialog.void
selectDomainFile(DomainFile file)
Select the node that corresponds to the given domain file.void
selectRootDataFolder()
Select the root folder in the tree.void
setNameText(java.lang.String name)
void
setSearchText(java.lang.String string)
void
setSelectedFolder(DomainFolder folder)
void
setTreeSelectionMode(int mode)
void
showComponent()
void
valueChanged(GTreeSelectionEvent e)
TreeSelectionListener method that is called whenever the value of the selection changes.boolean
wasCancelled()
-
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: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 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:DialogComponentProvider
Override this method if you want to do something when the dialog is made visible- Overrides:
dialogShown
in 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:
valueChanged
in 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:
actionPerformed
in 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:
close
in 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:
okCallback
in classDialogComponentProvider
-
wasCancelled
public boolean wasCancelled()
-
cancelCallback
protected void cancelCallback()
Called when user hits the cancel button.- Overrides:
cancelCallback
in classDialogComponentProvider
-
addTreeListeners
protected void addTreeListeners()
-
findAndSelect
public void findAndSelect(java.lang.String s)
-
setSearchText
public void setSearchText(java.lang.String string)
-
-