Package org.apache.empire.struts2.html

Examples of org.apache.empire.struts2.html.HtmlWriter


    {
        // Close Wrapper Tag
        if (renderWrapperTag())
        {   // Close Form Wrapper Tag
            HtmlTagDictionary dic = HtmlTagDictionary.getInstance()
            HtmlWriter w = new HtmlWriter(pageContext.getOut());
            HtmlTag wrap = w.continueTag(dic.FormPartWrapperTag(), true);
            wrap.endTag();
        }
        // NullValue
        if (nullValue!=null)
            removePageAttribute(NULLVALUE_ATTRIBUTE, oldNullValue);
View Full Code Here


        // MenuInfo
        MenuTag.MenuInfo mi = getMenuInfo();
        boolean current = isCurrent(mi);
        // HtmlWriter
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag wrap = w.startTag("li");
        addStandardAttributes(wrap, null);
        this.cssClass = getCssClass(mi, current);
        this.cssStyle = null;
        wrap.beginBody();
        // The Anchors
View Full Code Here

        String body = getBody();
        setBodyContent(null);
        // End tag
        int result = super.doEndTag();
        // HtmlWriter
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag wrap = w.continueTag("li", true);
        wrap.endTag(body);
        // Done
        return result;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public int doStartTag() throws JspException
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        // Wrap button like an input control
        if (getBoolean(embed, false))
        {
            // the wrapper (only if renderLabel && renderControl are both true)
            HtmlTag wrapper = w.startTag( dic.InputWrapperTag());
            wrapper.addAttribute("class", dic.InputWrapperClass());
            wrapper.beginBody(true);
           
            HtmlTag wrapCtrl = w.startTag( dic.SubmitControlTag());
            wrapCtrl.addAttribute("class", dic.SubmitControlClass());
            wrapCtrl.addAttributes(dic.SubmitControlAttributes());
            wrapCtrl.beginBody();
        }
        // Button
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public int doEndTag() throws JspException
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        // End Button
        renderButtonEnd(w);
        // Has Wrappers
        if (getBoolean(embed, false))
        {   // End Control Wrapper
            HtmlTag wrapCtrl = w.continueTag( dic.SubmitControlTag(), true);
            wrapCtrl.endTag();
            // End Wrapper
            HtmlTag wrapper = w.continueTag( dic.InputWrapperTag(), true);
            wrapper.endTag();
        }   
        // done
        resetParams();
        // Done
View Full Code Here

    @Override
    public int doStartTag()
        throws JspException
    {
        // Tabel cell tag
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag cb = w.startTag("input");
        cb.addAttribute("type", "checkbox");
        addStandardAttributes(cb, null);
        cb.addAttribute("name",  getTagName(name));
        cb.addAttributeNoCheck("value", getStringValue(), true);
        cb.addAttribute("checked", getChecked());
        cb.addAttribute("disabled", getBoolean(disabled, false));
        cb.addAttribute("tabindex", this.tabindex);
        // Event Attributes
        cb.addAttribute("onclick",   this.onclick);
        cb.addAttribute("onchange"this.onchange);
        cb.addAttribute("onfocus",   this.onfocus);
        cb.addAttribute("onblur",    this.onblur);
        cb.endTag();
        // wrap.beginBody(getTextValue());
        if (hiddenName!=null)
        {   // Render Additional Hidden Control
            HtmlTag hidden = w.startTag("input");
            hidden.addAttribute("type", "hidden");
            hidden.addAttribute("name",  hiddenName);
            hidden.addAttributeNoCheck("value", getStringValue(), true);
            hidden.endTag();
        }
View Full Code Here

    @Override
    public int doStartTag()
        throws JspException
    {
        // Select Input Tag
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag select = w.startTag("select");
        addStandardAttributes(select, null);
        select.addAttribute("name",     getTagName(name));
        select.addAttribute("disabled", getBoolean(disabled, false));
        select.addAttribute("tabindex", this.tabindex);
        // Event Attributes
        select.addAttribute("onclick"this.onclick);
        select.addAttribute("onchange", this.onchange);
        select.addAttribute("onfocus"this.onfocus);
        select.addAttribute("onblur",   this.onblur);
        select.beginBody(true);
        // Render List of Options
        if (options!=null)
        {   // Render option list
            Object current = getValue();
            if (getBoolean(allownull, false) && options.contains(null)==false)
            {   // add an empty entry
                HtmlTag option = w.startTag("option");
                option.addAttributeNoCheck("value", "", false);
                option.addAttribute("selected", ObjectUtils.isEmpty(current));
                option.beginBody("");
                option.endTag(true);
            }
            for (OptionEntry entry : options)
            {
                Object value = entry.getValue();
                boolean isCurrent = ObjectUtils.compareEqual(current, value);
                // Add Option entry
                HtmlTag option = w.startTag("option");
                option.addAttributeNoCheck("value", value, true);
                option.addAttribute("selected", isCurrent);
                option.beginBody(getTranslation(entry.getText()));
                option.endTag(true);
            }
View Full Code Here

    @Override
    public int doStartTag()
        throws JspException
    {
        // Tabel cell tag
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag rb = w.startTag("input");
        addStandardAttributes(rb, null);
        rb.addAttribute("type", "radio");
        rb.addAttribute("name",  getTagName(name));
        rb.addAttributeNoCheck("value", getStringValue(), true);
        rb.addAttribute("checked", getChecked());
View Full Code Here

    public boolean start(Writer writer)
    {
        evaluateParams(); // We need to call this!
        try {
           
            HtmlWriter htmlWriter = new HtmlWriter(writer);

            // render form Tag?
            if (readOnly==false)
            {
                formTag = htmlWriter.startTag("form");
                formTag.addAttribute("id",       this.getId());
                formTag.addAttribute("name",     this.name);
                formTag.addAttribute("onsubmit", this.onsubmit);
                formTag.addAttribute("action",   getURL(action));
                formTag.addAttribute("method",   this.method);
View Full Code Here

            // Check writer
            if (writer==null)
                return false;
          
            // HtmlTagDictionary dic = HtmlTagDictionary.getInstance(); 
            HtmlWriter htmlWriter = new HtmlWriter(writer);

            // The Anchors
            if (disabled==false)
            {
                String url = getUrl(action);

                HtmlTag a = htmlWriter.startTag("a");
                a.addAttribute("id",       this.getId());
                a.addAttribute("href",     url);
                a.addAttribute("target",   this.targets);
                a.addAttribute("class",    this.cssClass);
                a.addAttribute("style",    this.cssStyle);
                a.addAttribute("onclick"this.onclick);
                a.beginBody(text);
                a.endTag(body);
            }
            else
            {  
                // disabledTag = null
                HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
                if (disabledTag == null)
                    disabledTag = dic.AnchorDisabledTag();
                if (cssClass ==null)
                    cssClass = dic.AnchorDisabledClass();
                // The value
                HtmlTag s = htmlWriter.startTag(disabledTag);
                s.addAttribute("class",    this.cssClass);
                s.addAttribute("style",    this.cssStyle);
                s.beginBody(text);
                s.endTag(body);
            }
View Full Code Here

TOP

Related Classes of org.apache.empire.struts2.html.HtmlWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.