This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257220 - New JET Module file wizard
Summary: New JET Module file wizard
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: OJET (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-19 09:23 UTC by Geertjan Wielenga
Modified: 2016-03-16 17:48 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2015-12-19 09:23:45 UTC
In the New File dialog, there should be a "New JET Module" template.

On completion of the wizard, two files should be created with the same name, e.g., 'home.js' and 'home.html'.

They should be created in two different folders, i.e., the user should be able to select a folder for the JS file and a folder for the HTML file. The default folder for the JS file should be 'js/viewModels' and for the HTML file 'js/views'.

There should be skeleton content in the two files. I.e., in the JS file there should be a JQuery 'define' block, with one observable property, while in the HTML file that property should be used, e.g., via a 'data-bind' attribute in a 'span' element.
Comment 1 Petr Pisl 2016-02-10 12:06:52 UTC
Assigning to Tomas.
Comment 2 Tomas Mysik 2016-03-09 08:07:21 UTC
In which category this New File template should be? HTML5/JavaScript?

Thanks.
Comment 3 Tomas Mysik 2016-03-09 08:08:40 UTC
BTW I also need content for these 2 files - please reopen this issue and provide them.

Thanks.
Comment 5 Geertjan Wielenga 2016-03-09 08:20:07 UTC
Yes, in HTML5/JavaScript category.
Comment 6 Geertjan Wielenga 2016-03-09 08:28:18 UTC
Actually, please also add another file template, in addition to the above, with the two files below -- i.e., there'll be two file templates, one named "Empty" and the other named "Knockout.js". For "Knockout.js", use the two files below:

https://github.com/GeertjanWielenga/SmartTools4OracleJET/tree/master/src/org/netbeans/modules/st4oj/resources/kohelloworld
Comment 7 Geertjan Wielenga 2016-03-09 08:41:18 UTC
PS -- display names: "Empty JET Module" and "Knockout JET Module"
Comment 8 Tomas Mysik 2016-03-09 09:24:22 UTC
(In reply to Geertjan Wielenga from comment #0)
> the user should be
> able to select a folder for the JS file and a folder for the HTML file.

BTW I just noticed it - unfortunately, this is not easily doable [1] with the current NB APIs. What we can do is:

(a) select folder for e.g. JS file and try to guess the location for the HTML file - is this even possible? or
(b) create 2 New File wizards - one for HTML file and one for the JS file.

Any preferences?

Again, reopen this issue, thanks.
[1] We could perhaps use a "bottom" panel for it but not sure if it is OK (my understanding is that the "bottom" panel should provide more information for the new file like package for new Java class etc.)
Comment 9 Tomas Mysik 2016-03-10 10:36:51 UTC
At the end I was able to fix it as originally requested. Please verify, thanks.

http://hg.netbeans.org/web-main/rev/7de1ad728041
Comment 10 Quality Engineering 2016-03-11 02:12:14 UTC
Integrated into 'main-silver', will be available in build *201603110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7de1ad728041
User: Tomas Mysik <tmysik@netbeans.org>
Log: #257220 - New JET Module file wizard