GP-0 correct AnalysisOptionsTest failures

This commit is contained in:
ghidra1 2021-04-27 09:21:33 -04:00
parent 43476f2e20
commit 4e16b3aa3a
2 changed files with 16 additions and 2 deletions

View file

@ -17,6 +17,7 @@ package docking.widgets.dialogs;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.NoSuchElementException;
import javax.swing.*;
@ -182,4 +183,17 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
Object selectedItem = combo.getSelectedItem();
return selectedItem == null ? null : selectedItem.toString();
}
/**
* Set the current choice to value.
* @param value updated choice
* @throws NoSuchElementException if choice does not permit edits and value is
* not a valid choice.
*/
public void setValue(String value) {
combo.setSelectedItem(value);
if (!combo.isEditable() && !combo.getSelectedItem().equals(value)) {
throw new NoSuchElementException();
}
}
}