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 248418 - Swing independent UI for template creation
Summary: Swing independent UI for template creation
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jaroslav Tulach
Keywords: API_REVIEW
Depends on: 247926 248918 249319
  Show dependency tree
Reported: 2014-11-05 09:33 UTC by Jaroslav Tulach
Modified: 2014-12-23 04:36 UTC (History)
5 users (show)

See Also:
Exception Reporter:

wizardchome.html showing how a wizard skeleton around a wizard content could look like in a browser (18.79 KB, application/octet-stream)
2014-11-05 13:17 UTC, Jaroslav Tulach

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2014-11-05 09:33:23 UTC
Issue 247926 is trying to separate the definition of templates from the data systems (and their Swing based UI). In addition to that I believe we should have a way to design custom UI for more complicated templates that can be used in non-Swing UI environment, possibly in a browser.
Comment 1 Jaroslav Tulach 2014-11-05 09:39:23 UTC
I am going to describe the plan for inception review at
Comment 2 Jaroslav Tulach 2014-11-05 13:17:54 UTC
Created attachment 150293 [details]
wizardchome.html showing how a wizard skeleton around a wizard content could look like in a browser
Comment 3 Jaroslav Tulach 2014-11-21 16:26:43 UTC
Guys, can we start an inception review for this enhancement? Please see the associated wiki page and leave your comments here.

Can we meet on Dec 2, 2pm? I'd like the reviewers to be Jaroslav Havlín, Tomáš Zezula, Svatopluk Dědic and Toni Epple. Prague will meet in Giza. I'll provide the call in info before the meeting.
Comment 4 Jaroslav Tulach 2014-11-25 20:29:38 UTC
Any comments?
Comment 5 Jaroslav Havlin 2014-11-28 13:25:30 UTC
I would prefer some solution that does not depend on global element ids (if possible).
Reusing the wizard would be easier then, as there would be no risk of id conflict.

 - Possibility to set step id and step display name in the template
 - Avoid need to list steps in both model and template
 - Separate models for data and for controls (current step, validations)
 - Would some support for progress bar make sense?
 - Is some support for internationalization needed?
Comment 6 Jaroslav Havlin 2014-12-01 09:01:03 UTC
We can also consider template format similar to some JQuery plugins.

<div class="someEmbeddableSelector">
    <h1 data-step="init">Initial Page</h1>
        JavaScript will ask you few questions about your mood.

    <h1 data-step="info">Query Page</h1>
        Is everything OK?
        <input type="checkbox" data-bind="checked: ok"/>
        <p>How do you feel?
        <input type='text' data-bind="value: msg"/>

    <h1 data-step="summary">Summary Page</h1>
        You are feeling <span data-bind="text: msg"></span>!
Comment 7 Jaroslav Havlin 2014-12-01 13:40:23 UTC
Notes from inception review:

TCR: Avoid knockout templates, use data-step approach.
TCR: Filter control data
TCR: Support for progress bar
TCR: Do not depend on JavaFX

TCA: Prepare TCK (Technology Compatibility Kit)
Comment 8 Jaroslav Tulach 2014-12-15 09:32:41 UTC
> TCR: Do not depend on JavaFX

Addressed in
now there is api.templates and templatesui module connected via org.netbeans.api.templates.wizard token.
Comment 9 Jaroslav Tulach 2014-12-15 12:40:40 UTC
> TCA: Prepare TCK (Technology Compatibility Kit)

This is the way to write new TCK tests:
A test is composed from an HTML page, initialization code and set of JavaScript operations to perform. These operations may acces "tck" object with various methods defined by the wizard framework implementation - e.g. other implementations would define the "tck" object differently to expose their own internals.
Comment 10 Jaroslav Tulach 2014-12-15 13:53:03 UTC
> TCR: Avoid knockout templates, use data-step approach.

While having a way to define the list of steps in HTML is convenient, the data-step approach is too "jQuery-like" - e.g. one would need to mangle around the DOM a bit too much. Here is more knockoutish approach - use of custom 'step' binding: - hopefully it will be found acceptable too.
Comment 11 Jaroslav Tulach 2014-12-15 14:05:56 UTC
> TCR: Filter control data

Comment 12 Jaroslav Havlin 2014-12-15 14:11:03 UTC
(In reply to Jaroslav Tulach from comment #10)
> Here is more knockoutish approach - use of
> custom 'step' binding: -
> hopefully it will be found acceptable too.
It seems fine to me. Thank you.
Comment 13 Jaroslav Tulach 2014-12-16 14:29:33 UTC
Everything is done, including wizard to generate the wizard:

The only missing piece is "TCR: Support for progress bar". There is no progress support in our Wizard API - only ProgressInstantiatingIterator - but so far the instantiation is handled by the system itself (using a freemarker templating engine). The only place for progress would be on "Next" button. For that there is AsynchronousValidatingPanel, but that one does not show progress. Anyway I will try to think about ways to bridge AsynchronousValidatingPanel into JavaScript by the final review.

Btw. can we have the review on Thursday, Dec 18? Say 11am CET? Tomáš is leaving for vacation, but he promised to review the change in advance. Can others Sváťa, Toni and Jarda join on Thursday?
Comment 14 Jaroslav Tulach 2014-12-17 11:12:03 UTC
The validation is implemented and tested in the TCK as of

I will work on better documentation now.
Comment 15 Jaroslav Tulach 2014-12-18 09:58:32 UTC
Finally the builder succeeded and we have Javadoc:
Comment 16 Jaroslav Tulach 2014-12-18 11:53:10 UTC
Final review happened on Dec 18, 2014 with Jaroslav Havlín, Toni Epple, Martin Entlicher and Ondřej Vrabec being the reviewers. The change was approved for integration. See the notes at

I'd like to especially thank Ondřej for bringing up his requirejs experience and spelling his global namespace initialization requirements. Thanks.
Comment 17 Jaroslav Tulach 2014-12-22 15:37:04 UTC
Documentation improved as of
Comment 18 Quality Engineering 2014-12-23 04:36:02 UTC
Integrated into 'main-silver', will be available in build *201412230001* on (upload may still be in progress)

User: Jaroslav Tulach <>
Log: Review of #248418 went OK, the tests seem to be passing. Integrating. Still pending documentation fixes.