Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sometimes you use or define templates improperly. Either you set an attribute that is not used or forget to set one or reference the wrong template etc... The following code snippets unable enable Java and C# to display template hierarchies in a tree view.

Java

Panel
bgColor#FFFFFF

I have made a toy visualization tool via that shows both the attributes and the way StringTemplate breaks up your template into chunks. It properly handles StringTemplate objects as attributes and other nested structures. Here is the way to launch a Swing frame to view your template:

Code Block
StringTemplate st = ...;
StringTemplateTreeView viz = new StringTemplateTreeView("sample",st);
viz.setVisible(true);

Here is an example display:

C#

Panel
bgColor#FFFFFF

The StringTemplateViewer project is a basic visualization tool that shows both the attributes and the way StringTemplate breaks up your template into chunks. It properly handles StringTemplate objects as attributes and other nested structures. Here is the way to launch a StringTemplateTreeView form to view your template:

Code Block
StringTemplate st = ...;
StringTemplateTreeView stForm = new StringTemplateTreeView("StringTemplateTreeView Example", st);
Application.Run(stForm);

Here is a snapshot. The display is associated with the fill-a-table example below.

Warning

The StringTemplateViewer tool for StringTemplate visualization is an alpha quality release. Expect all the usual problems associated with alpha quality code.