Script templates can be used to represent frequently used scripts. Typically such scripts would be stored in some kind of storage. A data provider on top of this storage could then be used to provide these scripts as {@link ScriptTemplate}s to this table, which displays them as a list. When a script is selected this table copies it over to the attached {@link AbstractScriptEnginePanel}'s input field so that the script can be executed immediately.
Example:
GroovyScriptEnginePanel enginePanel = new GroovyScriptEnginePanel("scriptPanel"); enginePanel.setOutputMarkupId(true); add(enginePanel); ScriptTemplateSelectionTablePanel scriptTable = new ScriptTemplateSelectionTablePanel( "templatesTable", enginePanel, dataProvider(), 10); add(scriptTable);Markup:
<div wicket:id="scriptPanel"></div> <div wicket:id="templatesTable"></div>@author cretzel
|
|