This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Consider a situation when a code obtains a EditorCookie implementation and uses OpenAPI calls to manipulate it. It should be able to receive a notification when the DataObject goes away, which may be caused by an unrelated OpenAPI call. Currently the only supported change notification is send when the document open state changes. If changed, it could support also a notification when the contents become modified or unmodified -- not all EditorCookies refer to a whole DataObject (so the SaveCookie cannot be used to supplement this change).
I am setting milestone to 4.0 because this does not seem trivial to do compatibly--for one thing, EditorCookie is an interface so either it would need to be changed, or we make e.g. EditorCookie.Stateful or something a subinterface. Anyway, move back to 3.4 (I guess not 3.3) if you disagree. I have noticed for a long time that CloneableEditorSupport has methods add/removeChangeListener but these are not in EditorCookie! In practice I have found these methods necessary for all sorts of purposes. So if you build some support based on an EditorCookie you need to cast it to CloneableEditorSupport in order to find out about document reloads and similar things. Re. Svata's requests--(1) I think if a data object is invalidated (is this what you are talking about?) then stateChanged should be fired from to change listeners; (2) if there is no DataObject/SaveCookie, what precisely does "modified/unmodified" mean? It has to be related to something outside the editor document itself IMHO.
Reassign to new owner of openide/editor
reassigne to David K., new owner of editor
I think I just implemented this one. *** This issue has been marked as a duplicate of 31101 ***
verified - it's duplicate.