You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by bart <ba...@sqmail.me> on 2021/12/02 21:28:05 UTC

Embedded browser and browser DOM for JavaEE Apps

Hi list,

I am writing a plugin for Netbeans. The book "Pro Apache Netbeans" is 
very good and really shows the power of the platform 🙂

What I would like to do is to get the embedded browser (and Browser DOM) 
enabled for a Java WebApplication.
I use an embedded server in a Maven based project. Similar to e.g. 
embedded tomcat.

Normally it is only enabled when selecting package "war" in the POM and 
using an external server like Glassfish or Payara. Trying to trigger the 
browser to load the URL of the started server in an action doesn't work 
since the API is not public:

WebBrowser wb = BrowserUISupport.getDefaultBrowserChoice(true);
BrowserSupport.create(wb);

Is there an easy way to start the embedded browser and point it to a 
running server? (while making the connection to Netbeans to enable the 
browser DOM and connecting the treeview to the UI in the browser).

This is show in this video for 'war' based Apps and Glassfish: 
https://www.youtube.com/watch?v=5aTFiNxzXF4 (starting at 4:00)

Thanks for any pointers.

Best regards, Bart

Re: Embedded browser and browser DOM for JavaEE Apps

Posted by Eric Bresie <eb...@gmail.com>.
Assume a “server instances” is setup and configured for use during running
with the developed web app deployed to it right?

Does anything here help? (
https://netbeans.apache.org/kb/docs/webclient/html5-gettingstarted.html#_using_the_embedded_webkit_browser
)

Or maybe something with the “google search” plugin tutorial (
https://netbeans.apache.org/tutorials/74/nbm-google.html
) project which opens a browser of help?

Or another example here (
https://www.djamware.com/post/6175330c7490756a5313be2b/how-to-create-a-web-browser-in-java-using-netbeans
)?

Eric


On Thu, Dec 30, 2021 at 1:30 PM Geertjan Wielenga
<ge...@googlemail.com.invalid> wrote:

> Apparently not.
>
> Best is always to put sample code on GitHub, explain in the README what's
> working and what's not and then post that here so people have something to
> work with.
>
> Gj
>
> On Thu, Dec 30, 2021 at 8:19 PM bart <ba...@sqmail.me> wrote:
>
> > Is there nobody on this list who knows this? And would like to help me?
> >
> > Thanks, Bart
> >
> > ------ Original Message ------
> > From: "bart" <ba...@sqmail.me>
> > To: dev@netbeans.apache.org
> > Sent: 02/12/2021 22:28:05
> > Subject: Embedded browser and browser DOM for JavaEE Apps
> >
> > >Hi list,
> > >
> > >I am writing a plugin for Netbeans. The book "Pro Apache Netbeans" is
> > >very good and really shows the power of the platform 🙂
> > >
> > >What I would like to do is to get the embedded browser (and Browser
> > >DOM) enabled for a Java WebApplication.
> > >I use an embedded server in a Maven based project. Similar to e.g.
> > >embedded tomcat.
> > >
> > >Normally it is only enabled when selecting package "war" in the POM and
> > >using an external server like Glassfish or Payara. Trying to trigger
> > >the browser to load the URL of the started server in an action doesn't
> > >work since the API is not public:
> > >
> > >WebBrowser wb = BrowserUISupport.getDefaultBrowserChoice(true);
> > >BrowserSupport.create(wb);
> > >
> > >Is there an easy way to start the embedded browser and point it to a
> > >running server? (while making the connection to Netbeans to enable the
> > >browser DOM and connecting the treeview to the UI in the browser).
> > >
> > >This is show in this video for 'war' based Apps and Glassfish:
> > >https://www.youtube.com/watch?v=5aTFiNxzXF4 (starting at 4:00)
> > >
> > >Thanks for any pointers.
> > >
> > >Best regards, Bart
>
-- 
Eric Bresie
ebresie@gmail.com

Re: Embedded browser and browser DOM for JavaEE Apps

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Apparently not.

Best is always to put sample code on GitHub, explain in the README what's
working and what's not and then post that here so people have something to
work with.

Gj

On Thu, Dec 30, 2021 at 8:19 PM bart <ba...@sqmail.me> wrote:

> Is there nobody on this list who knows this? And would like to help me?
>
> Thanks, Bart
>
> ------ Original Message ------
> From: "bart" <ba...@sqmail.me>
> To: dev@netbeans.apache.org
> Sent: 02/12/2021 22:28:05
> Subject: Embedded browser and browser DOM for JavaEE Apps
>
> >Hi list,
> >
> >I am writing a plugin for Netbeans. The book "Pro Apache Netbeans" is
> >very good and really shows the power of the platform 🙂
> >
> >What I would like to do is to get the embedded browser (and Browser
> >DOM) enabled for a Java WebApplication.
> >I use an embedded server in a Maven based project. Similar to e.g.
> >embedded tomcat.
> >
> >Normally it is only enabled when selecting package "war" in the POM and
> >using an external server like Glassfish or Payara. Trying to trigger
> >the browser to load the URL of the started server in an action doesn't
> >work since the API is not public:
> >
> >WebBrowser wb = BrowserUISupport.getDefaultBrowserChoice(true);
> >BrowserSupport.create(wb);
> >
> >Is there an easy way to start the embedded browser and point it to a
> >running server? (while making the connection to Netbeans to enable the
> >browser DOM and connecting the treeview to the UI in the browser).
> >
> >This is show in this video for 'war' based Apps and Glassfish:
> >https://www.youtube.com/watch?v=5aTFiNxzXF4 (starting at 4:00)
> >
> >Thanks for any pointers.
> >
> >Best regards, Bart

Re: Embedded browser and browser DOM for JavaEE Apps

Posted by bart <ba...@sqmail.me>.
Is there nobody on this list who knows this? And would like to help me?

Thanks, Bart

------ Original Message ------
From: "bart" <ba...@sqmail.me>
To: dev@netbeans.apache.org
Sent: 02/12/2021 22:28:05
Subject: Embedded browser and browser DOM for JavaEE Apps

>Hi list,
>
>I am writing a plugin for Netbeans. The book "Pro Apache Netbeans" is 
>very good and really shows the power of the platform 🙂
>
>What I would like to do is to get the embedded browser (and Browser 
>DOM) enabled for a Java WebApplication.
>I use an embedded server in a Maven based project. Similar to e.g. 
>embedded tomcat.
>
>Normally it is only enabled when selecting package "war" in the POM and 
>using an external server like Glassfish or Payara. Trying to trigger 
>the browser to load the URL of the started server in an action doesn't 
>work since the API is not public:
>
>WebBrowser wb = BrowserUISupport.getDefaultBrowserChoice(true);
>BrowserSupport.create(wb);
>
>Is there an easy way to start the embedded browser and point it to a 
>running server? (while making the connection to Netbeans to enable the 
>browser DOM and connecting the treeview to the UI in the browser).
>
>This is show in this video for 'war' based Apps and Glassfish: 
>https://www.youtube.com/watch?v=5aTFiNxzXF4 (starting at 4:00)
>
>Thanks for any pointers.
>
>Best regards, Bart