void setSelectedFile(File dir, File selectedFile) {
			if (!parentDir.equals(dir)) {
				// not my dir; don't save the selection
				return;
			}

			if (selectedFile == null) {
				// nothing to save
				return;
			}

			File selectedParent = selectedFile.getParentFile();
			if (parentDir.equals(selectedParent)) {
				this.selectedFile = selectedFile;
			}
		}
Container class to manage history entries for a directory and any selected file
Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java