| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.seasar.uruma.util; |
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | 0 | public class HtmlTagUtil { |
| 24 | |
|
| 25 | |
public static String createTable() { |
| 26 | 0 | return "<table> "; |
| 27 | |
} |
| 28 | |
|
| 29 | |
public static String createTable(final String key, final String value) { |
| 30 | 0 | return "<table><tr><td class=\"header\" colspan=\"2\">" + key + " = " |
| 31 | |
+ value + "</td></tr>"; |
| 32 | |
} |
| 33 | |
|
| 34 | |
public static String closeTable() { |
| 35 | 0 | return "</table> "; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public static String createTrSub1(final String key, final String value) { |
| 39 | 0 | return "<tr><td class=\"sub_header\" colspan=\"2\">" + key + " = " |
| 40 | |
+ value + "</td></tr>"; |
| 41 | |
} |
| 42 | |
|
| 43 | |
public static String createTrSub2(final String key, final String value) { |
| 44 | 0 | return "<tr><td class=\"sub_sub_header\" colspan=\"2\">" + key + " = " |
| 45 | |
+ value + "</td></tr>"; |
| 46 | |
} |
| 47 | |
|
| 48 | |
public static String createTr(final String td1, final String td2) { |
| 49 | 0 | String tmp = ""; |
| 50 | 0 | tmp += "<tr>"; |
| 51 | 0 | tmp += "<th>"; |
| 52 | 0 | tmp += td1; |
| 53 | 0 | tmp += "</td>"; |
| 54 | 0 | tmp += "<td>"; |
| 55 | 0 | tmp += td2; |
| 56 | 0 | tmp += "</td>"; |
| 57 | 0 | tmp += "</td>"; |
| 58 | 0 | return tmp; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public static String createH1(final String value) { |
| 62 | 0 | return "<h1>" + value + "</h1>"; |
| 63 | |
} |
| 64 | |
|
| 65 | |
public static String createH2(final String value) { |
| 66 | 0 | return "<h2>" + value + "</h2>"; |
| 67 | |
} |
| 68 | |
|
| 69 | |
public static String createH3(final String value) { |
| 70 | 0 | return "<h3>" + value + "</h3>"; |
| 71 | |
} |
| 72 | |
|
| 73 | |
public static String createHeader() { |
| 74 | 0 | String header = "<html><head>\n"; |
| 75 | 0 | header += "<style type=\"text/css\">\n"; |
| 76 | 0 | header += "<!--\n"; |
| 77 | 0 | header += "h1 {font-size: 24px; padding: 2px; color: #ffffff; background-color: #666699; line-height: 130%;}\n"; |
| 78 | 0 | header += "h2 {font-size: 18px; padding: 2px; color: #ffffff; background-color: #7778AA; line-height: 130%;}\n"; |
| 79 | 0 | header += "h3 {font-size: 16px; padding: 2px; color: #ffffff; background-color: #9999CC; line-height: 130%;}\n"; |
| 80 | 0 | header += "\n"; |
| 81 | 0 | header += "table {font-size: 12px; color: #666666; border: 1px solid #CCCCCC; border-collapse: separate; border-spacing: 1px; margin-left: 10px;}\n"; |
| 82 | 0 | header += "th {padding: 5px; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; background-color: #E1E2E6; text-align: left;}\n"; |
| 83 | 0 | header += "td {padding: 5px; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; background-color: #EFF2F3;}\n"; |
| 84 | 0 | header += "td.header {font-weight: bold; font-size: 18px; padding: 5px; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; background-color: #666699; color: #ffffff;}\n"; |
| 85 | 0 | header += "td.sub_header {font-weight: bold; font-size: 12px; padding: 5px; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; background-color: #666699; color: #ffffff;}\n"; |
| 86 | 0 | header += "td.sub_sub_header {font-weight: bold; font-size: 12px; padding: 5px; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; background-color: #AAAADD; color: #ffffff;}\n"; |
| 87 | 0 | header += "\n"; |
| 88 | 0 | header += "-->\n"; |
| 89 | 0 | header += "</style>\n"; |
| 90 | 0 | header += "</head>\n"; |
| 91 | 0 | header += "<body>\n"; |
| 92 | |
|
| 93 | 0 | return header; |
| 94 | |
} |
| 95 | |
|
| 96 | |
public static String closeHeader() { |
| 97 | 0 | return "</body></html>"; |
| 98 | |
} |
| 99 | |
} |