You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Jaroslav Tulach <ja...@gmail.com> on 2017/11/29 07:15:29 UTC

(Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Hi HTML fans.
As a progenitor of the library that allows smooth integration of HTML
components into NetBeans, I'd like to suggest to avoid references to JavaFX
webview in NetBeans module code and rather replace them with "one level of
indirection" . For example one can build proper NetBeans dialog with
@HtmlDialog annotation:
http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbeans/api/htmlui/HTMLDialog.html
- The code shall be fairly trivial with a starting HTML page:

<html>
    <head>
        <title>Base question</title>
        <meta charset="UTF-8">
    </head>
    <body>
        <div>Hello World! How are you?</div>
        <-- you need to check the checkbox to enabled the OK button -->
        <input type="checkbox" data-bind="checked: ok">OK?<br>
        <-- enabled with checkbox is checked -->
        <button id='ok' hidden data-bind="enable: ok">Good</button>
        <button id='bad' hidden>Bad</button>
    </body>
</html>

and a bit of Java glue code using the @HTMLDialog annotation to generate ...

@HTMLDialog(url = "dialog.html")
static void showHelloWorld() {
   // do some initialization if needed
 }

... the necessary entry point and then just showing the dialog when needed:

Pages.showHelloWorld();

As you can see the code doesn't reference to JavaFX at all. I believe it is
essential as it allows us to replace the current JavaFX based WebView
implementation with more lightweight one (that doesn't carry whole JavaFX
with it) in the future.

I understand there may currently be some limitations, but I believe that by
small improvements (like
https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
and make NetBeans Platform the perfect place for using HTML components and
mixing their JavaScript libraries with surrounding Java.

I would like to see more HTML components in NetBeans. Your help is
appreciated.
-jt



2017-11-26 19:06 GMT+01:00 Christian Lenz <ch...@gmx.net>:

> I don’t know it exactly, but as you can see it here:
> https://github.com/Chris2011/NbScratchFile/blob/develop/
> src/main/resources/org/chrisle/netbeans/plugins/
> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
> Comes with my plugin afaik.
>
>
> Von: Neil C Smith
> Gesendet: Sonntag, 26. November 2017 19:01
> An: dev@netbeans.incubator.apache.org
> Betreff: Re: JDK & JavaFX versions
>
> Hi,
>
> On Sun, Nov 26, 2017 at 8:10 AM Antonio <an...@vieiro.net> wrote:
>
> > This includes most Debian users (OpenJFX is packaged separately from the
> > OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
> > installed by default with OpenJDK).
> >
>
> Answering in reverse, no OpenJFX isn't installed, or even recommended or
> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
> OpenJDK so I wouldn't expect differently ...
>
> Of course I'd love to use WebViews in NetBeans. But if we build the
> > landing page as a WebView then those users that have no JavaFX installed
> > won't be able to see it.
> >
>
> I would really like us not to have a hard dependency on JavaFX, at least
> for the foreseeable future.  Lots of places it's not guaranteed to be
> available.
>
> However, I can see the merits for the start page.  I may be wrong, but
> would not the start page be a good showcase for html4j?  Embed the JavaFX
> Webview if available, load in an external browser if not?  Could be
> automatic, or probably a banner image fallback with click to launch?
>
>
> > El 26/11/17 a las 08:18, Emilian Bold escribió:
> > > JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
> > so I'm not certain it's good to rely on right now. "Pretty soon" though
> > OracleJDK will merge into OpenJDK so I assume this means most JavaFX bits
> > will land in OpenJDK proper?
> >
>
> It would surprise me if that changed the situation at all - anything
> concrete to back that up?
>
> Best wishes,
>
> Neil
>
> --
> Neil C Smith
> Artist & Technologist
> www.neilcsmith.net
>
> Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>
>

AW: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by to...@eppleton.de.
For dialogs that might be true, but if you create TopComponents it's great to have the full HTML/CSS/JS available so you can create and even reuse the countless JS libraries for Maps, Graphics, Charts, Graphs, etc.. Right now there are free Java APIs for Canvas, Charts, SVG, Maps, and you can easily add the JS libraries directly if you don't need a Java API. Limiting yourself to a subset of HTML mapping to a subset of swing takes away many benefits of HTML/Java. 

--toni

-----Ursprüngliche Nachricht-----
Von: Emilian Bold [mailto:emilian.bold@protonmail.ch] 
Gesendet: Mittwoch, 29. November 2017 09:51
An: dev@netbeans.incubator.apache.org
Betreff: Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

>>So, we are just adding another dependency / layer in order to 
>>accomplish  the same thing.
>>
>No, it is not the same thing. By adding yet another layer, we isolate 
>the  code from the actual JavaFX webview internals and thus make it portable.
> That isn't the same thing!

I understand, I was just assuming that no other implementation exists.

>> What I don't understand is why doesn't HTML4J map to Swing? That 
>>little example would map nicely to a JLabel with a JCheckbox and two 
>>JButtons and  we would get bindings for free (note how we are removing 
>>Matisse bindings  in the next NetBeans version because the beansbinding library is GPL).
>>
>The problem with Swing is that it is not portable. Try to run your 
>Swing  app on your mobile phone or in a browser!

NetBeans Platform doesn't run on my mobile phone or browser either, it's fine.

>>So, at Platform level I see no reason to add a HTML / JavaFX layer 
>>when we  should have more of a HTML / Swing layer if we really want to 
>>encourage /  join Javascript developers.
>>
>What do you mean by HTML/Swing layer? There is no such thing as far as 
>I  know, are you talking about some yet to be written library?

Yes. Why have a web view when all these UIs are basic? You could (dynamically) generate a Swing JPanel and help a lot. Of course, the layout is problematic as you can't reinvent a web view, but if you stick to a 'standard' 12 column grid system and just support that it would be great.

So, if I get a Swing JPanel by default which I can stick into the NetBeans Platform and I can also recompile to something that loads into a browser, that would be quite something.

--emi


> -jt
>>-------- Original Message --------
>> Subject: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions  
>>Local Time: November 29, 2017 9:15 AM  UTC Time: November 29, 2017 
>>7:15 AM
>> From: jaroslav.tulach@gmail.com
>> To: dev@netbeans.incubator.apache.org Hi HTML fans.
>> As a progenitor of the library that allows smooth integration of HTML  
>>components into NetBeans, I'd like to suggest to avoid references to  
>>JavaFX  webview in NetBeans module code and rather replace them with 
>>"one level of  indirection" . For example one can build proper 
>>NetBeans dialog with  @HtmlDialog annotation:
>>http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-
>> htmlui/org/netbeans/api/htmlui/HTMLDialog.html
>> - The code shall be fairly trivial with a starting HTML page:
>>
>> 
>> Base question >>  >>
>> 
>> 
Hello World! How are you?
>> <-- you need to check the checkbox to enabled the OK button --> OK?
 >> <-- enabled with checkbox is checked -->
>> Good >> Bad >>
>> 
>>and a bit of Java glue code using the @HTMLDialog annotation to 
>>generate  ...
>>@HTMLDialog(url = "dialog.html")
>> static void showHelloWorld() {
>> // do some initialization if needed
>> }
>>... the necessary entry point and then just showing the dialog when
>> needed:
>>Pages.showHelloWorld();
>>As you can see the code doesn't reference to JavaFX at all. I believe 
>>it  is  essential as it allows us to replace the current JavaFX based 
>>WebView  implementation with more lightweight one (that doesn't carry 
>>whole JavaFX  with it) in the future.
>>I understand there may currently be some limitations, but I believe 
>>that  by  small improvements (like
>>https://github.com/apache/incubator-netbeans/pull/301) we can overcome 
>>them  and make NetBeans Platform the perfect place for using HTML 
>>components and  mixing their JavaScript libraries with surrounding Java.
>>I would like to see more HTML components in NetBeans. Your help is  
>>appreciated.
>> -jt
>>2017-11-26 19:06 GMT+01:00 Christian Lenz christian.lenz@gmx.net:
>>>I don’t know it exactly, but as you can see it here:
>>>https://github.com/Chris2011/NbScratchFile/blob/develop/
>>> src/main/resources/org/chrisle/netbeans/plugins/
>>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into 
>>>a  JDialog, to create the UI with HTML5. But I can’t remember, that I 
>>>had to  install JavaFX seperately. Maybe I’m wrong but it is a 
>>>dependency, which  Comes with my plugin afaik.
>>> Von: Neil C Smith
>>> Gesendet: Sonntag, 26. November 2017 19:01
>>> An: dev@netbeans.incubator.apache.org
>>> Betreff: Re: JDK & JavaFX versions
>>> Hi,
>>> On Sun, Nov 26, 2017 at 8:10 AM Antonio antonio@vieiro.net wrote:
>>>>This includes most Debian users (OpenJFX is packaged separately from 
>>>>the  OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX 
>>>>is  installed by default with OpenJDK).
>>>> Answering in reverse, no OpenJFX isn't installed, or even 
>>>>recommended or  suggested, when installing OpenJDK on Ubuntu 
>>>>(16.04).  It's not part of  OpenJDK so I wouldn't expect differently ...
>>>> Of course I'd love to use WebViews in NetBeans. But if we build the  
>>>>landing page as a WebView then those users that have no JavaFX 
>>>>installed  won't be able to see it.
>>>> I would really like us not to have a hard dependency on JavaFX, at 
>>>>least  for the foreseeable future.  Lots of places it's not 
>>>>guaranteed to be  available.
>>>> However, I can see the merits for the start page.  I may be wrong, 
>>>>but  would not the start page be a good showcase for html4j?  Embed 
>>>>the JavaFX  Webview if available, load in an external browser if 
>>>>not?  Could be  automatic, or probably a banner image fallback with click to launch?
>>>> El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>>>JavaFX doesn't exist on some platforms like the Raspberry PI ARM 
>>>>>builds  so I'm not certain it's good to rely on right now. "Pretty 
>>>>>soon" though  OracleJDK will merge into OpenJDK so I assume this 
>>>>>means most JavaFX  bits
>>>>>>>>will land in OpenJDK proper?
>>>>> It would surprise me if that changed the situation at all - 
>>>>>anything  concrete to back that up?
>>>>> Best wishes,
>>>>> Neil
>>>>> --
>>>>> Neil C Smith
>>>>> Artist & Technologist
>>>>>www.neilcsmith.net
>>>>> Praxis LIVE - hybrid visual IDE for creative coding - 
>>>>>www.praxislive.org
>>>>>



Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Emilian Bold <em...@protonmail.ch>.
>>So, we are just adding another dependency / layer in order to accomplish
>> the same thing.
>>
>No, it is not the same thing. By adding yet another layer, we isolate the
> code from the actual JavaFX webview internals and thus make it portable.
> That isn't the same thing!

I understand, I was just assuming that no other implementation exists.

>> What I don't understand is why doesn't HTML4J map to Swing? That little
>>example would map nicely to a JLabel with a JCheckbox and two JButtons and
>> we would get bindings for free (note how we are removing Matisse bindings
>> in the next NetBeans version because the beansbinding library is GPL).
>>
>The problem with Swing is that it is not portable. Try to run your Swing
> app on your mobile phone or in a browser!

NetBeans Platform doesn't run on my mobile phone or browser either, it's fine.

>>So, at Platform level I see no reason to add a HTML / JavaFX layer when we
>> should have more of a HTML / Swing layer if we really want to encourage /
>> join Javascript developers.
>>
>What do you mean by HTML/Swing layer? There is no such thing as far as I
> know, are you talking about some yet to be written library?

Yes. Why have a web view when all these UIs are basic? You could (dynamically) generate a Swing JPanel and help a lot. Of course, the layout is problematic as you can't reinvent a web view, but if you stick to a 'standard' 12 column grid system and just support that it would be great.

So, if I get a Swing JPanel by default which I can stick into the NetBeans Platform and I can also recompile to something that loads into a browser, that would be quite something.

--emi


> -jt
>>-------- Original Message --------
>> Subject: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions
>> Local Time: November 29, 2017 9:15 AM
>> UTC Time: November 29, 2017 7:15 AM
>> From: jaroslav.tulach@gmail.com
>> To: dev@netbeans.incubator.apache.org
>>Hi HTML fans.
>> As a progenitor of the library that allows smooth integration of HTML
>> components into NetBeans, I'd like to suggest to avoid references to
>> JavaFX
>> webview in NetBeans module code and rather replace them with "one level of
>> indirection" . For example one can build proper NetBeans dialog with
>> @HtmlDialog annotation:
>>http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-
>> htmlui/org/netbeans/api/htmlui/HTMLDialog.html
>> - The code shall be fairly trivial with a starting HTML page:
>>
>> 
>> Base question >>  >> 
>> 
>> 
Hello World! How are you?
>> <-- you need to check the checkbox to enabled the OK button -->
>>OK?
 >> <-- enabled with checkbox is checked -->
>> Good >> Bad >> 
>> 
>>and a bit of Java glue code using the @HTMLDialog annotation to generate
>> ...
>>@HTMLDialog(url = "dialog.html")
>> static void showHelloWorld() {
>> // do some initialization if needed
>> }
>>... the necessary entry point and then just showing the dialog when
>> needed:
>>Pages.showHelloWorld();
>>As you can see the code doesn't reference to JavaFX at all. I believe it
>> is
>> essential as it allows us to replace the current JavaFX based WebView
>> implementation with more lightweight one (that doesn't carry whole JavaFX
>> with it) in the future.
>>I understand there may currently be some limitations, but I believe that
>> by
>> small improvements (like
>>https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
>> and make NetBeans Platform the perfect place for using HTML components and
>> mixing their JavaScript libraries with surrounding Java.
>>I would like to see more HTML components in NetBeans. Your help is
>> appreciated.
>> -jt
>>2017-11-26 19:06 GMT+01:00 Christian Lenz christian.lenz@gmx.net:
>>>I don’t know it exactly, but as you can see it here:
>>>https://github.com/Chris2011/NbScratchFile/blob/develop/
>>> src/main/resources/org/chrisle/netbeans/plugins/
>>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
>>> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
>>> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
>>> Comes with my plugin afaik.
>>> Von: Neil C Smith
>>> Gesendet: Sonntag, 26. November 2017 19:01
>>> An: dev@netbeans.incubator.apache.org
>>> Betreff: Re: JDK & JavaFX versions
>>> Hi,
>>> On Sun, Nov 26, 2017 at 8:10 AM Antonio antonio@vieiro.net wrote:
>>>>This includes most Debian users (OpenJFX is packaged separately from the
>>>> OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
>>>> installed by default with OpenJDK).
>>>> Answering in reverse, no OpenJFX isn't installed, or even recommended or
>>>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
>>>> OpenJDK so I wouldn't expect differently ...
>>>> Of course I'd love to use WebViews in NetBeans. But if we build the
>>>> landing page as a WebView then those users that have no JavaFX installed
>>>> won't be able to see it.
>>>> I would really like us not to have a hard dependency on JavaFX, at least
>>>> for the foreseeable future.  Lots of places it's not guaranteed to be
>>>> available.
>>>> However, I can see the merits for the start page.  I may be wrong, but
>>>> would not the start page be a good showcase for html4j?  Embed the JavaFX
>>>> Webview if available, load in an external browser if not?  Could be
>>>> automatic, or probably a banner image fallback with click to launch?
>>>> El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>>>JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
>>>>> so I'm not certain it's good to rely on right now. "Pretty soon" though
>>>>> OracleJDK will merge into OpenJDK so I assume this means most JavaFX
>>>>> bits
>>>>>>>>will land in OpenJDK proper?
>>>>> It would surprise me if that changed the situation at all - anything
>>>>> concrete to back that up?
>>>>> Best wishes,
>>>>> Neil
>>>>> --
>>>>> Neil C Smith
>>>>> Artist & Technologist
>>>>>www.neilcsmith.net
>>>>> Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>>>>>


Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Jaroslav Tulach <ja...@gmail.com>.
2017-11-29 8:46 GMT+01:00 Emilian Bold <em...@protonmail.ch>:

> But right now there exists no lightweight WebView except the JavaFX one,
> no?
>

There certainly are other webviews available: GtkWebView, JxBrowser, CEF.


> So, we are just adding another dependency / layer in order to accomplish
> the same thing.
>

No, it is not the same thing. By adding yet another layer, we isolate the
code from the actual JavaFX webview internals and thus make it portable.
That isn't the same thing!

What I don't understand is why doesn't HTML4J map to Swing? That little
> example would map nicely to a JLabel with a JCheckbox and two JButtons and
> we would get bindings for free (note how we are removing Matisse bindings
> in the next NetBeans version because the beansbinding library is GPL).
>

The problem with Swing is that it is not portable. Try to run your Swing
app on your mobile phone or in a browser!


> So, at Platform level I see no reason to add a HTML / JavaFX layer when we
> should have more of a HTML / Swing layer if we really want to encourage /
> join Javascript developers.
>

What do you mean by HTML/Swing layer? There is no such thing as far as I
know, are you talking about some yet to be written library?
-jt

 >-------- Original Message --------
>Subject: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions
>Local Time: November 29, 2017 9:15 AM
>UTC Time: November 29, 2017 7:15 AM
>From: jaroslav.tulach@gmail.com
>To: dev@netbeans.incubator.apache.org
>
>Hi HTML fans.
> As a progenitor of the library that allows smooth integration of HTML
> components into NetBeans, I'd like to suggest to avoid references to
JavaFX
> webview in NetBeans module code and rather replace them with "one level of
> indirection" . For example one can build proper NetBeans dialog with
> @HtmlDialog annotation:
>http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-
htmlui/org/netbeans/api/htmlui/HTMLDialog.html
> - The code shall be fairly trivial with a starting HTML page:
>
> <html>
> <head>
> <title>Base question</title>
> <meta charset="UTF-8">
> </head>
> <body>
> <div>Hello World! How are you?</div>
> <-- you need to check the checkbox to enabled the OK button -->
> <input type="checkbox" data-bind="checked: ok">OK?<br>
> <-- enabled with checkbox is checked -->
> <button id='ok' hidden data-bind="enable: ok">Good</button>
> <button id='bad' hidden>Bad</button>
> </body>
> </html>
>
> and a bit of Java glue code using the @HTMLDialog annotation to generate
...
>
> @HTMLDialog(url = "dialog.html")
> static void showHelloWorld() {
> // do some initialization if needed
> }
>
> ... the necessary entry point and then just showing the dialog when
needed:
>
> Pages.showHelloWorld();
>
> As you can see the code doesn't reference to JavaFX at all. I believe it
is
> essential as it allows us to replace the current JavaFX based WebView
> implementation with more lightweight one (that doesn't carry whole JavaFX
> with it) in the future.
>
> I understand there may currently be some limitations, but I believe that
by
> small improvements (like
>https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
> and make NetBeans Platform the perfect place for using HTML components and
> mixing their JavaScript libraries with surrounding Java.
>
> I would like to see more HTML components in NetBeans. Your help is
> appreciated.
> -jt
>
>
>
> 2017-11-26 19:06 GMT+01:00 Christian Lenz christian.lenz@gmx.net:
>>I don’t know it exactly, but as you can see it here:
>>https://github.com/Chris2011/NbScratchFile/blob/develop/
>> src/main/resources/org/chrisle/netbeans/plugins/
>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
>> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
>> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
>> Comes with my plugin afaik.
>>Von: Neil C Smith
>> Gesendet: Sonntag, 26. November 2017 19:01
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: JDK & JavaFX versions
>>Hi,
>>On Sun, Nov 26, 2017 at 8:10 AM Antonio antonio@vieiro.net wrote:
>>>This includes most Debian users (OpenJFX is packaged separately from the
>>> OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
>>> installed by default with OpenJDK).
>>>Answering in reverse, no OpenJFX isn't installed, or even recommended or
>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
>> OpenJDK so I wouldn't expect differently ...
>>Of course I'd love to use WebViews in NetBeans. But if we build the
>>>landing page as a WebView then those users that have no JavaFX installed
>>> won't be able to see it.
>>>I would really like us not to have a hard dependency on JavaFX, at least
>> for the foreseeable future.  Lots of places it's not guaranteed to be
>> available.
>>However, I can see the merits for the start page.  I may be wrong, but
>> would not the start page be a good showcase for html4j?  Embed the JavaFX
>> Webview if available, load in an external browser if not?  Could be
>> automatic, or probably a banner image fallback with click to launch?
>>>El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>>JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
>>>> so I'm not certain it's good to rely on right now. "Pretty soon" though
>>>> OracleJDK will merge into OpenJDK so I assume this means most JavaFX
bits
>>>> will land in OpenJDK proper?
>>>>It would surprise me if that changed the situation at all - anything
>> concrete to back that up?
>>Best wishes,
>>Neil
>>--
>> Neil C Smith
>> Artist & Technologist
>>www.neilcsmith.net
>>Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>>

Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Jaroslav Tulach <ja...@gmail.com>.
Hello Neil.

> This conversation came out of a question related to the Start Page -

I believe the start page is certainly a great candidate for being rendered
in HTML. Such approach will simplify a lot. I still remember the pain with
current welcome page (which tries to mimic HTML look without using HTML).
The only drawback is that usage of HTML requires good HTML renderer, which
adds some dependencies. Right now on JavaFX, possibly on something else in
the future.

> interested in your thoughts on implementing that with HTML4J?

If you go the HTML way, then, of course, to show the component you shall
use one of these annotations:
http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbeans/api/htmlui/package-summary.html

2017-11-29 12:04 GMT+01:00 Neil C Smith <ne...@apache.org>:

> Hi,
>
> On Wed, Nov 29, 2017 at 8:45 AM <to...@eppleton.de> wrote:
>
> > Two Platform-independent embeddable WebView components I'm aware of with
> > better quality than JavaFX WebView and don't require JavaFX:
> >
> > J-CEF: https://bitbucket.org/chromiumembedded/java-cef
> > JXBrowser (Commercial): https://www.teamdev.com/jxbrowser
> >
>
> Obviously anything we use would likely have to be Apache license compatible
> if not a "system" dependency like JavaFX.  So, J-CEF looks interesting -
> any idea of what sort of size we'd be looking at to include it as a
> library?
>

50-100MB is my estimate. Web browsers are huge, as such...

This conversation came out of a question related to the Start Page -
> interested in your thoughts on implementing that with HTML4J?  What
> actually would the fallback position be currently without JavaFX available?
>

... I would be OK sticking with JavaFX WebView (behind the scene) for now.
At the end Oracle Java contains it preinstalled. Linux distributions
provide OpenJFX - e.g. it is a system dependency. Just Solaris (JavaFX
hasn't been ported to it) is out of luck...
-jt

AW: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Christian Lenz <ch...@gmx.net>.
Hey Jaroslav,

thank you so much for your PR, I will really have a deeper look into it soon as you can see my comments and I didn’t Close it 😃. So the thing is, that I couldn’t find the solutions for my problems that I wrote earlier that’s why I changed it back and tried it by my own. I really like the approach but it wasn’t so comfortable for me and it still isn’t. For example, I said I want to write my JS where I need to and this should be in my UI, if this is not often possible, as I can see it in your PR, then I Need to Combine JS and Java and this is a mess in HTML4J because it is still a string and it can have a lot of errors, where you can’t find the solution because it is still a string.

Long time ago, I had to write GWT and I had to add some JSNI (http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html) methods to it. That works similar to it but first the Syntax Looks different:

public static native void alert(String msg) /*-{
  $wnd.alert(msg);
}-*/;

Unfortunately NetBeans can’t handle this out of the box, but I think it is more a GWT type, but I brought simple syntax highlighting to the GWT4NB plugin: https://github.com/ksfreitas/gwt4nb/pull/41 My implementation based on Geertjans tutorial: https://blogs.oracle.com/geertjan/embedding-javascript-editor-in-java-editor Unfortunately, it doesn’t work correctly, as you can see it in the comment of Geertjan, but it is good enough, to see JS Syntax highlighted in Java: https://github.com/ksfreitas/gwt4nb/issues/36#issuecomment-255379539 and if someone can fix the stuff, that I can write real JS with working code completion (it only works for custom Code templates) in this /*-{}-*/ syntax in Java files, that would be aaaaaawesome and I think that this will be a much better solution for it to use a similar way in HTML4J and this will definitely change my mind about it 😊 Today we have a lot of mixed languages, HTML in strings like in Angular, React, Vue (template property) or SQL inside strings, or regex etc. So yeah maybe this could be a better solution, I guess it will.


Regards

Chris

Von: Jaroslav Tulach
Gesendet: Donnerstag, 30. November 2017 07:05
An: dev@netbeans.incubator.apache.org
Betreff: Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Hello Christian,

2017-11-29 16:07 GMT+01:00 Christian Lenz <ch...@gmx.net>:

> As an real world example, which is working well and I found a good
> solution for me, myself and I, please look here:
> https://github.com/Chris2011/NbScratchFile/tree/develop


nice example of mixed UI development! I've polished it to avoid the JavaFX
WebView direct dependency:
https://github.com/Chris2011/NbScratchFile/pull/12 - we can discuss
possible improvements there.


> As you can see, I separated the Java application (My NetBeans module)
> completely from the HTML UI. This gave me the benefit, that I have a HTML5
> application, where I can use my own build System like Webpack, npm, Tasks,
> scss and the ability of the NetBeans IDE to handle this project as it is. I
> can run it, I can build it, I can debug it and and and. After I finished
> everything in the UI, I started the Java logic. So as you can see, I
> created a ViewModel to communicate with it in my UI, to call methods on it
> and to send stuff from the UI to the backend. No Need to add annotations or
> JS Code as strings in Java Code or JSNI (If possible) which is still weird
> for me as a FronEnd WebDeveloper.
>

Little bit of that is in my PR. However it actually has some benefits: for
example it is more secure. Rather than allowing calls to any Java method
from the view (your approach), I require the developer to explicitly
specify which methods shall be exposed. The evolution of Android
Java/JavaScript bridge shows such security concerns are quite important.


> As you can see I only wanted to minimze the amount of Java Code that I had
> to write. Only some methods to get the colors from NetBeans fields to set
> the Color to the UI fields to be dynamically, when someone changes their
> laf from light to darcula or metal or whatever and the logic that I needed
> for my plugin. No Need to have specific css files, just methods to call. It
> is not thaaaaat good but it is a good compromise and it works pretty well
> and some kind of fast.
>
> I started with DukeScript first, because I wanted to write HTML UIs but I
> had some problems. The biggest one was, that my WebApp, doesn’t work the
> same as expected in the Java NetBeans module context as in my browser and I
> couldn’t find out why.
>
> The other problem, what I can say is the generated shizzle code which
> happens in the back if you create a view model, because I decoupled the
> model, I tried it with the annotations and I created a new, separated class
> in a new file and the generation of the code breaks. I couldn’t find out
> why. Yeah sure needed more investigation, but I didn’t want it. My
> playground is HTML/JS(TS)/CSS(SCSS) and so on. The backend is a need,
> because to communicate with the APIs of NetBeans but this is ok.
>
> Look into the electron framework, it uses Node and Chrome as a wrapper and
> everything you need is HTML/JS/CSS. Of Course, it is not Java right, but
> you get access to the apis of node because it is JavaScript. Maybe
> offtopic, only to let you know this really nice project.
>

All I want is to avoid direct dependency on JavaFX WebView. I hope my PR
#12 shows it is possible. I happily leave the "frontend side" on an expert
like you, I don't follow the evolution of JS frameworks/build
tools/packages that closely - for example I didn't know about the
frontend-maven-plugin, nice to know it exists.


> The other biggest problem was, I cound’t find out, how I can debug my UI.
> In General it is working in the browser, yes but what happens if there are
> some Problems in the UI while running in the HMTL4J context? I used firebug
> lite but come on. The end is near for firebug and I got Problems with it
> too, often no real help, no Errors etc.. Each browser has their own nice
> tools (I love Chrome dev tools most, thats why I would like to see a better
> webkit webview, where you can use the Chrome dev tools). Firefox too, I
> know that some parts where adapted to Firefox from firebug, but firebug is
> dead and firebug lite is to old and dead too. I Googled for using Chrome
> dev tools for debugging the webview but it wasn’t that easy. I looked for
> alternative webview too and found J-CEF and JxBrowser too but I think you
> Need to pay for one of them for usage and the other one I didn’t have a
> deep look.
>

Yes, debugging is a pain. Firebug lite is the natural choice and btw. you
can enable it with a property (
http://bits.netbeans.org/html+java/1.5.1/index.html rev. 1.2.3,
-Dfirebug.lite=true, shall work in NetBeans as well, but I haven't tested
it today). Writing portable DukeScript code is another option (
https://dukescript.com/getting_started.html) - then one can choose from
different packagings and debug the code in most suitable environment. For
example when packaged for Android and executed in a simulator one can get
both Java debugger as well as Chrome tools. Also NetBeans has a great DOM
browser and CSS inspector that works well with JavaFX view - the trick is
to connect it - I only know how to do it following the DukeScript tutorial
- but the connector shall work with any properly configured JavaFX web view.


>
> Long story short and why I telling you this? Again, me as a FrontEnd
> WebDeveloper I would like to have HTML UIs which has to be as fast as swing
> components. I know that this is often not possible but performance is
> everything. It should feel like a real UI and this is what I achieved with
> my project. Unfortunately I will not choose HTML4J/DukeScript again, if
> there is no better cases for pure WebDevelopers like me.


This sentence doesn't make me feel well. Maybe I just wasted my time trying
to reach to you? If so, close the PR #12 and we can forget about this
encounter.


> Sure I can help you with this to tell you more real world cases, but see:
> I don’t want write as much Java as I can avoid.
>
> This Project is a good compromise between using NetBeans APIs, written in
> Java for interaction with my HTML UI. At the end, I build the UI via
> maven-frontend-plugin to add the build folder to the resources folder and I
> can call the HTML file from the Java.
>

I believe the NbScratchFile could be turned in a show case of the synergy
between modern JS frontend and NetBeans Platform, if both sides open their
minds a bit.
-jt


Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Jaroslav Tulach <ja...@gmail.com>.
Hello Christian,

2017-11-29 16:07 GMT+01:00 Christian Lenz <ch...@gmx.net>:

> As an real world example, which is working well and I found a good
> solution for me, myself and I, please look here:
> https://github.com/Chris2011/NbScratchFile/tree/develop


nice example of mixed UI development! I've polished it to avoid the JavaFX
WebView direct dependency:
https://github.com/Chris2011/NbScratchFile/pull/12 - we can discuss
possible improvements there.


> As you can see, I separated the Java application (My NetBeans module)
> completely from the HTML UI. This gave me the benefit, that I have a HTML5
> application, where I can use my own build System like Webpack, npm, Tasks,
> scss and the ability of the NetBeans IDE to handle this project as it is. I
> can run it, I can build it, I can debug it and and and. After I finished
> everything in the UI, I started the Java logic. So as you can see, I
> created a ViewModel to communicate with it in my UI, to call methods on it
> and to send stuff from the UI to the backend. No Need to add annotations or
> JS Code as strings in Java Code or JSNI (If possible) which is still weird
> for me as a FronEnd WebDeveloper.
>

Little bit of that is in my PR. However it actually has some benefits: for
example it is more secure. Rather than allowing calls to any Java method
from the view (your approach), I require the developer to explicitly
specify which methods shall be exposed. The evolution of Android
Java/JavaScript bridge shows such security concerns are quite important.


> As you can see I only wanted to minimze the amount of Java Code that I had
> to write. Only some methods to get the colors from NetBeans fields to set
> the Color to the UI fields to be dynamically, when someone changes their
> laf from light to darcula or metal or whatever and the logic that I needed
> for my plugin. No Need to have specific css files, just methods to call. It
> is not thaaaaat good but it is a good compromise and it works pretty well
> and some kind of fast.
>
> I started with DukeScript first, because I wanted to write HTML UIs but I
> had some problems. The biggest one was, that my WebApp, doesn’t work the
> same as expected in the Java NetBeans module context as in my browser and I
> couldn’t find out why.
>
> The other problem, what I can say is the generated shizzle code which
> happens in the back if you create a view model, because I decoupled the
> model, I tried it with the annotations and I created a new, separated class
> in a new file and the generation of the code breaks. I couldn’t find out
> why. Yeah sure needed more investigation, but I didn’t want it. My
> playground is HTML/JS(TS)/CSS(SCSS) and so on. The backend is a need,
> because to communicate with the APIs of NetBeans but this is ok.
>
> Look into the electron framework, it uses Node and Chrome as a wrapper and
> everything you need is HTML/JS/CSS. Of Course, it is not Java right, but
> you get access to the apis of node because it is JavaScript. Maybe
> offtopic, only to let you know this really nice project.
>

All I want is to avoid direct dependency on JavaFX WebView. I hope my PR
#12 shows it is possible. I happily leave the "frontend side" on an expert
like you, I don't follow the evolution of JS frameworks/build
tools/packages that closely - for example I didn't know about the
frontend-maven-plugin, nice to know it exists.


> The other biggest problem was, I cound’t find out, how I can debug my UI.
> In General it is working in the browser, yes but what happens if there are
> some Problems in the UI while running in the HMTL4J context? I used firebug
> lite but come on. The end is near for firebug and I got Problems with it
> too, often no real help, no Errors etc.. Each browser has their own nice
> tools (I love Chrome dev tools most, thats why I would like to see a better
> webkit webview, where you can use the Chrome dev tools). Firefox too, I
> know that some parts where adapted to Firefox from firebug, but firebug is
> dead and firebug lite is to old and dead too. I Googled for using Chrome
> dev tools for debugging the webview but it wasn’t that easy. I looked for
> alternative webview too and found J-CEF and JxBrowser too but I think you
> Need to pay for one of them for usage and the other one I didn’t have a
> deep look.
>

Yes, debugging is a pain. Firebug lite is the natural choice and btw. you
can enable it with a property (
http://bits.netbeans.org/html+java/1.5.1/index.html rev. 1.2.3,
-Dfirebug.lite=true, shall work in NetBeans as well, but I haven't tested
it today). Writing portable DukeScript code is another option (
https://dukescript.com/getting_started.html) - then one can choose from
different packagings and debug the code in most suitable environment. For
example when packaged for Android and executed in a simulator one can get
both Java debugger as well as Chrome tools. Also NetBeans has a great DOM
browser and CSS inspector that works well with JavaFX view - the trick is
to connect it - I only know how to do it following the DukeScript tutorial
- but the connector shall work with any properly configured JavaFX web view.


>
> Long story short and why I telling you this? Again, me as a FrontEnd
> WebDeveloper I would like to have HTML UIs which has to be as fast as swing
> components. I know that this is often not possible but performance is
> everything. It should feel like a real UI and this is what I achieved with
> my project. Unfortunately I will not choose HTML4J/DukeScript again, if
> there is no better cases for pure WebDevelopers like me.


This sentence doesn't make me feel well. Maybe I just wasted my time trying
to reach to you? If so, close the PR #12 and we can forget about this
encounter.


> Sure I can help you with this to tell you more real world cases, but see:
> I don’t want write as much Java as I can avoid.
>
> This Project is a good compromise between using NetBeans APIs, written in
> Java for interaction with my HTML UI. At the end, I build the UI via
> maven-frontend-plugin to add the build folder to the resources folder and I
> can call the HTML file from the Java.
>

I believe the NbScratchFile could be turned in a show case of the synergy
between modern JS frontend and NetBeans Platform, if both sides open their
minds a bit.
-jt

AW: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Christian Lenz <ch...@gmx.net>.
As an real world example, which is working well and I found a good solution for me, myself and I, please look here: https://github.com/Chris2011/NbScratchFile/tree/develop

As you can see, I separated the Java application (My NetBeans module) completely from the HTML UI. This gave me the benefit, that I have a HTML5 application, where I can use my own build System like Webpack, npm, Tasks, scss and the ability of the NetBeans IDE to handle this project as it is. I can run it, I can build it, I can debug it and and and. After I finished everything in the UI, I started the Java logic. So as you can see, I created a ViewModel to communicate with it in my UI, to call methods on it and to send stuff from the UI to the backend. No Need to add annotations or JS Code as strings in Java Code or JSNI (If possible) which is still weird for me as a FronEnd WebDeveloper.

As you can see I only wanted to minimze the amount of Java Code that I had to write. Only some methods to get the colors from NetBeans fields to set the Color to the UI fields to be dynamically, when someone changes their laf from light to darcula or metal or whatever and the logic that I needed for my plugin. No Need to have specific css files, just methods to call. It is not thaaaaat good but it is a good compromise and it works pretty well and some kind of fast.

I started with DukeScript first, because I wanted to write HTML UIs but I had some problems. The biggest one was, that my WebApp, doesn’t work the same as expected in the Java NetBeans module context as in my browser and I couldn’t find out why.

The other problem, what I can say is the generated shizzle code which happens in the back if you create a view model, because I decoupled the model, I tried it with the annotations and I created a new, separated class in a new file and the generation of the code breaks. I couldn’t find out why. Yeah sure needed more investigation, but I didn’t want it. My playground is HTML/JS(TS)/CSS(SCSS) and so on. The backend is a need, because to communicate with the APIs of NetBeans but this is ok.

Look into the electron framework, it uses Node and Chrome as a wrapper and everything you need is HTML/JS/CSS. Of Course, it is not Java right, but you get access to the apis of node because it is JavaScript. Maybe offtopic, only to let you know this really nice project.

The other biggest problem was, I cound’t find out, how I can debug my UI. In General it is working in the browser, yes but what happens if there are some Problems in the UI while running in the HMTL4J context? I used firebug lite but come on. The end is near for firebug and I got Problems with it too, often no real help, no Errors etc.. Each browser has their own nice tools (I love Chrome dev tools most, thats why I would like to see a better webkit webview, where you can use the Chrome dev tools). Firefox too, I know that some parts where adapted to Firefox from firebug, but firebug is dead and firebug lite is to old and dead too. I Googled for using Chrome dev tools for debugging the webview but it wasn’t that easy. I looked for alternative webview too and found J-CEF and JxBrowser too but I think you Need to pay for one of them for usage and the other one I didn’t have a deep look.

Long story short and why I telling you this? Again, me as a FrontEnd WebDeveloper I would like to have HTML UIs which has to be as fast as swing components. I know that this is often not possible but performance is everything. It should feel like a real UI and this is what I achieved with my project. Unfortunately I will not choose HTML4J/DukeScript again, if there is no better cases for pure WebDevelopers like me. Sure I can help you with this to tell you more real world cases, but see: I don’t want write as much Java as I can avoid.

This Project is a good compromise between using NetBeans APIs, written in Java for interaction with my HTML UI. At the end, I build the UI via maven-frontend-plugin to add the build folder to the resources folder and I can call the HTML file from the Java.


Cheers

Chris


Von: Anton Epple
Gesendet: Mittwoch, 29. November 2017 12:28
An: dev@netbeans.incubator.apache.org
Betreff: Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Hi Neil,

I haven’t integrated J-CEF yet, because for my (customers) usecase only JXBrowser was an option. We needed integration with JavaFX which J-CEF doesn’t offer. But J-CEF can be embedded in Swing, so it should work fine for NetBeans.

Sorry I haven’t followed the discussion about the startup screen. I agree the Startup Screen would be a good showcase for these APIs. J-CEF would be my preferred fallback for (or replacement of) JavaFX if it isn’t available on the target platform, since it’s already embeddable in Swing and should work on all platforms including linux. I had a look at the Java-JavaScript-Bridge some time ago and it seemed a bit clunky, but it should be possible to create a Presenter for it that could be used in the startup screen.

Regards

Toni

Am 29.11.17, 12:04 schrieb "Neil C Smith" <ne...@apache.org>:

    Hi,
    
    On Wed, Nov 29, 2017 at 8:45 AM <to...@eppleton.de> wrote:
    
    > Two Platform-independent embeddable WebView components I'm aware of with
    > better quality than JavaFX WebView and don't require JavaFX:
    >
    > J-CEF: https://bitbucket.org/chromiumembedded/java-cef
    > JXBrowser (Commercial): https://www.teamdev.com/jxbrowser
    >
    
    Obviously anything we use would likely have to be Apache license compatible
    if not a "system" dependency like JavaFX.  So, J-CEF looks interesting -
    any idea of what sort of size we'd be looking at to include it as a library?
    
    This conversation came out of a question related to the Start Page -
    interested in your thoughts on implementing that with HTML4J?  What
    actually would the fallback position be currently without JavaFX available?
    
    Best wishes,
    
    Neil
    -- 
    Neil C Smith
    Artist & Technologist
    www.neilcsmith.net
    
    Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
    




Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Anton Epple <to...@eppleton.de>.
Hi Neil,

I haven’t integrated J-CEF yet, because for my (customers) usecase only JXBrowser was an option. We needed integration with JavaFX which J-CEF doesn’t offer. But J-CEF can be embedded in Swing, so it should work fine for NetBeans.

Sorry I haven’t followed the discussion about the startup screen. I agree the Startup Screen would be a good showcase for these APIs. J-CEF would be my preferred fallback for (or replacement of) JavaFX if it isn’t available on the target platform, since it’s already embeddable in Swing and should work on all platforms including linux. I had a look at the Java-JavaScript-Bridge some time ago and it seemed a bit clunky, but it should be possible to create a Presenter for it that could be used in the startup screen.

Regards

Toni

Am 29.11.17, 12:04 schrieb "Neil C Smith" <ne...@apache.org>:

    Hi,
    
    On Wed, Nov 29, 2017 at 8:45 AM <to...@eppleton.de> wrote:
    
    > Two Platform-independent embeddable WebView components I'm aware of with
    > better quality than JavaFX WebView and don't require JavaFX:
    >
    > J-CEF: https://bitbucket.org/chromiumembedded/java-cef
    > JXBrowser (Commercial): https://www.teamdev.com/jxbrowser
    >
    
    Obviously anything we use would likely have to be Apache license compatible
    if not a "system" dependency like JavaFX.  So, J-CEF looks interesting -
    any idea of what sort of size we'd be looking at to include it as a library?
    
    This conversation came out of a question related to the Start Page -
    interested in your thoughts on implementing that with HTML4J?  What
    actually would the fallback position be currently without JavaFX available?
    
    Best wishes,
    
    Neil
    -- 
    Neil C Smith
    Artist & Technologist
    www.neilcsmith.net
    
    Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
    



Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Neil C Smith <ne...@apache.org>.
Hi,

On Wed, Nov 29, 2017 at 8:45 AM <to...@eppleton.de> wrote:

> Two Platform-independent embeddable WebView components I'm aware of with
> better quality than JavaFX WebView and don't require JavaFX:
>
> J-CEF: https://bitbucket.org/chromiumembedded/java-cef
> JXBrowser (Commercial): https://www.teamdev.com/jxbrowser
>

Obviously anything we use would likely have to be Apache license compatible
if not a "system" dependency like JavaFX.  So, J-CEF looks interesting -
any idea of what sort of size we'd be looking at to include it as a library?

This conversation came out of a question related to the Start Page -
interested in your thoughts on implementing that with HTML4J?  What
actually would the fallback position be currently without JavaFX available?

Best wishes,

Neil
-- 
Neil C Smith
Artist & Technologist
www.neilcsmith.net

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org

AW: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by to...@eppleton.de.
Two Platform-independent embeddable WebView components I'm aware of with better quality than JavaFX WebView and don't require JavaFX:

J-CEF: https://bitbucket.org/chromiumembedded/java-cef
JXBrowser (Commercial): https://www.teamdev.com/jxbrowser

Performance of both components is way superior, and would enable interesting features like WebGL and fix some annoying bugs like the ability to show a datepicker control. So I would love to see JavaFX WebView replaced as in addition JavaFX WebView update cycles are very slow. An abstraction that makes it easier to move in the future would be the first logical step.

There have been projects in the past that attempted to map HTML to Swing, but none of them was really successful due to the complexity of the task. Implementing a single layout or css styling is a complex task already, implementing full HTML-standard would be a really complex task and in the end produce an inferior result regarding performance.

The idea of HTML/Java is to use a renderer that is already there and available in multiple implementations on any platform instead of implementing your own.

I assume you mean implementing a subset of HTML. In that case you would disappoint every JS developers and others, since they'll have wrong expectations. I think the proposal makes perfect sense in order to future proof the API. 

Regards
--Toni 




-----Ursprüngliche Nachricht-----
Von: Emilian Bold [mailto:emilian.bold@protonmail.ch] 
Gesendet: Mittwoch, 29. November 2017 08:47
An: dev@netbeans.incubator.apache.org
Betreff: Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

But right now there exists no lightweight WebView except the JavaFX one, no?

So, we are just adding another dependency / layer in order to accomplish the same thing.

What I don't understand is why doesn't HTML4J map to Swing? That little example would map nicely to a JLabel with a JCheckbox and two JButtons and we would get bindings for free (note how we are removing Matisse bindings in the next NetBeans version because the beansbinding library is GPL).

So, at Platform level I see no reason to add a HTML / JavaFX layer when we should have more of a HTML / Swing layer if we really want to encourage / join Javascript developers.

--emi
​

>-------- Original Message --------
>Subject: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions Local 
>Time: November 29, 2017 9:15 AM UTC Time: November 29, 2017 7:15 AM
>From: jaroslav.tulach@gmail.com
>To: dev@netbeans.incubator.apache.org
>
>Hi HTML fans.
> As a progenitor of the library that allows smooth integration of HTML  
>components into NetBeans, I'd like to suggest to avoid references to 
>JavaFX  webview in NetBeans module code and rather replace them with 
>"one level of  indirection" . For example one can build proper NetBeans 
>dialog with  @HtmlDialog annotation:
>http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbea
>ns/api/htmlui/HTMLDialog.html
> - The code shall be fairly trivial with a starting HTML page:
>
> <html>
> <head>
> <title>Base question</title>
> <meta charset="UTF-8">
> </head>
> <body>
> <div>Hello World! How are you?</div>
> <-- you need to check the checkbox to enabled the OK button --> <input 
> type="checkbox" data-bind="checked: ok">OK?<br>
> <-- enabled with checkbox is checked --> <button id='ok' hidden 
> data-bind="enable: ok">Good</button> <button id='bad' 
> hidden>Bad</button> </body> </html>
>
> and a bit of Java glue code using the @HTMLDialog annotation to generate ...
>
> @HTMLDialog(url = "dialog.html")
> static void showHelloWorld() {
> // do some initialization if needed
> }
>
> ... the necessary entry point and then just showing the dialog when needed:
>
> Pages.showHelloWorld();
>
> As you can see the code doesn't reference to JavaFX at all. I believe 
> it is essential as it allows us to replace the current JavaFX based 
> WebView implementation with more lightweight one (that doesn't carry 
> whole JavaFX with it) in the future.
>
> I understand there may currently be some limitations, but I believe 
>that by  small improvements (like
>https://github.com/apache/incubator-netbeans/pull/301) we can overcome 
>them  and make NetBeans Platform the perfect place for using HTML 
>components and  mixing their JavaScript libraries with surrounding Java.
>
> I would like to see more HTML components in NetBeans. Your help is 
> appreciated.
> -jt
>
>
>
> 2017-11-26 19:06 GMT+01:00 Christian Lenz christian.lenz@gmx.net:
>>I don’t know it exactly, but as you can see it here:
>>https://github.com/Chris2011/NbScratchFile/blob/develop/
>> src/main/resources/org/chrisle/netbeans/plugins/
>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into 
>>a  JDialog, to create the UI with HTML5. But I can’t remember, that I 
>>had to  install JavaFX seperately. Maybe I’m wrong but it is a 
>>dependency, which  Comes with my plugin afaik.
>>Von: Neil C Smith
>> Gesendet: Sonntag, 26. November 2017 19:01
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: JDK & JavaFX versions
>>Hi,
>>On Sun, Nov 26, 2017 at 8:10 AM Antonio antonio@vieiro.net wrote:
>>>This includes most Debian users (OpenJFX is packaged separately from 
>>>the  OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX 
>>>is  installed by default with OpenJDK).
>>>Answering in reverse, no OpenJFX isn't installed, or even recommended 
>>>or
>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part 
>>of  OpenJDK so I wouldn't expect differently ...
>>Of course I'd love to use WebViews in NetBeans. But if we build the
>>>landing page as a WebView then those users that have no JavaFX 
>>>installed  won't be able to see it.
>>>I would really like us not to have a hard dependency on JavaFX, at 
>>>least
>> for the foreseeable future.  Lots of places it's not guaranteed to be  
>>available.
>>However, I can see the merits for the start page.  I may be wrong, but  
>>would not the start page be a good showcase for html4j?  Embed the 
>>JavaFX  Webview if available, load in an external browser if not?  
>>Could be  automatic, or probably a banner image fallback with click to launch?
>>>El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>>JavaFX doesn't exist on some platforms like the Raspberry PI ARM 
>>>>builds  so I'm not certain it's good to rely on right now. "Pretty 
>>>>soon" though  OracleJDK will merge into OpenJDK so I assume this 
>>>>means most JavaFX bits  will land in OpenJDK proper?
>>>>It would surprise me if that changed the situation at all - anything
>> concrete to back that up?
>>Best wishes,
>>Neil
>>--
>> Neil C Smith
>> Artist & Technologist
>>www.neilcsmith.net
>>Praxis LIVE - hybrid visual IDE for creative coding - 
>>www.praxislive.org
>>


Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions

Posted by Emilian Bold <em...@protonmail.ch>.
But right now there exists no lightweight WebView except the JavaFX one, no?

So, we are just adding another dependency / layer in order to accomplish the same thing.

What I don't understand is why doesn't HTML4J map to Swing? That little example would map nicely to a JLabel with a JCheckbox and two JButtons and we would get bindings for free (note how we are removing Matisse bindings in the next NetBeans version because the beansbinding library is GPL).

So, at Platform level I see no reason to add a HTML / JavaFX layer when we should have more of a HTML / Swing layer if we really want to encourage / join Javascript developers.

--emi
​

>-------- Original Message --------
>Subject: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions
>Local Time: November 29, 2017 9:15 AM
>UTC Time: November 29, 2017 7:15 AM
>From: jaroslav.tulach@gmail.com
>To: dev@netbeans.incubator.apache.org
>
>Hi HTML fans.
> As a progenitor of the library that allows smooth integration of HTML
> components into NetBeans, I'd like to suggest to avoid references to JavaFX
> webview in NetBeans module code and rather replace them with "one level of
> indirection" . For example one can build proper NetBeans dialog with
> @HtmlDialog annotation:
>http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbeans/api/htmlui/HTMLDialog.html
> - The code shall be fairly trivial with a starting HTML page:
>
> <html>
> <head>
> <title>Base question</title>
> <meta charset="UTF-8">
> </head>
> <body>
> <div>Hello World! How are you?</div>
> <-- you need to check the checkbox to enabled the OK button -->
> <input type="checkbox" data-bind="checked: ok">OK?<br>
> <-- enabled with checkbox is checked -->
> <button id='ok' hidden data-bind="enable: ok">Good</button>
> <button id='bad' hidden>Bad</button>
> </body>
> </html>
>
> and a bit of Java glue code using the @HTMLDialog annotation to generate ...
>
> @HTMLDialog(url = "dialog.html")
> static void showHelloWorld() {
> // do some initialization if needed
> }
>
> ... the necessary entry point and then just showing the dialog when needed:
>
> Pages.showHelloWorld();
>
> As you can see the code doesn't reference to JavaFX at all. I believe it is
> essential as it allows us to replace the current JavaFX based WebView
> implementation with more lightweight one (that doesn't carry whole JavaFX
> with it) in the future.
>
> I understand there may currently be some limitations, but I believe that by
> small improvements (like
>https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
> and make NetBeans Platform the perfect place for using HTML components and
> mixing their JavaScript libraries with surrounding Java.
>
> I would like to see more HTML components in NetBeans. Your help is
> appreciated.
> -jt
>
>
>
> 2017-11-26 19:06 GMT+01:00 Christian Lenz christian.lenz@gmx.net:
>>I don’t know it exactly, but as you can see it here:
>>https://github.com/Chris2011/NbScratchFile/blob/develop/
>> src/main/resources/org/chrisle/netbeans/plugins/
>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
>> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
>> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
>> Comes with my plugin afaik.
>>Von: Neil C Smith
>> Gesendet: Sonntag, 26. November 2017 19:01
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: JDK & JavaFX versions
>>Hi,
>>On Sun, Nov 26, 2017 at 8:10 AM Antonio antonio@vieiro.net wrote:
>>>This includes most Debian users (OpenJFX is packaged separately from the
>>> OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
>>> installed by default with OpenJDK).
>>>Answering in reverse, no OpenJFX isn't installed, or even recommended or
>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
>> OpenJDK so I wouldn't expect differently ...
>>Of course I'd love to use WebViews in NetBeans. But if we build the
>>>landing page as a WebView then those users that have no JavaFX installed
>>> won't be able to see it.
>>>I would really like us not to have a hard dependency on JavaFX, at least
>> for the foreseeable future.  Lots of places it's not guaranteed to be
>> available.
>>However, I can see the merits for the start page.  I may be wrong, but
>> would not the start page be a good showcase for html4j?  Embed the JavaFX
>> Webview if available, load in an external browser if not?  Could be
>> automatic, or probably a banner image fallback with click to launch?
>>>El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>>JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
>>>> so I'm not certain it's good to rely on right now. "Pretty soon" though
>>>> OracleJDK will merge into OpenJDK so I assume this means most JavaFX bits
>>>> will land in OpenJDK proper?
>>>>It would surprise me if that changed the situation at all - anything
>> concrete to back that up?
>>Best wishes,
>>Neil
>>--
>> Neil C Smith
>> Artist & Technologist
>>www.neilcsmith.net
>>Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>>

Re: Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions)

Posted by Neil C Smith <ne...@apache.org>.
On Sat, Dec 2, 2017 at 5:30 PM Matthias Bläsing <mb...@doppel-helix.eu>
wrote:

> So for the core I'd like to stay with Swing. It is old, but it works
> and gets the job done.
>

+1 ... x10 ;-)  For all the same reasons.

One toolkit at a time, as and until we end up going down the full
Electron-esque web UI, or building something like Eclipse's Orion (
https://orionhub.org)

Best wishes,

Neil
-- 
Neil C Smith
Artist & Technologist
www.neilcsmith.net

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org

Re: Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions)

Posted by Antonio <an...@vieiro.net>.

El 02/12/17 a las 18:30, Matthias Bläsing escribió:
> So for the core I'd like to stay with Swing. It is old, but it works
> and gets the job done.
> 

Definitely.

What I was meaning is that I'd like to see some NetBeans Swing 
components (with their BeanInfo's, etc.) that can mimic/and or be 
translated to/from Web components.

So the core would still be plain Swing, but could also be viewed in 
JavaFX web views if users decide to install that.

Cheers,
Antonio

Re: Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions)

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hey,

I don't get the whole discussion. For me NetBeans was the IDE, that did
not reinvent the wheel. That was eclipse, that decided to go down the
"we reinvent the GUI Toolkit" idea (SWT).

There are areas, that Swing does not cover and its good to be able to
use WebView/other extension components, but here are basic dialogs and
lists discussed. Last time I saw a "HTML4J" Dialog it mismatched the
font, the font looked ugly, it did not match the IDE LaF.

Remember: JavaFX is _not_ part of OpenJDK and at least the ubuntu build
lead to segfaults and lookup of netbeans for me.

As an alternative I did a glimpse at Chrome Embedded Framework. The
mimimal tar bar all for linux 64 is 150MB and I assume libcef.so holds
the library is nearly 600 MB! The binary is larger than the whole
expanded Oracle JDK 9.0.1. At that point I stopped looking.

So for the core I'd like to stay with Swing. It is old, but it works
and gets the job done.

Greetings

Matthias


Am Samstag, den 02.12.2017, 13:30 +0100 schrieb Antonio:
>  From "How do I use a web component?" at [1], this excerpt...
> 
> 	<link rel="import" href="../emoji-rain/emoji-rain.html">
> 	...
> 	<emoji-rain active></emoji-rain>
> 
> ... is easily translated to a Swing component.
> 
> Also a "Material Card" as in [2] is just a piece of XML code that
> refers 
> to different sub components (see [4] 'mdc-card__title', 
> 'mcd-card__supporting-text'). And again is easily translated to a
> Swing 
> component (a basis could be [3]).
> 
> Modern HTML GUIs don't just use <div>'s and things like that. Modern 
> HTML GUIs use web components, and NetBeans could define __a set of 
> components__ that work well both in Swing and in the web. Presenting 
> these in a JavaFX WebView or in a Swing TopComponent would then just
> be 
> an implementation detail.
> 
> Power that with a smooth integration with HTML and Java, by
> Jaroslav, 
> and add to that some NetBeans Lookup's, Node's and ExplorerManager's 
> (ported to the web) and you're all set to start building landing
> pages, 
> OutlineViews, ListViews, PropertySheets and even applications that
> work 
> exactly the same in the web and in Swing.
> 
> Cheers,
> Antonio
> 
> P.S.: Defining a set of web (Swing) components for NetBeans does not 
> imply building them. We could choose a nice set of already existing 
> ones, Apache License compatible (Material Web Components at [5]?),
> and 
> start building Swing counterparts for them.
> 
> 
> [1]
> How do I use a web component?
> https://www.webcomponents.org/introduction#how-do-i-use-a-web-compone
> nt-
> 
> [2]
> Material Card
> https://material.io/components/web/catalog/cards/
> 
> [3]
> A simple Swing JPanel "card"
> https://github.com/vieiro/nbp-demo/blob/master/netbeans-platform-demo
> /nbdemo-gui/src/org/nbdemo/gui/features/ModuleCardPanel.java
> 
> [4]
> Material Card definition
> 
> <div class="mdc-card">
>    <section class="mdc-card__primary">
>      <h1 class="mdc-card__title mdc-card__title--large">Title goes
> here</h1>
>      <h2 class="mdc-card__subtitle">Subtitle here</h2>
>    </section>
>    <section class="mdc-card__supporting-text">
>      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
> do 
> eiusmod
>      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
> minim
>      veniam, quis nostrud exercitation ullamco laboris nisi ut
> aliquip ex ea
>      commodo consequat.
>    </section>
>    <section class="mdc-card__actions">
>      <button class="mdc-button mdc-button--compact 
> mdc-card__action">Action 1</button>
>      <button class="mdc-button mdc-button--compact 
> mdc-card__action">Action 2</button>
>    </section>
> </div>
> 
> [5] Material Web Components (Apache license)
> https://material.io/components/web/
> 
> El 29/11/17 a las 08:15, Jaroslav Tulach escribió:
> > Hi HTML fans.
> > As a progenitor of the library that allows smooth integration of
> > HTML
> > components into NetBeans, I'd like to suggest to avoid references
> > to JavaFX
> > webview in NetBeans module code and rather replace them with "one
> > level of
> > indirection" . For example one can build proper NetBeans dialog
> > with
> > @HtmlDialog annotation:
> > http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/ne
> > tbeans/api/htmlui/HTMLDialog.html
> > - The code shall be fairly trivial with a starting HTML page:
> > 
> > <html>
> >      <head>
> >          <title>Base question</title>
> >          <meta charset="UTF-8">
> >      </head>
> >      <body>
> >          <div>Hello World! How are you?</div>
> >          <-- you need to check the checkbox to enabled the OK
> > button -->
> >          <input type="checkbox" data-bind="checked: ok">OK?<br>
> >          <-- enabled with checkbox is checked -->
> >          <button id='ok' hidden data-bind="enable:
> > ok">Good</button>
> >          <button id='bad' hidden>Bad</button>
> >      </body>
> > </html>
> > 
> > and a bit of Java glue code using the @HTMLDialog annotation to
> > generate ...
> > 
> > @HTMLDialog(url = "dialog.html")
> > static void showHelloWorld() {
> >     // do some initialization if needed
> >   }
> > 
> > ... the necessary entry point and then just showing the dialog when
> > needed:
> > 
> > Pages.showHelloWorld();
> > 
> > As you can see the code doesn't reference to JavaFX at all. I
> > believe it is
> > essential as it allows us to replace the current JavaFX based
> > WebView
> > implementation with more lightweight one (that doesn't carry whole
> > JavaFX
> > with it) in the future.
> > 
> > I understand there may currently be some limitations, but I believe
> > that by
> > small improvements (like
> > https://github.com/apache/incubator-netbeans/pull/301) we can
> > overcome them
> > and make NetBeans Platform the perfect place for using HTML
> > components and
> > mixing their JavaScript libraries with surrounding Java.
> > 
> > I would like to see more HTML components in NetBeans. Your help is
> > appreciated.
> > -jt
> > 
> > 
> > 
> > 2017-11-26 19:06 GMT+01:00 Christian Lenz <ch...@gmx.net>:
> > 
> > > I don’t know it exactly, but as you can see it here:
> > > https://github.com/Chris2011/NbScratchFile/blob/develop/
> > > src/main/resources/org/chrisle/netbeans/plugins/
> > > utils/WebViewDialog.java#L30 I use the javaFX webview to add it
> > > into a
> > > JDialog, to create the UI with HTML5. But I can’t remember, that
> > > I had to
> > > install JavaFX seperately. Maybe I’m wrong but it is a
> > > dependency, which
> > > Comes with my plugin afaik.
> > > 
> > > 
> > > Von: Neil C Smith
> > > Gesendet: Sonntag, 26. November 2017 19:01
> > > An: dev@netbeans.incubator.apache.org
> > > Betreff: Re: JDK & JavaFX versions
> > > 
> > > Hi,
> > > 
> > > On Sun, Nov 26, 2017 at 8:10 AM Antonio <an...@vieiro.net>
> > > wrote:
> > > 
> > > > This includes most Debian users (OpenJFX is packaged separately
> > > > from the
> > > > OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX
> > > > is
> > > > installed by default with OpenJDK).
> > > > 
> > > 
> > > Answering in reverse, no OpenJFX isn't installed, or even
> > > recommended or
> > > suggested, when installing OpenJDK on Ubuntu (16.04).  It's not
> > > part of
> > > OpenJDK so I wouldn't expect differently ...
> > > 
> > > Of course I'd love to use WebViews in NetBeans. But if we build
> > > the
> > > > landing page as a WebView then those users that have no JavaFX
> > > > installed
> > > > won't be able to see it.
> > > > 
> > > 
> > > I would really like us not to have a hard dependency on JavaFX,
> > > at least
> > > for the foreseeable future.  Lots of places it's not guaranteed
> > > to be
> > > available.
> > > 
> > > However, I can see the merits for the start page.  I may be
> > > wrong, but
> > > would not the start page be a good showcase for html4j?  Embed
> > > the JavaFX
> > > Webview if available, load in an external browser if not?  Could
> > > be
> > > automatic, or probably a banner image fallback with click to
> > > launch?
> > > 
> > > 
> > > > El 26/11/17 a las 08:18, Emilian Bold escribió:
> > > > > JavaFX doesn't exist on some platforms like the Raspberry PI
> > > > > ARM builds
> > > > 
> > > > so I'm not certain it's good to rely on right now. "Pretty
> > > > soon" though
> > > > OracleJDK will merge into OpenJDK so I assume this means most
> > > > JavaFX bits
> > > > will land in OpenJDK proper?
> > > > 
> > > 
> > > It would surprise me if that changed the situation at all -
> > > anything
> > > concrete to back that up?
> > > 
> > > Best wishes,
> > > 
> > > Neil
> > > 
> > > --
> > > Neil C Smith
> > > Artist & Technologist
> > > www.neilcsmith.net
> > > 
> > > Praxis LIVE - hybrid visual IDE for creative coding - www.praxisl
> > > ive.org
> > > 
> > > 

AW: Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK& JavaFX versions)

Posted by Christian Lenz <ch...@gmx.net>.
We Need to figure out how it should work, beacuse I don’t want to build the whole Project again and again after I Change smth in my frontend. As you can see it in my solution, I can build/start/test my application without Building the NB stuff. Fast enough and live reload. I can Change Things and it will reload immediately.


Von: Antonio
Gesendet: Samstag, 2. Dezember 2017 13:30
An: dev@netbeans.incubator.apache.org
Betreff: Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK& JavaFX versions)

 From "How do I use a web component?" at [1], this excerpt...

	<link rel="import" href="../emoji-rain/emoji-rain.html">
	...
	<emoji-rain active></emoji-rain>

... is easily translated to a Swing component.

Also a "Material Card" as in [2] is just a piece of XML code that refers 
to different sub components (see [4] 'mdc-card__title', 
'mcd-card__supporting-text'). And again is easily translated to a Swing 
component (a basis could be [3]).

Modern HTML GUIs don't just use <div>'s and things like that. Modern 
HTML GUIs use web components, and NetBeans could define __a set of 
components__ that work well both in Swing and in the web. Presenting 
these in a JavaFX WebView or in a Swing TopComponent would then just be 
an implementation detail.

Power that with a smooth integration with HTML and Java, by Jaroslav, 
and add to that some NetBeans Lookup's, Node's and ExplorerManager's 
(ported to the web) and you're all set to start building landing pages, 
OutlineViews, ListViews, PropertySheets and even applications that work 
exactly the same in the web and in Swing.

Cheers,
Antonio

P.S.: Defining a set of web (Swing) components for NetBeans does not 
imply building them. We could choose a nice set of already existing 
ones, Apache License compatible (Material Web Components at [5]?), and 
start building Swing counterparts for them.


[1]
How do I use a web component?
https://www.webcomponents.org/introduction#how-do-i-use-a-web-component-

[2]
Material Card
https://material.io/components/web/catalog/cards/

[3]
A simple Swing JPanel "card"
https://github.com/vieiro/nbp-demo/blob/master/netbeans-platform-demo/nbdemo-gui/src/org/nbdemo/gui/features/ModuleCardPanel.java

[4]
Material Card definition

<div class="mdc-card">
   <section class="mdc-card__primary">
     <h1 class="mdc-card__title mdc-card__title--large">Title goes here</h1>
     <h2 class="mdc-card__subtitle">Subtitle here</h2>
   </section>
   <section class="mdc-card__supporting-text">
     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do 
eiusmod
     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
     veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
     commodo consequat.
   </section>
   <section class="mdc-card__actions">
     <button class="mdc-button mdc-button--compact 
mdc-card__action">Action 1</button>
     <button class="mdc-button mdc-button--compact 
mdc-card__action">Action 2</button>
   </section>
</div>

[5] Material Web Components (Apache license)
https://material.io/components/web/

El 29/11/17 a las 08:15, Jaroslav Tulach escribió:
> Hi HTML fans.
> As a progenitor of the library that allows smooth integration of HTML
> components into NetBeans, I'd like to suggest to avoid references to JavaFX
> webview in NetBeans module code and rather replace them with "one level of
> indirection" . For example one can build proper NetBeans dialog with
> @HtmlDialog annotation:
> http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbeans/api/htmlui/HTMLDialog.html
> - The code shall be fairly trivial with a starting HTML page:
> 
> <html>
>      <head>
>          <title>Base question</title>
>          <meta charset="UTF-8">
>      </head>
>      <body>
>          <div>Hello World! How are you?</div>
>          <-- you need to check the checkbox to enabled the OK button -->
>          <input type="checkbox" data-bind="checked: ok">OK?<br>
>          <-- enabled with checkbox is checked -->
>          <button id='ok' hidden data-bind="enable: ok">Good</button>
>          <button id='bad' hidden>Bad</button>
>      </body>
> </html>
> 
> and a bit of Java glue code using the @HTMLDialog annotation to generate ...
> 
> @HTMLDialog(url = "dialog.html")
> static void showHelloWorld() {
>     // do some initialization if needed
>   }
> 
> ... the necessary entry point and then just showing the dialog when needed:
> 
> Pages.showHelloWorld();
> 
> As you can see the code doesn't reference to JavaFX at all. I believe it is
> essential as it allows us to replace the current JavaFX based WebView
> implementation with more lightweight one (that doesn't carry whole JavaFX
> with it) in the future.
> 
> I understand there may currently be some limitations, but I believe that by
> small improvements (like
> https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
> and make NetBeans Platform the perfect place for using HTML components and
> mixing their JavaScript libraries with surrounding Java.
> 
> I would like to see more HTML components in NetBeans. Your help is
> appreciated.
> -jt
> 
> 
> 
> 2017-11-26 19:06 GMT+01:00 Christian Lenz <ch...@gmx.net>:
> 
>> I don’t know it exactly, but as you can see it here:
>> https://github.com/Chris2011/NbScratchFile/blob/develop/
>> src/main/resources/org/chrisle/netbeans/plugins/
>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
>> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
>> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
>> Comes with my plugin afaik.
>>
>>
>> Von: Neil C Smith
>> Gesendet: Sonntag, 26. November 2017 19:01
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: JDK & JavaFX versions
>>
>> Hi,
>>
>> On Sun, Nov 26, 2017 at 8:10 AM Antonio <an...@vieiro.net> wrote:
>>
>>> This includes most Debian users (OpenJFX is packaged separately from the
>>> OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
>>> installed by default with OpenJDK).
>>>
>>
>> Answering in reverse, no OpenJFX isn't installed, or even recommended or
>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
>> OpenJDK so I wouldn't expect differently ...
>>
>> Of course I'd love to use WebViews in NetBeans. But if we build the
>>> landing page as a WebView then those users that have no JavaFX installed
>>> won't be able to see it.
>>>
>>
>> I would really like us not to have a hard dependency on JavaFX, at least
>> for the foreseeable future.  Lots of places it's not guaranteed to be
>> available.
>>
>> However, I can see the merits for the start page.  I may be wrong, but
>> would not the start page be a good showcase for html4j?  Embed the JavaFX
>> Webview if available, load in an external browser if not?  Could be
>> automatic, or probably a banner image fallback with click to launch?
>>
>>
>>> El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>> JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
>>> so I'm not certain it's good to rely on right now. "Pretty soon" though
>>> OracleJDK will merge into OpenJDK so I assume this means most JavaFX bits
>>> will land in OpenJDK proper?
>>>
>>
>> It would surprise me if that changed the situation at all - anything
>> concrete to back that up?
>>
>> Best wishes,
>>
>> Neil
>>
>> --
>> Neil C Smith
>> Artist & Technologist
>> www.neilcsmith.net
>>
>> Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>>
>>
> 


Is it web components? (was Re: (Avoid) Using JavaFX WebView was: JDK & JavaFX versions)

Posted by Antonio <an...@vieiro.net>.
 From "How do I use a web component?" at [1], this excerpt...

	<link rel="import" href="../emoji-rain/emoji-rain.html">
	...
	<emoji-rain active></emoji-rain>

... is easily translated to a Swing component.

Also a "Material Card" as in [2] is just a piece of XML code that refers 
to different sub components (see [4] 'mdc-card__title', 
'mcd-card__supporting-text'). And again is easily translated to a Swing 
component (a basis could be [3]).

Modern HTML GUIs don't just use <div>'s and things like that. Modern 
HTML GUIs use web components, and NetBeans could define __a set of 
components__ that work well both in Swing and in the web. Presenting 
these in a JavaFX WebView or in a Swing TopComponent would then just be 
an implementation detail.

Power that with a smooth integration with HTML and Java, by Jaroslav, 
and add to that some NetBeans Lookup's, Node's and ExplorerManager's 
(ported to the web) and you're all set to start building landing pages, 
OutlineViews, ListViews, PropertySheets and even applications that work 
exactly the same in the web and in Swing.

Cheers,
Antonio

P.S.: Defining a set of web (Swing) components for NetBeans does not 
imply building them. We could choose a nice set of already existing 
ones, Apache License compatible (Material Web Components at [5]?), and 
start building Swing counterparts for them.


[1]
How do I use a web component?
https://www.webcomponents.org/introduction#how-do-i-use-a-web-component-

[2]
Material Card
https://material.io/components/web/catalog/cards/

[3]
A simple Swing JPanel "card"
https://github.com/vieiro/nbp-demo/blob/master/netbeans-platform-demo/nbdemo-gui/src/org/nbdemo/gui/features/ModuleCardPanel.java

[4]
Material Card definition

<div class="mdc-card">
   <section class="mdc-card__primary">
     <h1 class="mdc-card__title mdc-card__title--large">Title goes here</h1>
     <h2 class="mdc-card__subtitle">Subtitle here</h2>
   </section>
   <section class="mdc-card__supporting-text">
     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do 
eiusmod
     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
     veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
     commodo consequat.
   </section>
   <section class="mdc-card__actions">
     <button class="mdc-button mdc-button--compact 
mdc-card__action">Action 1</button>
     <button class="mdc-button mdc-button--compact 
mdc-card__action">Action 2</button>
   </section>
</div>

[5] Material Web Components (Apache license)
https://material.io/components/web/

El 29/11/17 a las 08:15, Jaroslav Tulach escribió:
> Hi HTML fans.
> As a progenitor of the library that allows smooth integration of HTML
> components into NetBeans, I'd like to suggest to avoid references to JavaFX
> webview in NetBeans module code and rather replace them with "one level of
> indirection" . For example one can build proper NetBeans dialog with
> @HtmlDialog annotation:
> http://bits.netbeans.org/8.2/javadoc/org-netbeans-api-htmlui/org/netbeans/api/htmlui/HTMLDialog.html
> - The code shall be fairly trivial with a starting HTML page:
> 
> <html>
>      <head>
>          <title>Base question</title>
>          <meta charset="UTF-8">
>      </head>
>      <body>
>          <div>Hello World! How are you?</div>
>          <-- you need to check the checkbox to enabled the OK button -->
>          <input type="checkbox" data-bind="checked: ok">OK?<br>
>          <-- enabled with checkbox is checked -->
>          <button id='ok' hidden data-bind="enable: ok">Good</button>
>          <button id='bad' hidden>Bad</button>
>      </body>
> </html>
> 
> and a bit of Java glue code using the @HTMLDialog annotation to generate ...
> 
> @HTMLDialog(url = "dialog.html")
> static void showHelloWorld() {
>     // do some initialization if needed
>   }
> 
> ... the necessary entry point and then just showing the dialog when needed:
> 
> Pages.showHelloWorld();
> 
> As you can see the code doesn't reference to JavaFX at all. I believe it is
> essential as it allows us to replace the current JavaFX based WebView
> implementation with more lightweight one (that doesn't carry whole JavaFX
> with it) in the future.
> 
> I understand there may currently be some limitations, but I believe that by
> small improvements (like
> https://github.com/apache/incubator-netbeans/pull/301) we can overcome them
> and make NetBeans Platform the perfect place for using HTML components and
> mixing their JavaScript libraries with surrounding Java.
> 
> I would like to see more HTML components in NetBeans. Your help is
> appreciated.
> -jt
> 
> 
> 
> 2017-11-26 19:06 GMT+01:00 Christian Lenz <ch...@gmx.net>:
> 
>> I don’t know it exactly, but as you can see it here:
>> https://github.com/Chris2011/NbScratchFile/blob/develop/
>> src/main/resources/org/chrisle/netbeans/plugins/
>> utils/WebViewDialog.java#L30 I use the javaFX webview to add it into a
>> JDialog, to create the UI with HTML5. But I can’t remember, that I had to
>> install JavaFX seperately. Maybe I’m wrong but it is a dependency, which
>> Comes with my plugin afaik.
>>
>>
>> Von: Neil C Smith
>> Gesendet: Sonntag, 26. November 2017 19:01
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: JDK & JavaFX versions
>>
>> Hi,
>>
>> On Sun, Nov 26, 2017 at 8:10 AM Antonio <an...@vieiro.net> wrote:
>>
>>> This includes most Debian users (OpenJFX is packaged separately from the
>>> OpenJDK), and maybe most Ubuntu users (I don't know if OpenJFX is
>>> installed by default with OpenJDK).
>>>
>>
>> Answering in reverse, no OpenJFX isn't installed, or even recommended or
>> suggested, when installing OpenJDK on Ubuntu (16.04).  It's not part of
>> OpenJDK so I wouldn't expect differently ...
>>
>> Of course I'd love to use WebViews in NetBeans. But if we build the
>>> landing page as a WebView then those users that have no JavaFX installed
>>> won't be able to see it.
>>>
>>
>> I would really like us not to have a hard dependency on JavaFX, at least
>> for the foreseeable future.  Lots of places it's not guaranteed to be
>> available.
>>
>> However, I can see the merits for the start page.  I may be wrong, but
>> would not the start page be a good showcase for html4j?  Embed the JavaFX
>> Webview if available, load in an external browser if not?  Could be
>> automatic, or probably a banner image fallback with click to launch?
>>
>>
>>> El 26/11/17 a las 08:18, Emilian Bold escribió:
>>>> JavaFX doesn't exist on some platforms like the Raspberry PI ARM builds
>>> so I'm not certain it's good to rely on right now. "Pretty soon" though
>>> OracleJDK will merge into OpenJDK so I assume this means most JavaFX bits
>>> will land in OpenJDK proper?
>>>
>>
>> It would surprise me if that changed the situation at all - anything
>> concrete to back that up?
>>
>> Best wishes,
>>
>> Neil
>>
>> --
>> Neil C Smith
>> Artist & Technologist
>> www.neilcsmith.net
>>
>> Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>>
>>
>