GhidraFileChooser createFileChooser(String preferenceName) {
		// start the browsing in the user's preferred project directory
		File projectDir = new File(GenericRunInfo.getProjectsDirPath());
		if (preferenceName != null) {
			String dirPath = Preferences.getProperty(preferenceName, null, true);
			if (dirPath != null) {
				projectDir = new File(dirPath);
			}
		}

		GhidraFileChooser fileChooser = new GhidraFileChooser(tool.getToolFrame());
		fileChooser.setCurrentDirectory(projectDir);
		fileChooser.setMultiSelectionEnabled(false);
		fileChooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);
		fileChooser.setFileFilter(new GhidraFileFilter() {
			@Override
			public String getDescription() {
				return "Ghidra Projects (*" + ProjectLocator.getProjectExtension() + ")";
			}

			@Override
			public boolean accept(File pathname, GhidraFileChooserModel model) {
				String lowerCaseName = pathname.getName().toLowerCase();
				if (model.isDirectory(pathname)) {
					return !lowerCaseName.endsWith(ProjectLocator.getProjectDirExtension());
				}
				if (lowerCaseName.endsWith(ProjectLocator.getProjectExtension())) {
					return true;
				}
				return false;
			}
		});
		fileChooser.rescanCurrentDirectory();
		return fileChooser;
	}
Popup up file chooser dialog so the user can select the
location for the exported tool file.
@param template template to export
@param msgSource source of status message for successful export
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java