Package ghidra.app.util.datatype
Class DataTypeSelectionDialog
- java.lang.Object
-
- docking.DialogComponentProvider
-
- ghidra.app.util.datatype.DataTypeSelectionDialog
-
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
- Direct Known Subclasses:
ApplyEnumDialog
public class DataTypeSelectionDialog extends DialogComponentProvider
A dialog that allows the user to choose from available data types or create new ones.
-
-
Field Summary
-
Fields inherited from class docking.DialogComponentProvider
applyButton, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Constructor Description DataTypeSelectionDialog(PluginTool pluginTool, DataTypeManager dtm, int maxSize, DataTypeParser.AllowedDataTypes allowedTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelCallback()
The callback method for when the "Cancel" button is pressed.void
clearUserChosenDataType()
Clears the last user selection.void
close()
protected javax.swing.JComponent
createEditorPanel(DataTypeSelectionEditor dtEditor)
protected void
dialogShown()
Override this method if you want to do something when the dialog is made visibleDataTypeSelectionEditor
getEditor()
DataType
getUserChosenDataType()
The data type choice of the user or null if the dialog was cancelled.protected void
okCallback()
The callback method for when the "OK" button is pressed.void
setInitialDataType(DataType dataType)
Sets the value that this dialog will display in it's editor when initially shown.void
setTabCommitsEdit(boolean doesCommit)
If true then a Tab key press will work the same as pressing the Enter key.-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, dialogClosed, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, 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
-
-
-
-
Constructor Detail
-
DataTypeSelectionDialog
public DataTypeSelectionDialog(PluginTool pluginTool, DataTypeManager dtm, int maxSize, DataTypeParser.AllowedDataTypes allowedTypes)
-
-
Method Detail
-
createEditorPanel
protected javax.swing.JComponent createEditorPanel(DataTypeSelectionEditor dtEditor)
-
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
-
cancelCallback
protected void cancelCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.- Overrides:
cancelCallback
in classDialogComponentProvider
-
okCallback
protected void okCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "OK" button is pressed.- Overrides:
okCallback
in classDialogComponentProvider
-
close
public void close()
- Overrides:
close
in classDialogComponentProvider
-
setTabCommitsEdit
public void setTabCommitsEdit(boolean doesCommit)
If true then a Tab key press will work the same as pressing the Enter key. If false, then a Tab key press will trigger navigation, as is normally done in Java.This method is useful for widgets that have embedded editors that launch this dialog. For these editors, like tables, it is nice to be able to tab through various editors. This method allows these editors to keep this functionality, even though a new dialog was shown.
- See Also:
#wasClosedByTab
-
setInitialDataType
public void setInitialDataType(DataType dataType)
Sets the value that this dialog will display in it's editor when initially shown.- Parameters:
dataType
- The initial data type to use for editing.
-
clearUserChosenDataType
public void clearUserChosenDataType()
Clears the last user selection. This is useful if this dialog is reused and the call wants to make sure that old selections do not appear later.
-
getUserChosenDataType
public DataType getUserChosenDataType()
The data type choice of the user or null if the dialog was cancelled.- Returns:
- The data type choice of the user or null if the dialog was cancelled.
-
getEditor
public DataTypeSelectionEditor getEditor()
-
-