How do I give fields different edit modes (in-line, read only, edit) in the same field editor?

Set the field to custom field renderer, and then use the above javascript snippet.