private void accumulateInteriorSettingsDefinitions(InteriorSelection interiorSelection,
				TaskMonitor monitor) throws CancelledException {

			List<Class<? extends SettingsDefinition>> defClasses = null;
			List<SettingsDefinition> defs = null;

			int[] from = interiorSelection.getFrom().getComponentPath();
			int[] to = interiorSelection.getTo().getComponentPath();

			Data dataComp = DataPlugin.getDataUnit(program, selection.getMinAddress(), from);
			if (dataComp == null || from.length != to.length) {
				return;
			}
			Data parent = dataComp.getParent();
			int fromIndex = from[from.length - 1];
			int toIndex = to[to.length - 1];
			for (int i = fromIndex; i <= toIndex; i++) {
				monitor.checkCancelled();
				dataComp = parent.getComponent(i);
				if (dataComp == null) {
					break;
				}
				monitor.incrementProgress(dataComp.getLength());
				DataType dt = dataComp.getDataType();
				if (dt == DataType.DEFAULT) {
					continue;
				}
				SettingsDefinition[] settingsDefinitions = dt.getSettingsDefinitions();
				if (settingsDefinitions.length == 0) {
					return;
				}
				if (defClasses == null) {
					defClasses = new ArrayList<>();
					defs = new ArrayList<>();
					for (SettingsDefinition def : settingsDefinitions) {
						defs.add(def);
						defClasses.add(def.getClass());
					}
				}
				else {
					removeMissingDefinitions(defClasses, defs, settingsDefinitions);
				}
			}
			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