Sounds great, Geertjan wrote articles, how to create plugins with JS.

JavaScript in JavaFX (Has nothing todo with NetBeans yet): 
https://blogs.oracle.com/geertjan/entry/javafx_in_javascript
Combining Nashorn Scripting with JavaFX (Has nothing todo with NetBeans yet): 
https://blogs.oracle.com/geertjan/entry/combining_nashorn_scripting_with_javafx
Extending NetBeans with Nashorn (Yes possible): 
https://blogs.oracle.com/geertjan/entry/extending_netbeans_with_nashorn

so with the last article it is possible to extend NetBeans with JS, I tried a 
bit but I really need to have a view with XML or HTML, because it is a mess and 
a pain in the ass to write new Button, new Label, new Everything, inside a JS 
file. So it has to be possible to create View files like MyWindow.xml or 
MyWindow.html and a js file behind like MyWindow.js and for sure .css too.

If this is possible, that would be great. This would be the same as with 
Electron (http://electron.atom.io) or NativeScript 
(https://www.nativescript.org/)
But we need more info for this.


Cheers

Chris
 
 

Gesendet: Montag, 19. Dezember 2016 um 14:47 Uhr
Von: "Emilian Bold" <[email protected]>
An: [email protected]
Cc: [email protected]
Betreff: Scriptable NetBeans Modules
Hello,

I think it would be useful to provide a bridge for NetBeans modules done
with scripting languages.

Javascript is the prime candindate since we have Nashorn at JRE level, but
I assume once the hooks are in place more languages will be supported.

The way I expect it to work is to use JAR files but in the MANIFEST add

OpenIDE-Module-ScriptEngine: nashorn

then all class references will be interpreted through the script engine.

So, I could have

OpenIDE-Module-Install: ro/emilianbold/js/install.js

Then in META-INF/services/name.of.Class I could add

ro/emilianbold/js/myservice.js

For layer .instance file we could have another attribute like

<file name="x.instance">
<attr name="instanceScript"
stringvalue="ro/emilianbold/js/serviceimpl.js"/>
</file>

or maybe register the extension and treat .EXT.instance as a script:

OpenIDE-Module-ScriptExtension: js
<file name="ro-emilianbold-js-serviceimpl.js.instance" />

Were there some prior attempts towards something like this?

Does anybody want to help me spec this out and write some prototype?

One area that will be sub-optimal is lazy-loading: I believe the module
system used reflection to instantiate lazily services. This will not work
for scripts as they will have to be loaded and executed. Still, I believe
this will be manageable.

PS: Also CCing [email protected]

--emi

Reply via email to