You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Sven Marquardt <sv...@cbb.de> on 2018/10/22 11:53:26 UTC

[RPC] Disable internal Webbrowser

I wonder if there is an option to disable the internal webbrowser of the
netbeansplatform. Right now everytime i or a user of the application
clicked on a link, the inernal browser will open. Is there a way to
disable this?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [RPC] Disable internal Webbrowser

Posted by Sven Marquardt <sv...@cbb.de>.
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áš <m....@certicon.cz> 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 <sv...@cbb.de>>
> Odesláno: pondělí 22. října 2018 14:35:48>
> Komu: users@netbeans.apache.org>
> Předmět: Re: [RPC] Disable internal Webbrowser>
>
> I'm talking about netbeans%


Re: [RPC] Disable internal Webbrowser

Posted by Sven Marquardt <sv...@cbb.de>.
Thanks i think with this i can open the link with an external browser. I
now only have to figure out how to open it in the external browser. I
also saw this thread
http://netbeans-org.1045718.n5.nabble.com/External-HTML-Browsers-td3025927.html
but that also did not solve my problem.

On 2018/10/22 13:42:01, Martin Barnáš <m....@certicon.cz> 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 <sv...@cbb.de>>
> Odesláno: pondělí 22. října 2018 14:35:48>
> Komu: users@netbeans.apache.org>
> Předmět: Re: [RPC] Disable internal Webbrowser>
>
> I'm talking about netbeans%

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [RPC] Disable internal Webbrowser

Posted by Martin Barnáš <ma...@certicon.cz>.
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 <sv...@cbb.de>
Odesláno: pondělí 22. října 2018 14:35:48
Komu: users@netbeans.apache.org
Předmět: Re: [RPC] Disable internal Webbrowser

I'm talking about netbeans platform. Not the IDE. If i packag my
netbeans platform application i dont want the internal browser get
packaged with my application. My use case is this i have an about dialog
with an html reference to the homepage of the aplication. But when i
click the link in the about dialog, netbeans trys to open it with the
internal webbrowser. Is there any setting where i can force netbeans to
open it with the external browser?

On 2018/10/22 12:25:43, "Lutz Horn" <l....@posteo.de> wrote:
> On Mon, Oct 22, 2018 at 01:53:26PM +0200, Sven Marquardt wrote:>
> > I wonder if there is an option to disable the internal webbrowser of>
> > the netbeansplatform. >
>
> Tools > General > Web Browser > "<Default System Browser>">
>
> should do what you want.>
>
> Lutz>
>
> --------------------------------------------------------------------->
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:>
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [RPC] Disable internal Webbrowser

Posted by Sven Marquardt <sv...@cbb.de>.
I'm talking about netbeans platform. Not the IDE. If i packag my
netbeans platform application i dont want the internal browser get
packaged with my application. My use case is this i have an about dialog
with an html reference to the homepage of the aplication. But when i
click the link in the about dialog, netbeans trys to open it with the
internal webbrowser. Is there any setting where i can force netbeans to
open it with the external browser?

On 2018/10/22 12:25:43, "Lutz Horn" <l....@posteo.de> wrote:
> On Mon, Oct 22, 2018 at 01:53:26PM +0200, Sven Marquardt wrote:>
> > I wonder if there is an option to disable the internal webbrowser of>
> > the netbeansplatform. >
>
> Tools > General > Web Browser > "<Default System Browser>">
>
> should do what you want.>
>
> Lutz>
>
> --------------------------------------------------------------------->
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:>
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [RPC] Disable internal Webbrowser

Posted by Lutz Horn <lu...@posteo.de>.
On Mon, Oct 22, 2018 at 01:53:26PM +0200, Sven Marquardt wrote:
> I wonder if there is an option to disable the internal webbrowser of
> the netbeansplatform. 

Tools > General > Web Browser > "<Default System Browser>"

should do what you want.

Lutz

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [RPC] Disable internal Webbrowser

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 22 Oct 2018 at 12:53, Sven Marquardt <sv...@cbb.de> wrote:
>
> I wonder if there is an option to disable the internal webbrowser of the
> netbeansplatform. Right now everytime i or a user of the application
> clicked on a link, the inernal browser will open. Is there a way to
> disable this?

You might want to look at implementing and registering your own
HTMLBrowser.Factory implementation.  Or if you're in control of the
links, using HtmlBrowser.URLDisplayer.getDefault().showURLExternal(coreDocs);

See http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/HtmlBrowser.html

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists