Package org.apache.empire.struts2.html.HtmlWriter

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


        }
    }

    private void renderHeader(HtmlWriter writer)
    {
        HtmlTag monthHeader = writer.startTag("tr");
        monthHeader.beginBody();

        HtmlTag thMonth = writer.startTag("th");
        thMonth.addAttribute("class", this.monthClass);
        thMonth.addAttribute("colspan", 8);
        thMonth.beginBody();
        String item = calendarInfo.getLinkText();
        String text = calendarInfo.getMonthText() + " " + calendarInfo.getYearText();
        if (selectMonthAction != null)
        {
            renderLink(writer, text, selectMonthAction, paramName, item);
            text = null;
        }
        thMonth.endTag(text);
        monthHeader.endTag();

        HtmlTag weekHeader = writer.startTag("tr");
        weekHeader.beginBody();

        HtmlTag kwHead = writer.startTag("th");
        kwHead.addAttribute("class", this.dayOfWeekClass);
        kwHead.beginBody();
        kwHead.endTag("KW");

        for (int i = 0; i < 7; i++)
        {
            HtmlTag thWeekDays = writer.startTag("th");
            thWeekDays.addAttribute("class", this.dayOfWeekClass);
            thWeekDays.beginBody();
            text = calendarInfo.getDayOfWeekText(i);
            if (selectWeekdayAction != null)
            {
                renderLink(writer, text, selectWeekdayAction, paramName, item);
                text = null;
            }
            thWeekDays.endTag(text);
        }
        weekHeader.endTag();
    }
View Full Code Here


    private void renderBody(HtmlWriter writer)
    {
        // for each week in a month
        for (int i = 0; i < calendarInfo.getWeekCount(); i++)
        {
            HtmlTag weekRow = writer.startTag("tr");
            weekRow.beginBody();

            // for each day in a week
            renderKalendarWeek(calendarInfo.getWeek(i), writer);
            for (CalendarInfo.CalendarDayInfo day : calendarInfo.getWeek(i))
            {
                renderDay(day, writer);
            }
            weekRow.endTag();
        }
    }
View Full Code Here

                break;
            }
        }
       
        // Render Tag
        HtmlTag weekCell = writer.startTag("td");
        weekCell.addAttribute("class", this.weekOfYearClass);
        weekCell.beginBody();

        if(StringUtils.isValid(bodyText) && StringUtils.isValid(selectWeekAction))
            renderLink(writer, bodyText, selectWeekAction, paramName, linkItem);
        else
            weekCell.endTag("");
    }
View Full Code Here

            bodyText = "&nbsp;";
            cssClass = dateEmptyClass;
        }

        // Render Tag
        HtmlTag dateCell = writer.startTag("td");
        dateCell.addAttribute("class", cssClass);
        // dayCell.addAttribute("style", "text-align:center; width:25px; height:25px; border: 1px solid white;");
        dateCell.beginBody();
        if (linkItem != null)
        {
            renderLink(writer, bodyText, selectDateAction, paramName, linkItem);
            bodyText = null;
        }
        dateCell.endTag(bodyText);
    }
View Full Code Here

        {
            paramMap = new Attributes();
            paramMap.put(param, value);
        }
        // Render Link now
        HtmlTag link = writer.startTag("a");
        link.addAttribute("href", getUrl(action, paramMap));
        link.beginBody(text);
        link.endTag();
    }
View Full Code Here

    public int doStartTag() throws JspException
    {
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
       
        HtmlTag div = w.startTag(dic.PageInfoTag());
        addStandardAttributes(div, dic.PageInfoClass());
        div.beginBody();
        // Add Label
        w.print(getString(str(label, dic.PageInfoLabel())));
        w.print(dic.PageInfoLabelPadding());
        // Add first item
        HtmlTag first = w.startTag(dic.PageInfoItemTag());
        first.endTag(String.valueOf(pagingInfo.getFirstItemIndex()+1));
        // Add Separator
        w.print(dic.PageInfoLabelTo());
        // Add last item
        HtmlTag last = w.startTag(dic.PageInfoItemTag());
        last.endTag(String.valueOf(pagingInfo.getLastItemIndex()+1));
        // Add of label
        w.print(dic.PageInfoLabelPadding());
        w.print(getString(str(of, dic.PageInfoLabelOf())));
        w.print(dic.PageInfoLabelPadding());
        // Add item count
        HtmlTag count = w.startTag(dic.PageInfoItemTag());
        count.endTag(String.valueOf(pagingInfo.getItemCount()));
        // end
        div.endTag();
        // Don't call base class
        return SKIP_BODY; // EVAL_BODY_BUFFERED; // EVAL_BODY_INCLUDE;
    }
View Full Code Here

            // 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.target);
                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);
            }
            return false;
           
        } catch (Exception e) {
            log.error("error when rendering", e);
View Full Code Here

    // <td class="???"><a href="action!method" class=""/>value</a></td>
   
    @Override
    protected void render(HtmlWriter hw, String body, InputControl control)
    {
        HtmlTag td = hw.startTag(htmlTag);
        td.addAttribute("class", this.cssClass);
        td.addAttribute("style", this.cssStyle);
        td.beginBody();
        // Add Link?
        HtmlTag anchor = null;
        if (action!=null)
        {
            String url = getURL(action);
            // print href
            anchor = hw.startTag("a");
            anchor.addAttribute("href", url);
            anchor.addAttribute("title", alt);
            anchor.addAttribute("class", anchorClass);
            anchor.addAttribute("onclick", onclick);
            anchor.beginBody();
        }
        // Body prepend
        if (usesBody() && "append".equalsIgnoreCase(bodyUsage)==false)
            hw.print(body);
        // Render Data
        control.renderText(hw, this);
        // Body append
        if (usesBody() && "append".equalsIgnoreCase(bodyUsage))
            hw.print(body);
        // close anchor
        if (anchor!=null)
            anchor.endTag();
        // close td
        td.endTag();
    }
View Full Code Here

            return SKIP_BODY;
        }
        // Start Tag
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag button = w.startTag ( dic.ButtonTag() );
        addStandardAttributes(button, dic.ButtonClass());
        button.beginBody();
        // Start Value
        this.id=null;
        this.cssClass=null;
        this.cssStyle=null;
        // OnClick
View Full Code Here

        // End Tag
        int result = super.doEndTag();
        // Write End Tag
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag td = w.continueTag(dic.ButtonTag(), true);
        td.endTag();
        // done
        return result;
    }
View Full Code Here

TOP

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

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.