private void handleApply() {

		// get the data model as an array of strings
		String[] userPluginPaths = getUserPluginPaths();

		// update Ghidra Preferences with new paths
		Preferences.setPluginPaths(userPluginPaths);

		errorMsg = null;
		// save the new values
		if (Preferences.store()) {
			setStatusMessage("Saved plugin paths successfully!");
			// indicate to user all changes have been applied
			setApplyEnabled(false);

			Msg.showInfo(getClass(), rootPanel, "Restart Ghidra",
				"You must restart Ghidra in order\n" + "for path changes to take effect.");
		}
		else {
			setStatusMessage("");
			Msg.showError(this, rootPanel, "Error Saving Plugin Paths",
				"Failed to update user preferences (see log for details)");
		}
	}
done here so can be handled in a separate thread
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/EditPluginPathDialog.java