JaroslavTulach at 07:37, 10 December 2021 - 2021-12-10 07:37:45

←Older revision Revision as of 07:37, 10 December 2021
Line 5: Line 5:
Can we replace that scripting language with a real programming language like [[Java]]?
Can we replace that scripting language with a real programming language like [[Java]]?
-
== Unify [[Eclipse]] and [[NetBeans]] UI ==
+
== 2021: Code [[VSCode]] [[UI]] in [[Java]] ==
 +
 
 +
Seven years ago, in 2014 I wanted to unify UI of various IDEs around [[HTML]] (see below). However the motivation to do so was never compelling enough. Using [[Swing]] (or [[SWT]]) is more natural. Finally, in 2021 we found good enough reason: [[VSCode]] and its [[NetBeans]] based extension!
 +
 
 +
[[Image:Vscodehtmlui.png]]
 +
 
 +
Since December 10, 2021 it is real: one can code [[HTML]] [[UI]] in [[Java]] and display it in [[VSCode]] as well as [[NetBeans]]. See [https://github.com/apache/netbeans/pull/3349 PR-3349].
 +
 
 +
== 2014: Unify [[Eclipse]] and [[NetBeans]] UI ==
Those of you who observe my work know that for a few months I am trying to design an [[API]] to program application logic in [[Java]] and render the UI in [[HTML]]. We can render the UI by [[Knockout4Java]] and display it on desktop (via [[FXBrwsr]]) and in real browser (via [[Bck2Brwsr]]), however today I have another announcement to make:
Those of you who observe my work know that for a few months I am trying to design an [[API]] to program application logic in [[Java]] and render the UI in [[HTML]]. We can render the UI by [[Knockout4Java]] and display it on desktop (via [[FXBrwsr]]) and in real browser (via [[Bck2Brwsr]]), however today I have another announcement to make:

JaroslavTulach: /* Try NBrwsr! */ - 2014-09-25 13:13:39

Try NBrwsr!

←Older revision Revision as of 13:13, 25 September 2014
Line 67: Line 67:
=== Try ''NBrwsr''! ===
=== Try ''NBrwsr''! ===
-
You can either try the [[MineSweeper]] demo, check instructions at [[DukeScriptInNetBeans]], or follow these simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]] with the previously described example:
+
All the infrastructure will be part of [[NetBeans Platform]] since version 8.1. But don't wait: follow these steps to get [[DukeScriptInNetBeans]] and you'll have ''NBrwsr'' in your 8.0.x!
 +
 
 +
To see the older code, you can follow these simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]] with the previously described example:
<source lang="bash">
<source lang="bash">

JaroslavTulach: /* The Great Plan */ - 2014-06-19 07:26:45

The Great Plan

←Older revision Revision as of 07:26, 19 June 2014
Line 63: Line 63:
Are you asking what am I trying to demonstrate? I am trying to show that now the two [[Java]] rich client platforms are closer than ever. For a while, when one wants to share a code, one can use [[OSGi]] (since [[NetBeans]] 6.9). Now, when one wants to share UI, one can use [[DukeScript]].
Are you asking what am I trying to demonstrate? I am trying to show that now the two [[Java]] rich client platforms are closer than ever. For a while, when one wants to share a code, one can use [[OSGi]] (since [[NetBeans]] 6.9). Now, when one wants to share UI, one can use [[DukeScript]].
-
So, when you need to write code that runs everywhere, consider using the [[Knockout4Java]] technology. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], desktop, browser and possibly mobile devices), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] 7.4 Easel).
+
So, when you need to write code that runs everywhere, consider using the [[DukeScript]] technologies. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], [[FXBrwsr|desktop]], [[Bck2Brwsr|browser]], [[IBrwsr|iOS]], [[DlvkBrwsr|Android]] so far), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] Easel).
=== Try ''NBrwsr''! ===
=== Try ''NBrwsr''! ===
-
You can either try the [[MineSweeper]] demo, or follow these simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]] with the previously described example:
+
You can either try the [[MineSweeper]] demo, check instructions at [[DukeScriptInNetBeans]], or follow these simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]] with the previously described example:
<source lang="bash">
<source lang="bash">

JaroslavTulach: /* The Great Plan */ - 2014-06-19 07:23:32

The Great Plan

