@Override
				public boolean isEnabledForContext(ListingActionContext context) {
					if (context.getLocation() instanceof RegisterTransitionFieldLocation) {
						RegisterTransitionFieldLocation loc =
							(RegisterTransitionFieldLocation) context.getLocation();
						if (loc.getRegister() != null) {
							Address addr = loc.getAddress();
							Register reg = loc.getRegister();
							RegisterValue regVal =
								context.getProgram().getProgramContext().getNonDefaultValue(reg,
									addr);
							return regVal != null && regVal.hasValue();
						}
					}
					return false;
				}
Shows the registers available in a program along with any values that are set.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/register/RegisterPlugin.java