ProjectLocator chooseProject(GhidraFileChooser fileChooser, String mode,
			String preferenceName) {
		boolean create = (mode.equals("Create")) ? true : false;
		fileChooser.setTitle(mode + " a Ghidra Project");
		fileChooser.setApproveButtonText(mode + " Project");
		fileChooser.setApproveButtonToolTipText(mode + " a Ghidra Project");
		fileChooser.setSelectedFile(null);

		boolean validInput = false;
		while (!validInput) {
			File file = fileChooser.getSelectedFile();

			if (file != null) {
				String path = file.getAbsoluteFile().getParent();
				String filename = file.getName();

				// strip off extension since the LocalRootFolder takes care of it
				if (filename.endsWith(PROJECT_EXTENSION)) {
					filename = filename.substring(0, filename.lastIndexOf(PROJECT_EXTENSION) - 1);
				}
				// if user enters the name of the project manually and leaves off
				// the extension, try to open or create using the extension
				else if (!create && filename.lastIndexOf(".") > path.lastIndexOf(File.separator)) {
					// treat opening a file without the ghidra extension as an error
					Msg.showError(getClass(), tool.getToolFrame(), "Invalid Project File",
						"Cannot open '" + file.getName() + "' as a Ghidra Project");
					continue;
				}
				if (!NamingUtilities.isValidProjectName(filename)) {
					Msg.showError(getClass(), tool.getToolFrame(), "Invalid Project Name",
						filename + " is not a valid project name");
					continue;
				}
				Preferences.setProperty(preferenceName, path);
				try {
					Preferences.store();
				}
				catch (Exception e) {
					Msg.debug(this,
						"Unexpected exception storing preferences to" + Preferences.getFilename(),
						e);
				}
				return new ProjectLocator(path, filename);
			}
			return null;
		}

		return null;
	}
general project utility that brings up a file chooser for
the user to specify a directory and filename that are used
for the Project location and name

@param fileChooser the chooser used to pick the project
@param mode read-only or not
@param preferenceName the preference property name used to save the last opened project
@return the project locator for the opened project
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java