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.
org.openide.awt.HtmlBrowser class needs some minor API enhacements to allow better integration of various embedded browsers.
Created attachment 123355 [details] proposed API changes
Y01 At least the behavior of Lookup and possibly also the property change should be testable in a unit test. Y02 I am surprised the HtmlBrowser is not final (but we were probably young), but so far it has not been designed for subclassing. If I properly understand your proposal, you want to change that. That will mix the API for clients and providers (getLookup, isRunning) which is no good. As far as I can tell the lookup could be provided in constructor of HtmlBrowser. isRunning is imho more state of the Factory/Impl than something that should be overriden by subclasses of HtmlBrowser.
I will move the Lookup to c'tor however David added isRunning() method so I'll leave it to him to defend that API change:)
Re. "I am surprised the HtmlBrowser is not final (but we were probably young), but so far it has not been designed for subclassing." - HtmlBrowser.Impl was designed for subclassing. I agree that it is an old API and lacks separation of SPI and API is therefore hard to enhance. getLookup fits into it nicely though. isRunning, PROP_RUNNING and PROP_LOADING can be deleted as they are not needed anymore
Created attachment 123618 [details] proposed API changes I've removed isRunning() method and made HtmlBrowser.Impl.getLookup() method final.
Re. Y02 - I've realized I my oversight. The new getLookup() method was never intended to be part of HtmlBrowser, but always HtmlBrowser.Impl. In such case the argumentation in Y02 was not valid. HtmlBrowser.Impl was always supposed to be subclassed. As such I have nothing against getLookup() method to be non-final and overidden by subclasses. I beg your pardon.
Created attachment 123662 [details] proposed API changes
The new patch removes isRunning() and adds a test for HtmlBrowser.Impl.getLookup()
If there are no more comments, I'll integrate the changes tomorrow.
core-main f51699bf491c
Integrated into 'main-golden', will be available in build *201209020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f51699bf491c User: S. Aubrecht <saubrecht@netbeans.org> Log: #217171 - API enhancements for embedded browser