private PluginTool defaultLaunch(ToolTemplate template,
			Function<PluginTool, Boolean> openFunction) {

		DefaultLaunchMode defaultLaunchMode = getDefaultLaunchMode();
		if (defaultLaunchMode == DefaultLaunchMode.REUSE_TOOL) {
			if (template != null) {
				// attempt to reuse running tool with default name
				String defaultToolName = template.getName();
				for (PluginTool tool : getRunningTools()) {
					if (tool.getName().equals(defaultToolName) && openFunction.apply(tool)) {
						return tool;
					}
				}
			}

			// attempt to reuse any running tool
			for (PluginTool tool : getRunningTools()) {
				if (openFunction.apply(tool)) {
					return tool;
				}
			}
		}

		if (template == null) {
			return null; // unable to launch new tool
		}

		Workspace workspace = toolManager.getActiveWorkspace();
		PluginTool tool = workspace.runTool(template);
		if (tool == null) {
			return null; // tool launch failed
		}
		tool.setVisible(true);
		openFunction.apply(tool);
		return tool;
	}
Implementation of service used to manipulate tools.
Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java