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.
The way the FoldViewFactory is registered is quite odd, and seems to rely on a static initialization block call chain: FoldHierarchy.class loaded -> static initialization block -> ensureApiAccessorRegistered() -> ApiPackageAccessor.register -> FoldViewFactory.register(). I've added a comment on nbdev@ [1] and Jesse mentioned in reply [2] that this looks like a perfect candidate for Lookup usage. My suggestion would have been to at least replace the static initialization block with a ModuleInstall, but Lookup is actually nicer. Jesse quote: EditorViewFactory.factories() should use Lookup.getDefault().lookupAll(EditorViewFactory.Factory.class), and FoldViewFactory.FoldFactory and its ilk (HighlightsViewFactory.HighlightsFactory, TestHighlightsViewFactory.FactoryImpl) should be registered using @ServiceProvider. (Which would also obviate the need for the int importance() attribute, since @SP.position could be used.) End quote 1. http://netbeans.org/projects/www/lists/nbdev/archive/2012-01/message/53 2. http://netbeans.org/projects/www/lists/nbdev/archive/2012-01/message/54
It was just a preliminary way until View Hierarchy SPI will be created (issue #205707). In editor related modules we tend to register by using @MimeRegistration annotation so I would prefer that.
OK, will wait :)
Closing after 2 years. View hierarchy is still not a proper API. I am sure the relevant code will be converted when the SPI becomes public.