Package fitnesse.html

Examples of fitnesse.html.HtmlTag


    private String listTag;

    public ListBuilder(String listTag) { this.listTag = listTag; }

    public String toTarget(Translator translator, Symbol symbol) {
        HtmlTag list = new HtmlTag(listTag);
        for (Symbol child: symbol.getChildren()) {
            list.add(new HtmlTag("li", translator.translate(child)));
        }
        return list.html();
    }
View Full Code Here


        wikiRule(new LineRule());
        htmlTranslation(this);
    }

    public String toTarget(Translator translator, Symbol symbol) {
        HtmlTag result = new HtmlTag("h" + symbol.getProperty(LineRule.Level));
        result.add(translator.translate(symbol.childAt(0)).trim());
        return result.html();
    }
View Full Code Here

    }

    private static final String[] cellClasses = {"hash_key", "hash_value"};

    public String toTarget(Translator translator, Symbol symbol) {
        HtmlTag table = new HtmlTag("table");
        table.addAttribute("class", "hash_table");
        for (Symbol child: symbol.getChildren()) {
            HtmlTag row = new HtmlTag("tr");
            row.addAttribute("class", "hash_row");
            table.add(row);
            for (int i = 0; i < 2; i++) {
                String body = translator.translate(child.childAt(i));
                HtmlTag cell = new HtmlTag("td", body.trim());
                cell.addAttribute("class", cellClasses[i]);
                row.add(cell);
            }
        }
        return table.html();
   }
View Full Code Here

        String body = translator.translate(symbol.childAt(1));
        return generateHtml(option, title, body);
    }

    private String makeInvisibleSection(String body) {
        HtmlTag section = new HtmlTag("div", body);
        section.addAttribute("class", "invisible");
        return section.html();
    }
View Full Code Here

        section.addAttribute("class", "invisible");
        return section.html();
    }

    public static String generateHtml(String state, String titleText, String bodyText) {
        HtmlTag outerBlock = new HtmlTag("div");
        outerBlock.addAttribute("class", "collapsible" + state);
       
        outerBlock.add(new RawHtml("<ul>" +
            "<li><a href='#' class='expandall'>Expand</a></li>" +
            "<li><a href='#' class='collapseall'>Collapse</a></li>" +
            "</ul>"));

        HtmlTag title = new HtmlTag("p", titleText);
        title.addAttribute("class", "title");
        outerBlock.add(title);
       
        HtmlTag body = new HtmlTag("div", bodyText);
        outerBlock.add(body);
       
        return outerBlock.html();
    }
View Full Code Here

        return new Maybe<Symbol>(current);
    }
    public String toTarget(Translator translator, Symbol symbol) {
        ContentsItemBuilder itemBuilder
                = new ContentsItemBuilder(symbol, 1, translator.getPage());
        HtmlTag contentsDiv = HtmlUtil.makeDivTag("contents");
        contentsDiv.add(HtmlUtil.makeBold("Contents:"));
        contentsDiv.add(itemBuilder.buildLevel(translator.getPage()));
        return contentsDiv.html();
    }
View Full Code Here

      if (close == SymbolType.Empty) return Maybe.noString;
      return parser.parseToAsString(close);
    }

    public String toTarget(Translator translator, Symbol symbol) {
        HtmlTag result = new HtmlTag("span", "variable defined: "
                + translator.translate(symbol.childAt(0))
                + "="
                + translator.translate(symbol.childAt(1)));
        result.addAttribute("class", "meta");
        return result.html();
    }
View Full Code Here

        }
        return sb.toString();
    }

    private String error(String string) {
        HtmlTag tag = new HtmlTag("p");
        tag.addAttribute("style", "color:red");
        tag.add(string);
        return tag.htmlInline();
    }
View Full Code Here

TOP

Related Classes of fitnesse.html.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.