private File chooseFile(Component parent, String buttonText) {
		if (fileChooser == null) {
			fileChooser = new GhidraFileChooser(parent);
		}

		fileChooser.setFileFilter(filter);
		fileChooser.setFileSelectionMode(selectionMode);

		// start the browsing in the user's preferred directory
		//
		File directory =
			new File(Preferences.getProperty(propertyName, System.getProperty("user.home")));
		fileChooser.setCurrentDirectory(directory);
		fileChooser.setSelectedFile(directory);

		File file = fileChooser.getSelectedFile();
		if (file != null) {
			// record where we last exported a file from to the user's preferences
			Preferences.setProperty(propertyName, file.getAbsolutePath());
		}

		return file;
	}
@see java.awt.Component#setEnabled(boolean)
Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooserPanel.java