@Override
	protected boolean isEnabledForContext(ProgramLocationActionContext context) {
		if (context.getSelection() != null && !context.getSelection().isEmpty()) {
			updatePopupMenuName(true);
			return true;
		}
		Data componentData = getComponentData(context.getLocation());
		if (componentData == null) {
			return false;
		}

		updatePopupMenuName(false);
		return true;
	}
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