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.
DocumentFilter registered on BaseDocument (or subclasses) doesn't receive insert/remove/replace events.
I hope it's correct category, so I'm reassigning to Mila.
Created attachment 23525 [details] Patch for playing around
I was looking at the diff and it seems ok to me. Please integrate it but before it please run overall IDE tests to ensure that no parts of the IDE will be affected by this change. Thanks.
The patch no longer applies cleanly - it needs to be applied by applying its pieces manually. To ensure that this will not have any side effects, the stable IDE tests should be run e.g. on test4u and the same set of tests should be run as well after applying of the patch. Reassigning to dprusa.
Discussed with Martin A. - this issue is no longer blocker for NB 5.0 (a workaround has been already implemented). Decreasing priority to P3.
Is this issue still valid?
Yes, this issue is still valid. Anything derived from BaseDocument, which means all Netbeans document implementations, will ignore DocumentFilter set on the document. I'm not sure why Martin needed it in the first place, but we should either fix it (non-trivial or maybe even impossible when still supporting old Syntax) or mention it in the docs. Or perhaps even enforce it by overriding get{set}DocumentFilter, making them final and throwing exception from the setter. Martine, how big limitation for you is not having DocumentFilter? Thanks
Let's keep it as it is. Mentioning this in javadoc might be useful. I don't need it anymore as it was problem in 5.0 and I don't even remember why I needed that.
BTW supporting filters would be useful for openide/text since currently the IDE cannot prevent modifications before acquiring a file lock. In case it finds out that a particular file is readonly or can't acquire the lock for some other reason it has to undo the performed modifications. Filters could solve this much more nicely and efficiently.
Ok, I'll make it an RFE then. Thanks
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss