@Override
	Highlight[] getHighlights(String text, Object object,
			Class<? extends FieldFactory> fieldFactoryClass, Color highlightColor) {

		Address currentAddress = getAddressForHighlightObject(object);
		if (!isInAddresses(currentAddress)) {
			return EMPTY_HIGHLIGHTS;
		}

		if (MnemonicFieldFactory.class.isAssignableFrom(fieldFactoryClass) &&
			(object instanceof Data)) {

			// Not sure if we should ever highlight the mnemonic.  It would only be for data.
			// But, we are always looking for the field of a type, then mnemonic will only hold
			// the parent's name and not the field's name.
		}
		else if (LabelFieldFactory.class.isAssignableFrom(fieldFactoryClass)) {
			// It would be nice to highlight the label that points into data structures.
			// However, the label is on the parent address, which is not in our list of matches
			// when we are offcut.  Further, using the program to lookup each address that
			// comes in to see if it is our paren't address seems too expensive, as highlighting
			// code is called for every paint operation.
			//
			// We could add the parent match to the list of known addresses and then use that
			// to lookup in real-time later.  To do this we would need the current list of
			// reference addresses and a new list of parent data addresses.  That seems a bit
			// involved just for highlighting a label.
		}
		else if (OperandFieldFactory.class.isAssignableFrom(fieldFactoryClass)) {

			// Not sure how to get the correct part of the text.  This is a hack for now.
			int offset = StringUtils.indexOfIgnoreCase(text, typeDisplayString, 0);
			if (offset != -1) {
				return new Highlight[] { new Highlight(offset,
					offset + typeDisplayString.length() - 1, highlightColor) };
			}
		}
		else if (FieldNameFieldFactory.class.isAssignableFrom(fieldFactoryClass)) {

			String fieldName = fieldMatcher.getFieldName();
			if (text.equalsIgnoreCase(fieldName)) {
				return new Highlight[] { new Highlight(0, text.length(), highlightColor) };
			}

			String typeName = getDataTypeName();
			if (text.equalsIgnoreCase(typeName)) {
				return new Highlight[] { new Highlight(0, text.length(), highlightColor) };
			}
		}

		return EMPTY_HIGHLIGHTS;
	}
A data type location descriptor that allows you to represent a location for a member field of a
data type, such as a composite or an enum
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/GenericCompositeDataTypeLocationDescriptor.java