@Override
	protected void actionPerformed(ProgramLocationActionContext context) {
		ListingModel model = getModel();
		ProgramSelection selection = context.getSelection();
		if (selection != null && !selection.isEmpty()) {
			TaskLauncher.launchModal("Expand Data In Selection",
				monitor -> model.openAllData(selection, monitor));
			return;
		}

		ProgramLocation location = context.getLocation();
		Data data = getComponentData(location);
		TaskLauncher.launchModal("Expand Data In Selection",
			monitor -> model.openAllData(data, monitor));
	}
Action for recursively expanding an expandable data element in the listing.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/actions/ExpandAllDataAction.java