private ToolButton findToolButton(Container parent, String toolName, boolean runningTool) {
		Component[] comps = parent.getComponents();
		for (Component comp : comps) {
			if (comp instanceof ToolButton) {
				ToolButton tb = (ToolButton) comp;
				if (tb.getToolTemplate().getName().equals(toolName) &&
					(tb.isRunningTool() == runningTool)) {
					return tb;
				}
			}
			else if (comp instanceof Container) {
				ToolButton tb = findToolButton((Container) comp, toolName, runningTool);
				if (tb != null) {
					return tb;
				}
			}
		}
		return null;
	}
Tests for tool actions on the front end (Ghidra project window)
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java