mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-497 - Deprecated broken method on ListSelectionTableDialog
This commit is contained in:
parent
bb96e37f02
commit
a33e294857
2 changed files with 27 additions and 8 deletions
|
@ -118,24 +118,44 @@ public class ListSelectionTableDialog<T> extends DialogComponentProvider {
|
|||
}
|
||||
|
||||
public T show(Component parent) {
|
||||
setMultiSelectionMode(false);
|
||||
setSelectionMode(false);
|
||||
DockingWindowManager.showDialog(parent, this);
|
||||
return getSelectedItem();
|
||||
}
|
||||
|
||||
public List<T> showSelectMultiple(Component parent) {
|
||||
setMultiSelectionMode(true);
|
||||
setSelectionMode(true);
|
||||
DockingWindowManager.showDialog(parent, this);
|
||||
return getSelectedItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calling this method does does not work correctly when used with
|
||||
* {@link #show(Component)} or {@link #showSelectMultiple(Component)}. To use this method, you
|
||||
* must show the dialog by calling:
|
||||
* <pre>
|
||||
* DockingWindowManager.showDialog(parent, dialog);
|
||||
* </pre>
|
||||
*
|
||||
* <P>There is no need to use this method when using either of the aforementioned
|
||||
* {@code show} methods
|
||||
*
|
||||
* @param enable true to allow multiple selection
|
||||
*
|
||||
* @deprecated to be removed sometime after the 9.3 release
|
||||
*/
|
||||
@Deprecated
|
||||
public void setMultiSelectionMode(boolean enable) {
|
||||
if (enable) {
|
||||
gTable.getSelectionModel()
|
||||
.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
setSelectionMode(enable);
|
||||
}
|
||||
|
||||
private void setSelectionMode(boolean allowMultipleSelections) {
|
||||
ListSelectionModel selectionModel = gTable.getSelectionModel();
|
||||
if (allowMultipleSelections) {
|
||||
selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
}
|
||||
else {
|
||||
gTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue