Ok here is how it worked for me thanks for the suggestions.
@ServiceProviders(
value = { @ServiceProvider(service = HtmlBrowser.Factory.class,
position = 0),
@ServiceProvider(
service = HtmlBrowser.URLDisplayer.class,
position = 0,
supersedes = { "org.netbeans.core.NbURLDisplayer" }) }
)
public class ExternalWebHandler extends URLDisplayer implements
HtmlBrowser.Factory {
/*
* (non-Javadoc)
*
* @see org.openide.awt.HtmlBrowser.Factory#createHtmlBrowserImpl()
*/
@Override
public Impl createHtmlBrowserImpl() {
// TODO Auto-generated method stub
return null;
}
/*
* (non-Javadoc)
*
* @see org.openide.awt.HtmlBrowser.URLDisplayer#showURL(java.net.URL)
*/
@Override
public void showURL(final URL u) {
try {
Desktop.getDesktop().browse(u.toURI());
} catch (IOException | URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
This will open the links from the aboutpage in the external browser.
Only posting this here if anybody else is searching for it.
Again thank you all for the suggestions.
On 2018/10/22 13:42:01, Martin Barnáš <[email protected]> wrote:
> We had requirement from our customer that browser mustn't be available
to users of our application. I dont' think it is possible to remove
internal browser completely but I forbid to use it by creating my own
implementation of service org.openide.awt.HtmlBrowser.Factory and
org.openide.awt.HtmlBrowser.URLDisplayer.>
>
>
> @ServiceProvider(service = HtmlBrowser.Factory.class, position = 0)>
> public class HtmlBrowserFactory implements HtmlBrowser.Factory {>
> // ...>
> }>
>
>
>
> @ServiceProvider(service = URLDisplayer.class,>
> position = 0,>
> supersedes = { "org.netbeans.core.NbURLDisplayer" })>
> public class NoOpUrlDisplayer extends URLDisplayer {>
> private static final Logger LOG =
LoggerFactory.getLogger(NoOpUrlDisplayer.class);>
>
> @Override>
> public void showURL(URL u) {>
> LOG.debug("Usage of browser is forbidden.");>
> }>
> }>
>
>
> ________________________________>
> Od: Sven Marquardt <[email protected]>>
> Odesláno: pondělí 22. října 2018 14:35:48>
> Komu: [email protected]>
> Předmět: Re: [RPC] Disable internal Webbrowser>
>
> I'm talking about netbeans%
signature.asc
Description: OpenPGP digital signature
