@Override
		public Highlight[] createHighlights(String text, ListingField field, int cursorTextOffset) {

			Class<? extends FieldFactory> fieldFactoryClass = field.getFieldFactory().getClass();

			if (!doHighlight) {
				return NO_HIGHLIGHTS;
			}

			if (checkRemoveHighlights()) {
				return NO_HIGHLIGHTS;
			}

			if (!shouldHighlight(field)) {
				return NO_HIGHLIGHTS;
			}

			if (!searchOptions.searchAllFields() && (fieldFactoryClass == XRefFieldFactory.class ||
				fieldFactoryClass == XRefHeaderFieldFactory.class)) {
				return NO_HIGHLIGHTS;
			}

			if (showAllResults) {
				return getAllHighlights(text, cursorTextOffset);
			}

			Address address = searchResult.programLocation().getAddress();
			ProxyObj<?> proxy = field.getProxy();
			if (proxy.contains(address)) {
				return getSingleSearchHighlight(text, field, cursorTextOffset);
			}

			return NO_HIGHLIGHTS;
		}
Get the address set for the selection.

@return null if there is no selection
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin.java