Package ghidra.app.tablechooser
Class TableChooserDialog
java.lang.Object
docking.DialogComponentProvider
ghidra.app.tablechooser.TableChooserDialog
- All Implemented Interfaces:
ActionContextProvider
,NavigatableRemovalListener
,StatusListener
,TaskListener
public class TableChooserDialog
extends DialogComponentProvider
implements NavigatableRemovalListener
Dialog to show a table of items. If the dialog is constructed with a non-null
TableChooserExecutor
, then a button will be placed in the dialog, allowing the user
to perform the action defined by the executor.
Each button press will use the selected items as the items to be processed. While the
items are scheduled to be processed, they will still be in the table, painted light gray.
Attempting to reschedule any of these pending items will have no effect. Each time the
button is pressed, a new SwingWorker
is created, which will put the processing into
a background thread. Further, by using multiple workers, the work will be performed in
parallel.
-
Field Summary
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
Constructor Summary
ConstructorDescriptionTableChooserDialog
(PluginTool tool, TableChooserExecutor executor, Program program, String title, Navigatable navigatable) TableChooserDialog
(PluginTool tool, TableChooserExecutor executor, Program program, String title, Navigatable navigatable, boolean isModal) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(AddressableRowObject rowObject) Adds the given object to this dialog.void
addCustomColumn
(ColumnDisplay<?> columnDisplay) void
void
close()
boolean
contains
(AddressableRowObject rowObject) Returns true if the given object is still in the dialog.protected void
Override this method if you want to do something when the dialog is made invisiblevoid
dispose()
Disposes this dialog.int
int[]
boolean
isBusy()
void
protected void
The callback method for when the "OK" button is pressed.void
remove
(AddressableRowObject rowObject) Removes the given object from this dialog.void
selectRows
(int... rows) void
setClosedListener
(Callback callback) Sets the given listener that will get notified when this dialog is closedvoid
setMessage
(String message) void
setSortColumn
(int index) Sets the default sorted column for this dialog.void
setSortState
(TableSortState state) Sets the column sort state for this dialog.void
show()
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, closeDialog, dialogShown, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, 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
-
Method Details
-
setClosedListener
Sets the given listener that will get notified when this dialog is closed- Parameters:
callback
- the callback to notify
-
add
Adds the given object to this dialog. This method can be called from any thread.- Parameters:
rowObject
- the object to add
-
remove
Removes the given object from this dialog. Nothing will happen if the given item is not in this dialog. This method can be called from any thread.- Parameters:
rowObject
- the object to remove
-
contains
Returns true if the given object is still in the dialog. Clients can use this method to see if the user has already processed the given item.- Parameters:
rowObject
- the row object- Returns:
- true if the object is still in the dialog
-
show
public void show() -
close
public void close()- Overrides:
close
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
-
okCallback
protected void okCallback()Description copied from class:DialogComponentProvider
The callback method for when the "OK" button is pressed.- Overrides:
okCallback
in classDialogComponentProvider
-
isBusy
public boolean isBusy() -
addCustomColumn
-
setSortColumn
public void setSortColumn(int index) Sets the default sorted column for this dialog.This method should be called after all custom columns have been added via
addCustomColumn(ColumnDisplay)
.- Parameters:
index
- the view's 0-based column index- Throws:
IllegalArgumentException
- if an invalid column is requested for sorting- See Also:
-
setSortState
Sets the column sort state for this dialog. TheTableSortState
allows for combinations of sorted columns in ascending or descending order.This method should be called after all custom columns have been added via
addCustomColumn(ColumnDisplay)
.- Parameters:
state
- the sort state- Throws:
IllegalArgumentException
- if an invalid column is requested for sorting- See Also:
-
setMessage
-
getRowCount
public int getRowCount() -
clearSelection
public void clearSelection() -
selectRows
public void selectRows(int... rows) -
getSelectedRows
public int[] getSelectedRows() -
getSelectedRowObjects
-
dispose
public void dispose()Description copied from class:DialogComponentProvider
Disposes this dialog. Only call this when the dialog is no longer used. Calling this method will close the dialog if it is open.- Overrides:
dispose
in classDialogComponentProvider
-