private void importTool() {

		GhidraFileChooser fileChooser = new GhidraFileChooser(tool.getToolFrame());
		fileChooser.setFileFilter(
			new ExtensionFileFilter(new String[] { "tool", "tcd" }, "Tools"));
		fileChooser.setTitle("Import Tool");
		fileChooser.setApproveButtonText("Import");

		String importDir = Preferences.getProperty(Preferences.LAST_TOOL_IMPORT_DIRECTORY);
		if (importDir != null) {
			File dir = new File(importDir);
			if (dir.isDirectory()) {
				fileChooser.setCurrentDirectory(dir);
			}
		}

		fileChooser.rescanCurrentDirectory();

		File selectedFile = fileChooser.getSelectedFile(true);
		fileChooser.dispose();
		if (selectedFile == null) {
			return;
		}

		if (!selectedFile.exists()) {
			Msg.showError(this, null, "Error",
				"Tool " + selectedFile.getName() + " doesn't exist!");
		}
		Preferences.setProperty(Preferences.LAST_TOOL_IMPORT_DIRECTORY, selectedFile.getParent());
		try {
			addToolTemplate(new FileInputStream(selectedFile.getAbsolutePath()),
				selectedFile.getAbsolutePath());
		}
		catch (Exception e) {
			Msg.showError(this, tool.getToolFrame(), "Error Creating Input Stream",
				"Error creating input stream for\n" + selectedFile.getAbsolutePath() + ": " + e, e);
		}
	}
Pop up a file chooser dialog for the user to find the file to import as a
tool.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolActionManager.java