private void performToolButtonAction(final DockingActionIf action, String name, boolean doWait,
			boolean runningTool) throws Exception {
		final ToolButton tb = findToolButton(frontEndTool.getToolFrame(), name, runningTool);
		Runnable r = () -> action.actionPerformed(new DefaultActionContext(null, tb, tb));
		if (doWait) {
			runSwing(r);
		}
		else {
			runSwing(r, false);
		}
		waitForSwing();
	}
Tests for tool actions on the front end (Ghidra project window)
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java