private static void applySettingsToData(DataSettingsDialog dlg, Data dataTarget) {
		Settings settings = dlg.getSettings();
		Settings defaultSettings = dlg.getDefaultSettings(); // may be null
		for (SettingsDefinition settingsDef : dlg.getSettingsDefinitions()) {
			if (dlg.selection != null && !settingsDef.hasValue(settings)) {
				continue; // No-Choice
			}

			if (settingsDef instanceof EnumSettingsDefinition) {
				EnumSettingsDefinition def = (EnumSettingsDefinition) settingsDef;

				int s = def.getChoice(settings);
				if (defaultSettings != null && s == def.getChoice(defaultSettings)) {
					def.clear(dataTarget);
				}
				else {
					def.setChoice(dataTarget, s);
				}
			}
			else if (settingsDef instanceof BooleanSettingsDefinition) {
				BooleanSettingsDefinition def = (BooleanSettingsDefinition) settingsDef;
				boolean s = def.getValue(settings);
				if (defaultSettings != null && s == def.getValue(defaultSettings)) {
					def.clear(dataTarget);
				}
				else {
					def.setValue(dataTarget, s);
				}
			}
			else if (settingsDef instanceof NumberSettingsDefinition) {
				NumberSettingsDefinition def = (NumberSettingsDefinition) settingsDef;
				long val = def.getValue(settings);
				if (defaultSettings != null && val == def.getValue(defaultSettings)) {
					def.clear(dataTarget);
				}
				else {
					def.setValue(dataTarget, val);
				}
			}
			else {
				throw new AssertException();
			}
		}
	}
Build an array of SettingsDefinitions which are shared across
all defined data constrained by an address set.

The presence of an instruction will result in the selectionContainsInstruction
flag being set.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/DataSettingsDialog.java