←Older revision Revision as of 07:23, 19 June 2014
Line 61: Line 61:
== The Great Plan ==
== The Great Plan ==
-
Are you asking what am I trying to demonstrate? I am trying to show that now the two [[Java]] rich client platforms are closer than ever. For a while, when one wants to share a code, one can use [[OSGi]] (since [[NetBeans]] 6.9). Now, when one wants to share UI, one can use [[HTML]] (backed by [[Knockout4Java]]).
+
Are you asking what am I trying to demonstrate? I am trying to show that now the two [[Java]] rich client platforms are closer than ever. For a while, when one wants to share a code, one can use [[OSGi]] (since [[NetBeans]] 6.9). Now, when one wants to share UI, one can use [[DukeScript]].
So, when you need to write code that runs everywhere, consider using the [[Knockout4Java]] technology. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], desktop, browser and possibly mobile devices), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] 7.4 Easel).
So, when you need to write code that runs everywhere, consider using the [[Knockout4Java]] technology. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], desktop, browser and possibly mobile devices), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] 7.4 Easel).

JaroslavTulach: /* Try NBrwsr! */ - 2014-04-15 11:56:21

Try NBrwsr!

←Older revision Revision as of 11:56, 15 April 2014
Line 67: Line 67:
=== Try ''NBrwsr''! ===
=== Try ''NBrwsr''! ===
-
Simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]]:
+
You can either try the [[MineSweeper]] demo, or follow these simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]] with the previously described example:
<source lang="bash">
<source lang="bash">

JaroslavTulach: /* Try NBrwsr! */ - 2014-03-24 09:06:07

Try NBrwsr!

←Older revision Revision as of 09:06, 24 March 2014
Line 73: Line 73:
$ cd html4j+nb
$ cd html4j+nb
$ hg up release-0.7.6
$ hg up release-0.7.6
-
$ mvn install-DskipTests
+
$ mvn install -DskipTests
$ cd demo/application/
$ cd demo/application/
$ mvn nbm:run-platform
$ mvn nbm:run-platform

JaroslavTulach: /* Try NBrwsr! */ - 2014-03-24 09:05:59

Try NBrwsr!

←Older revision Revision as of 09:05, 24 March 2014
Line 73: Line 73:
$ cd html4j+nb
$ cd html4j+nb
$ hg up release-0.7.6
$ hg up release-0.7.6
-
$ mvn install
+
$ mvn install-DskipTests
$ cd demo/application/
$ cd demo/application/
$ mvn nbm:run-platform
$ mvn nbm:run-platform

JaroslavTulach: /* Try NBrwsr */ - 2014-03-23 12:04:07

Try NBrwsr

←Older revision Revision as of 12:04, 23 March 2014
Line 65: Line 65:
So, when you need to write code that runs everywhere, consider using the [[Knockout4Java]] technology. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], desktop, browser and possibly mobile devices), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] 7.4 Easel).
So, when you need to write code that runs everywhere, consider using the [[Knockout4Java]] technology. Not only it can be displayed everywhere ([[Eclipse]], [[NetBeans]], desktop, browser and possibly mobile devices), but there are tons of tools that allow you to audit the [[HTML]], CSS (including [[NetBeans]] 7.4 Easel).
-
=== Try ''NBrwsr'' ===
+
=== Try ''NBrwsr''! ===
Simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]]:
Simple steps to try [[NetBeans]] [[FXBrwsr|Brwsr]]:

JaroslavTulach: /* Try NBrwsr */ - 2014-03-23 12:03:50

Try NBrwsr

