private void showXrefs(ActionContext context) {

		TableService service = tool.getService(TableService.class);
		if (service == null) {
			Msg.showWarn(this, null, "No Table Service", "Please add the TableServicePlugin.");
			return;
		}

		ListingActionContext lac = (ListingActionContext) context;
		ProgramLocation location = lac.getLocation();
		if (location == null) {
			return; // not sure if this can happen
		}

		Set<Reference> refs = XReferenceUtils.getAllXrefs(location);
		XReferenceUtils.showXrefs(lac.getNavigatable(), tool, service, location, refs);
	}
Plugin to show a list of references to the item represented by the location of the cursor.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/LocationReferencesPlugin.java