private LocationDescriptor getDescriptor(ListingActionContext context) {
		ProgramLocation location = context.getLocation();
		if (location.getAddress() == null) {
			if (location.getComponentPath() == null) {
				return null;
			}
		}

		LocationDescriptor descriptor = plugin.getLocationDescriptor(location);
		return descriptor;
	}
{@link LocationReferencesPlugin}'s action for finding references to a thing.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/FindReferencesToAction.java