private void accumulateDataSettingsDefinitions(TaskMonitor monitor)
				throws CancelledException {

			List<Class<? extends SettingsDefinition>> defClasses = new ArrayList<>();
			List<SettingsDefinition> defs = new ArrayList<>();

			Listing listing = program.getListing();
			DataIterator definedData = listing.getDefinedData(selection, true);
			if (!definedData.hasNext()) {
				return;
			}
			Data d = definedData.next();
			monitor.incrementProgress(d.getLength());
			for (SettingsDefinition def : d.getDataType().getSettingsDefinitions()) {
				if (def instanceof TypeDefSettingsDefinition) {
					continue; // default-use-only settings not supported
				}
				defs.add(def);
				defClasses.add(def.getClass());
			}

			while (!defClasses.isEmpty() && definedData.hasNext()) {
				monitor.checkCancelled();
				d = definedData.next();
				removeMissingDefinitions(defClasses, defs,
					d.getDataType().getSettingsDefinitions());
				monitor.incrementProgress(d.getLength());
			}
			defsArray = new SettingsDefinition[defs.size()];
			defs.toArray(defsArray);
		}
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