Search in sources :

Example 1 with Tag

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;
}
Also used : ArrayList(java.util.ArrayList) CustomTag(org.webpieces.templating.impl.tags.CustomTag) Tag(org.webpieces.ctx.api.extension.Tag) CustomTag(org.webpieces.templating.impl.tags.CustomTag)

Example 2 with Tag

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);
    }
}
Also used : HtmlTagCreator(org.webpieces.ctx.api.extension.HtmlTagCreator) FormTag(org.webpieces.templating.impl.tags.FormTag) BootstrapModalTag(org.webpieces.templating.impl.tags.BootstrapModalTag) TemplateLoaderTag(org.webpieces.templating.impl.tags.TemplateLoaderTag) HtmlGetTag(org.webpieces.templating.impl.tags.HtmlGetTag) ScriptTag(org.webpieces.templating.impl.tags.ScriptTag) FieldTag(org.webpieces.templating.impl.tags.FieldTag) RenderPageArgsTag(org.webpieces.templating.impl.tags.RenderPageArgsTag) StyleSheetTag(org.webpieces.templating.impl.tags.StyleSheetTag) OptionTag(org.webpieces.templating.impl.tags.OptionTag) Tag(org.webpieces.ctx.api.extension.Tag) ExtendsTag(org.webpieces.templating.impl.tags.ExtendsTag) JsActionTag(org.webpieces.templating.impl.tags.JsActionTag) HtmlSetTag(org.webpieces.templating.impl.tags.HtmlSetTag) RenderTagArgsTag(org.webpieces.templating.impl.tags.RenderTagArgsTag)

Example 3 with Tag

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);
    }
}
Also used : FormTag(org.webpieces.templating.impl.tags.FormTag) BootstrapModalTag(org.webpieces.templating.impl.tags.BootstrapModalTag) TemplateLoaderTag(org.webpieces.templating.impl.tags.TemplateLoaderTag) HtmlGetTag(org.webpieces.templating.impl.tags.HtmlGetTag) ScriptTag(org.webpieces.templating.impl.tags.ScriptTag) FieldTag(org.webpieces.templating.impl.tags.FieldTag) RenderPageArgsTag(org.webpieces.templating.impl.tags.RenderPageArgsTag) StyleSheetTag(org.webpieces.templating.impl.tags.StyleSheetTag) OptionTag(org.webpieces.templating.impl.tags.OptionTag) Tag(org.webpieces.ctx.api.extension.Tag) ExtendsTag(org.webpieces.templating.impl.tags.ExtendsTag) JsActionTag(org.webpieces.templating.impl.tags.JsActionTag) HtmlSetTag(org.webpieces.templating.impl.tags.HtmlSetTag) RenderTagArgsTag(org.webpieces.templating.impl.tags.RenderTagArgsTag)

Aggregations

Tag (org.webpieces.ctx.api.extension.Tag)3 BootstrapModalTag (org.webpieces.templating.impl.tags.BootstrapModalTag)2 ExtendsTag (org.webpieces.templating.impl.tags.ExtendsTag)2 FieldTag (org.webpieces.templating.impl.tags.FieldTag)2 FormTag (org.webpieces.templating.impl.tags.FormTag)2 HtmlGetTag (org.webpieces.templating.impl.tags.HtmlGetTag)2 HtmlSetTag (org.webpieces.templating.impl.tags.HtmlSetTag)2 JsActionTag (org.webpieces.templating.impl.tags.JsActionTag)2 OptionTag (org.webpieces.templating.impl.tags.OptionTag)2 RenderPageArgsTag (org.webpieces.templating.impl.tags.RenderPageArgsTag)2 RenderTagArgsTag (org.webpieces.templating.impl.tags.RenderTagArgsTag)2 ScriptTag (org.webpieces.templating.impl.tags.ScriptTag)2 StyleSheetTag (org.webpieces.templating.impl.tags.StyleSheetTag)2 TemplateLoaderTag (org.webpieces.templating.impl.tags.TemplateLoaderTag)2 ArrayList (java.util.ArrayList)1 HtmlTagCreator (org.webpieces.ctx.api.extension.HtmlTagCreator)1 CustomTag (org.webpieces.templating.impl.tags.CustomTag)1