@Override
    public boolean isEnabledForContext(ActionContext context) {
    	Object contextObject = context.getContextObject();
		if (contextObject instanceof FieldHeaderLocation) {
			loc = (FieldHeaderLocation)contextObject;
			FieldFactory ff = loc.getFieldFactory();
			return ff != null && ff.isEnabled(); 
		}
		return false;
    }
Constructor
@param owner the action owner
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/format/actions/DisableFieldAction.java