public static void pressButtonByName(Container container, String buttonName,
			boolean waitForCompletion) {

		AbstractButton button = (AbstractButton) findComponentByName(container, buttonName);
		if (button == null) {
			throw new AssertionError("Couldn't find button " + buttonName + ".");
		}
		if (!runSwing(() -> button.isShowing())) {
			throw new AssertionError("Button " + buttonName + " is not showing.");
		}
		if (!runSwing(() -> button.isEnabled())) {
			throw new AssertionError("Button " + buttonName + " is not enabled.");
		}
		pressButton(button, waitForCompletion);
	}
Finds the button with the indicated NAME that is a subcomponent of the
indicated container, and then programmatically presses the button.

@param container the container to search. (Typically a dialog.)
@param buttonName the name on the desired AbstractButton (see
           Component.setName()).
@param waitForCompletion if true wait for action to complete before
           returning, otherwise schedule action to be performed and
           return immediately
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java