use of org.webpieces.ctx.api.extension.Tag in project webpieces by deanhiller.
the class MyHtmlTagCreator method createTags.
@Override
public List<Tag> createTags() {
List<Tag> tags = new ArrayList<Tag>();
// add any custom tags you like here...
tags.add(new CustomTag("/webpiecesxxxxxpackage/web/tags/mytag.tag"));
tags.add(new IdTag(converter, "/webpiecesxxxxxpackage/web/tags/id.tag"));
// you can also override(subclass or whatever) any tag by replacing it in the map
// This replaces the field tag
// put(new FieldTag(converter, "/webpiecesxxxxxpackage/base/tags/field.tag"));
// This one subclasses FieldTag to add yet another field tag using #{myfield}# such that
// we then can use #{field}# and #{myfield}# for different types of fields
tags.add(new MyFieldTag(converter));
return tags;
}
use of org.webpieces.ctx.api.extension.Tag in project webpieces by deanhiller.
the class HtmlTagLookup method install.
public void install(Set<HtmlTagCreator> htmlCreators) {
for (HtmlTagCreator c : htmlCreators) {
List<Tag> tags = c.createTags();
addTags(c, tags);
}
}
use of org.webpieces.ctx.api.extension.Tag in project webpieces by deanhiller.
the class HtmlTagLookup method addTags.
private void addTags(HtmlTagCreator c, List<Tag> tags2) {
for (Tag tag : tags2) {
if (!(tag instanceof HtmlTag)) {
throw new IllegalArgumentException("HtmlTagCreator=" + c.getClass().getName() + " returned a tag in the list NOT of type HtmlTag which is required. offending tag=" + tag.getClass().getName());
}
HtmlTag t = (HtmlTag) tag;
put(t);
}
}
Aggregations