Examples of HtmlTagDictionary


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

        {   // No Errors, nothing to render
            return;
        }
       
        // Render error list
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlTag list = w.startTag(dic.ErrorListTag());
        addStandardAttributes(list, dic.ErrorListClass());
        list.beginBody();
   
        // Are there field errors to render?
        if (hasFieldErrors)
        {   // Render all field errors
            Collection<ErrorInfo> errors = fieldErrors.values();
            String fieldErrClass = str(fieldErrorClass, dic.ErrorItemEntryClass());
            for (ErrorInfo e : errors)
            {
                String msg = provider.getLocalizedErrorMessage(e);
                renderError(w, fieldErrClass, msg);
            }
        }
       
        // Render last action error
        if (hasActionError)
        {   // Render action error
            String actionErrClass = str(actionErrorClass, dic.ErrorActionEntryClass());
            String msg = provider.getLocalizedErrorMessage(lastActionError);
            renderError(w, actionErrClass, msg);
        }

        // done
View Full Code Here

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

        list.endTag();
    }

    private void renderError(HtmlWriter w, String cssClassName, String msg)
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlTag tag = w.startTag(dic.ErrorEntryTag());
        // Check whether additional wrapper is desired
        String wrapTag = dic.ErrorEntryWrapperTag();
        if (wrapTag!=null && wrapTag.length()>0)
        {   tag.beginBody();
            // Item wrapper tag
            HtmlTag wrap = w.startTag(wrapTag);
            wrap.addAttribute("class", cssClassName);
View Full Code Here

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

    public void renderText(HtmlWriter writer, ValueInfo vi)
    {
        if (vi instanceof ControlInfo)
        {   // Wrap read only in a div if it's a control
            ControlInfo ci = ((ControlInfo)vi);
            HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
            HtmlTag div = writer.startTag(dic.InputReadOnlyDataWrapperTag());
            div.addAttribute("id",    ci.getId());
            div.addAttribute("class", ci.getCssClass());
            div.addAttribute("style", ci.getCssStyle());
            div.beginBody();
            internalRenderText(writer, vi);
View Full Code Here

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

                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);
View Full Code Here

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

    public void renderText(HtmlWriter writer, ValueInfo vi)
    {
        if (vi instanceof ControlInfo)
        {   // Wrap read only in a div if it's a control
            ControlInfo ci = ((ControlInfo)vi);
            HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
            HtmlTag div = writer.startTag(dic.InputReadOnlyDataWrapperTag());
            div.addAttribute("id",    ci.getId());
            div.addAttribute("class", ci.getCssClass());
            div.addAttribute("style", ci.getCssStyle());
            div.beginBody();
            internalRenderText(writer, vi);
View Full Code Here

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

        {   // No Errors, nothing to render
            return;
        }
       
        // Render error list
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlTag list = w.startTag(dic.ErrorListTag());
        addStandardAttributes(list, dic.ErrorListClass());
        list.beginBody();
   
        // Are there field errors to render?
        if (hasFieldErrors)
        {   // Render all field errors
            Collection<ErrorInfo> errors = fieldErrors.values();
            String fieldErrClass = str(fieldErrorClass, dic.ErrorItemEntryClass());
            for (ErrorInfo e : errors)
            {
                String msg = provider.getLocalizedErrorMessage(e);
                renderError(w, fieldErrClass, msg);
            }
        }
       
        // Render last action error
        if (hasActionError)
        {   // Render action error
            String actionErrClass = str(actionErrorClass, dic.ErrorActionEntryClass());
            String msg = provider.getLocalizedErrorMessage(lastActionError);
            renderError(w, actionErrClass, msg);
        }

        // done
View Full Code Here

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

        list.endTag();
    }

    private void renderError(HtmlWriter w, String cssClassName, String msg)
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlTag tag = w.startTag(dic.ErrorEntryTag());
        // Check whether additional wrapper is desired
        String wrapTag = dic.ErrorEntryWrapperTag();
        if (wrapTag!=null && wrapTag.length()>0)
        {   tag.beginBody();
            // Item wrapper tag
            HtmlTag wrap = w.startTag(wrapTag);
            wrap.addAttribute("class", cssClassName);
View Full Code Here

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

    */

    @Override
    protected void render(HtmlWriter writer, String body, InputControl control)
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        // Check Render Type
        if (renderType==RenderType.HIDDEN)
        {   // Render Hidden input
            renderHiddenValue(writer);
        }
        else if (renderType==RenderType.LABEL)
        {
            // Render Label only
            HtmlTag label = writer.startTag("label");
            label.addAttribute("class", StringUtils.coalesce(this.labelClass, this.cssClass));
            label.addAttribute("style", StringUtils.coalesce(this.labelStyle, this.cssStyle));
            if (control.useLabelId())
                label.addAttribute("for", getId());
            label.beginBody(this.label);
            label.endTag();
        }
        else if (renderType==RenderType.CONTROL)
        {   // Render Input
            if (renderControlAsData(dic))
            {   // Render Input as Data
                control.renderText(writer, this);
            }
            else
            {   // Render Input as Control
                control.renderInput(writer, this);
            }
            // Additionally render hidden value?
            if (renderHidden())
                renderHiddenValue(writer);
        }
        else
        {   // Check wether to render all
            boolean renderWrapper =(renderType==RenderType.ALL);
           
            // the wrapper (only if renderLabel && renderControl are both true)
            HtmlTag wrapper = writer.startTag((renderWrapper ? dic.InputWrapperTag() : null));
            wrapper.addAttribute("class", dic.InputWrapperClass());
            wrapper.beginBody(true);

            if (renderType!=RenderType.INPUTCONTROL)
            {
                HtmlTag wrapLabel = writer.startTag(dic.InputLabelTag());
                wrapLabel.addAttribute("class", dic.InputLabelClass());
                wrapLabel.beginBody();
                // label
                HtmlTag label = writer.startTag("label");
                if (control.useLabelId())
                    label.addAttribute("for", getId());
                label.addAttribute("class", this.labelClass);
                label.addAttribute("style", this.labelStyle);
                label.beginBody(this.label);
                label.endTag(":");
                // required
                if ("true".equals(this.required) && readOnly == false)
                {
                    HtmlTag required = writer.startTag(dic.InputRequiredTag());
                    required.addAttribute("class", dic.InputRequiredClass());
                    required.beginBody("*");
                    required.endTag();
                }
                // close
                wrapLabel.endTag((renderType!=RenderType.INPUTLABEL));
            }

            // render Control
            if (renderType!=RenderType.INPUTLABEL)
            {
                HtmlTag wrapCtrl = writer.startTag(dic.InputControlTag());
                // Render Input
                if (renderControlAsData(dic))
                {   // Render Input as Data
                    wrapCtrl.addAttribute("class", dic.InputReadOnlyClass());
                    wrapCtrl.beginBody();
                    readOnly = true;
                    control.renderText(writer, this);
                }
                else
                {   // Render Input as Control
                    String wrapClass = (getDisabled() ? dic.InputReadOnlyClass() : dic.InputControlClass());  
                    wrapCtrl.addAttribute("class", wrapClass);
                    wrapCtrl.beginBody();
                    control.renderInput(writer, this);
                }
                // Additionally render hidden value?
                if (renderHidden())
                    renderHiddenValue(writer);
                // End Tag
                wrapCtrl.endTag(renderWrapper);
            }
           
            // Done
            String wrapperBody = (wrapper.isValid()) ? dic.InputWrapperBody() : null
            wrapper.endTag(wrapperBody);
        }
    }
View Full Code Here

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

                // append height
                double height = Math.max(ci.getVSize(), 2) * 1.25;
                style +=  "height:" + height + "em";
            }
            // Wrap read only in a div if it's a control
            HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
            HtmlTag div = writer.startTag(dic.InputReadOnlyDataWrapperTag());
            div.addAttribute("id",    ci.getId());
            div.addAttribute("class", ci.getCssClass());
            div.addAttribute("style", style);
            div.beginBody();
            internalRenderText(writer, vi);
View Full Code Here

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

    public int doStartTag()
        throws JspException
    {
        // super.doStartTag();
        // Write the float clear statement
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        String clear = dic.FloatClear();
        if (clear!=null)
        {   // Print the clear statement
            try {
                pageContext.getOut().print(clear);
            } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.