←Older revision Revision as of 12:03, 23 March 2014
Line 78: Line 78:
</source>
</source>
-
After clicking the ''Duke'' icon, you can see an [[HTML]] UI driven by [[Java]] application logic. Which also influences the surrounding environment (in this case the ''Save'' and ''Save All'' [[NetBeans]] actions). The registration (see the [http://hg.netbeans.org/html4j/nb/file/eb9986bf74f0/demo/html-test/src/main/java/org/netbeans/demo/html/test/HelloModel.java#l80 source code]) is using classical [[NetBeans]] [[API]] annotations {{NB|org-openide-awt|org/openide/awt|ActionID}}, {{NB|org-openide-awt|org/openide/awt|ActionReference}}, together with newly created ''OpenHTMLRegistration'' that one can put on any static method that is then called to initialize the page.
+
After clicking the ''Duke'' icon, you can see an [[HTML]] UI driven by [[Java]] application logic. Which also influences the surrounding environment (in this case the ''Save'' and ''Save All'' [[NetBeans]] actions). The registration (see the [http://hg.netbeans.org/html4j/nb/file/eb9986bf74f0/demo/html-test/src/main/java/org/netbeans/demo/html/test/HelloModel.java#l80 source code]) is using classical [[NetBeans]] [[API]] annotations {{NB|org-openide-awt|org/openide/awt|ActionID}}, {{NB|org-openide-awt|org/openide/awt|ActionReference}}, together with newly created ''OpenHTMLRegistration'' that one can put on any static method that is then called to initialize the page:
 +
 
 +
<source lang="java">
 +
@ActionID(
 +
category = "Tools",
 +
id = "org.netbeans.demo.html.test.HtmlHelloWorld"
 +
)
 +
@OpenHTMLRegistration(
 +
url="hello.html",
 +
displayName = "#CTL_OpenHtmlHelloWorld",
 +
iconBase = "org/netbeans/demo/html/test/ko4j.png"
 +
)
 +
@ActionReferences({
 +
@ActionReference(path = "Menu/Tools"),
 +
@ActionReference(path = "Toolbars/File")
 +
})
 +
@NbBundle.Messages("CTL_OpenHtmlHelloWorld=New HTML+Java Demo Window")
 +
public static Hello onPageLoad() throws Exception {
 +
return new Hello(null, "Ahoj světe!").applyBindings();
 +
}
 +
</source>
 +
 
 +
The ''OpenHTMLRegistration'' action works with plain [[HTML]] pages as well as those driven by [[Knockout4Java]] classes (like the ''Hello'' one in the example). To control [[NetBeans]] actions, make sure your control class has ''context'' property and use it properly as the sample demonstrates.
=== Status ===
=== Status ===
The ''NBrwsr'' is ready for usage. The [[Eclipse]] version builds OK, but works only sometimes and needs even more polishing. However if you are interested in this technology, please [[talkback]].
The ''NBrwsr'' is ready for usage. The [[Eclipse]] version builds OK, but works only sometimes and needs even more polishing. However if you are interested in this technology, please [[talkback]].

JaroslavTulach: /* Try NBrwsr */ - 2014-03-23 11:59:45

Try NBrwsr

←Older revision Revision as of 11:59, 23 March 2014
Line 78: Line 78:
</source>
</source>
-
After clicking the ''Duke'' icon, you can see an [[HTML]] UI driven by [[Java]] application logic. Which also influences the surrounding environment (in this case the ''Save'' and ''Save All'' [[NetBeans]] actions). The registration (see the [http://hg.netbeans.org/html4j/nb/file/eb9986bf74f0/demo/html-test/src/main/java/org/netbeans/demo/html/test/HelloModel.java#l80 source code]) is using classical [[NetBeans]] [[API]] annotations {{NB|openide.awt|org/openide/awt|ActionID}}, {{NB|openide.awt|org/openide/awt|ActionReference}}, together with newly created ''OpenHTMLRegistration'' that one can put on any static method that is then called to initialize the page.
+
After clicking the ''Duke'' icon, you can see an [[HTML]] UI driven by [[Java]] application logic. Which also influences the surrounding environment (in this case the ''Save'' and ''Save All'' [[NetBeans]] actions). The registration (see the [http://hg.netbeans.org/html4j/nb/file/eb9986bf74f0/demo/html-test/src/main/java/org/netbeans/demo/html/test/HelloModel.java#l80 source code]) is using classical [[NetBeans]] [[API]] annotations {{NB|org-openide-awt|org/openide/awt|ActionID}}, {{NB|org-openide-awt|org/openide/awt|ActionReference}}, together with newly created ''OpenHTMLRegistration'' that one can put on any static method that is then called to initialize the page.
=== Status ===
=== Status ===
The ''NBrwsr'' is ready for usage. The [[Eclipse]] version builds OK, but works only sometimes and needs even more polishing. However if you are interested in this technology, please [[talkback]].
The ''NBrwsr'' is ready for usage. The [[Eclipse]] version builds OK, but works only sometimes and needs even more polishing. However if you are interested in this technology, please [[talkback]].