@Override
	public Component getCustomEditorComponent() {
		final SaveState state = getState();
		String defaultValue = (String) getValue();
		String lastFolderPath =
			state != null ? state.getString(getName(), defaultValue) : defaultValue;
		setValue(lastFolderPath);
		JTextField textField = new JTextField(lastFolderPath);
		textField.setEditable(false);
		JButton button = new BrowseButton();
		button.addActionListener(e -> {
			DataTreeDialog dataTreeDialog =
				new DataTreeDialog(null, "Choose a project folder", CHOOSE_FOLDER);
			String folderPath = lastFolderPath.isBlank() ? "/" : lastFolderPath;
			dataTreeDialog.setSelectedFolder(
				AppInfo.getActiveProject().getProjectData().getFolder(folderPath));
			dataTreeDialog.showComponent();
			DomainFolder folder = dataTreeDialog.getDomainFolder();
			if (folder != null) {
				String newFolderPath = folder.getPathname();
				textField.setText(newFolderPath);
				setValue(newFolderPath);
				if (state != null) {
					state.putString(getName(), newFolderPath);
				}
			}
		});
		JPanel panel = new JPanel(new BorderLayout());
		panel.add(textField, BorderLayout.CENTER);
		panel.add(button, BorderLayout.EAST);
		return panel;
	}
Creates a new {@link DomainFolderOption}

@param name The name of the option
@param arg The option's command line argument (could be null)
Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/DomainFolderOption.java