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.

Bug 61821 - baseDocument ingnores registered DocumentFilter
Summary: baseDocument ingnores registered DocumentFilter
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milutin Kristofic
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2005-08-05 06:50 UTC by Martin Adamek
Modified: 2016-07-07 07:30 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch for playing around (5.39 KB, text/plain)
2005-08-05 12:03 UTC, Martin Adamek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Adamek 2005-08-05 06:50:37 UTC
DocumentFilter registered on BaseDocument (or subclasses) doesn't receive
insert/remove/replace events.
Comment 1 Martin Adamek 2005-08-05 06:51:44 UTC
I hope it's correct category, so I'm reassigning to Mila.
Comment 2 Martin Adamek 2005-08-05 12:03:57 UTC
Created attachment 23525 [details]
Patch for playing around
Comment 3 Miloslav Metelka 2005-08-24 10:23:12 UTC
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.
Comment 4 Miloslav Metelka 2005-11-15 14:57:17 UTC
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.
Comment 5 Daniel Prusa 2005-11-21 14:37:51 UTC
Discussed with Martin A. - this issue is no longer blocker for NB 5.0 (a
workaround has been already implemented). Decreasing priority to P3.
Comment 6 Jan Becicka 2008-02-15 08:26:39 UTC
Is this issue still valid?
Comment 7 Vitezslav Stejskal 2008-02-15 10:47:03 UTC
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
Comment 8 martin_adamek 2008-02-15 14:16:03 UTC
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.
Comment 9 Miloslav Metelka 2008-02-15 14:30:42 UTC
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.
Comment 10 Vitezslav Stejskal 2008-02-18 10:57:04 UTC
Ok, I'll make it an RFE then. Thanks
Comment 11 Martin Balin 2016-07-07 07:30:59 UTC
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