public GroovyEngineTestPage()
{
store = new PackagedScriptTemplates();
final GroovyScriptEnginePanel enginePanel = new GroovyScriptEnginePanel("scriptPanel")
{
private static final long serialVersionUID = 1L;
@Override
protected void addControls(final RepeatingView controls)
{
super.addControls(controls);
final Label label = new Label(controls.newChildId(), "Favorites:");
label.add(new AttributeAppender("style", Model.of("color:#ddd;")));
controls.add(label);
int i = 0;
for (final ScriptTemplate template : store.findAll(Lang.GROOVY))
{
final QuickAction action = new QuickAction(controls.newChildId(), this,
new StoredScriptTemplateModel(store, template), i++);
controls.add(action);
}
}
};
enginePanel.setOutputMarkupId(true);
add(enginePanel);
}