Using the Editor API, it is possible to get access to the Swing-based editor which is being used to edit an open file of whatever content type. This would permit you to test what the user was doing with this file; mechanically retrieve and modify text from the open buffer; prevent certain areas of a textual file from being modified by the user; set annotations in the gutter; and so on.
This API also permits a module implementor to add a custom editor for some or all (probably textual) content types. Essentially, any editor implementation may be used which is capable of being embedded as a Swing EditorKit; handling guarded blocks; and handling breakpoints and the like (for Java source).