1 17 package org.alfresco.web.ui.common; 18 19 import java.io.IOException ; 20 import java.io.Writer ; 21 22 27 public final class PanelGenerator 28 { 29 public static void generatePanel(Writer out, String contextPath, String panel, String inner) 30 throws IOException 31 { 32 generatePanel(out, contextPath, panel, inner, BGCOLOR_WHITE); 33 } 34 35 public static void generatePanel(Writer out, String contextPath, String panel, String inner, String bgColor) 36 throws IOException 37 { 38 generatePanel(out, contextPath, panel, inner, bgColor, false); 39 } 40 41 public static void generatePanel(Writer out, String contextPath, String panel, String inner, String bgColor, boolean dialog) 42 throws IOException 43 { 44 generatePanelStart(out, contextPath, panel, bgColor, dialog); 45 out.write(inner); 46 generatePanelEnd(out, contextPath, panel); 47 } 48 49 public static void generatePanelStart(Writer out, String contextPath, String panel, String bgColor) 50 throws IOException 51 { 52 generatePanelStart(out, contextPath, panel, bgColor, false); 53 } 54 55 public static void generatePanelStart(Writer out, String contextPath, String panel, String bgColor, boolean dialog) 56 throws IOException 57 { 58 out.write("<table cellspacing=0 cellpadding=0 border=0 width=100%><tr><td width=7><img SRC='"); 59 out.write(contextPath); 60 out.write("/images/parts/"); 61 out.write(panel); 62 out.write("_01.gif' width=7 height=7 alt=''></td>"); 63 64 out.write("<td background='"); 65 out.write(contextPath); 66 out.write("/images/parts/"); 67 out.write(panel); 68 out.write("_02.gif'><img SRC='"); 69 out.write(contextPath); 70 out.write("/images/parts/"); 71 out.write(panel); 72 out.write("_02.gif' width=7 height=7 alt=''></td>"); 73 74 out.write("<td width=7><img SRC='"); 75 out.write(contextPath); 76 out.write("/images/parts/"); 77 out.write(panel); 78 out.write("_03"); 79 if (dialog) 80 { 81 out.write("_squared"); 82 } 83 out.write(".gif' width=7 height=7 alt=''></td></tr>"); 84 85 out.write("<tr><td background='"); 86 out.write(contextPath); 87 out.write("/images/parts/"); 88 out.write(panel); 89 out.write("_04.gif'><img SRC='"); 90 out.write(contextPath); 91 out.write("/images/parts/"); 92 out.write(panel); 93 out.write("_04.gif' width=7 height=7 alt=''></td><td bgcolor='"); 94 out.write(bgColor); 95 out.write("'>"); 96 } 97 98 public static void generatePanelEnd(Writer out, String contextPath, String panel) 99 throws IOException 100 { 101 out.write("</td><td background='"); 102 out.write(contextPath); 103 out.write("/images/parts/"); 104 out.write(panel); 105 out.write("_06.gif'><img SRC='"); 106 out.write(contextPath); 107 out.write("/images/parts/"); 108 out.write(panel); 109 out.write("_06.gif' width=7 height=7 alt=''></td></tr>"); 110 111 out.write("<tr><td width=7><img SRC='"); 112 out.write(contextPath); 113 out.write("/images/parts/"); 114 out.write(panel); 115 out.write("_07.gif' width=7 height=7 alt=''></td>"); 116 117 out.write("<td background='"); 118 out.write(contextPath); 119 out.write("/images/parts/"); 120 out.write(panel); 121 out.write("_08.gif'><img SRC='"); 122 out.write(contextPath); 123 out.write("/images/parts/"); 124 out.write(panel); 125 out.write("_08.gif' width=7 height=7 alt=''></td>"); 126 127 out.write("<td width=7><img SRC='"); 128 out.write(contextPath); 129 out.write("/images/parts/"); 130 out.write(panel); 131 out.write("_09.gif' width=7 height=7 alt=''></td></tr></table>"); 132 } 133 134 public static void generateTitledPanelMiddle(Writer out, String contextPath, String titlePanel, 135 String contentPanel, String contentBgColor) throws IOException 136 { 137 out.write("</td><td background='"); 139 out.write(contextPath); 140 out.write("/images/parts/"); 141 out.write(titlePanel); 142 out.write("_06.gif'><img SRC='"); 143 out.write(contextPath); 144 out.write("/images/parts/"); 145 out.write(titlePanel); 146 out.write("_06.gif' width=7 height=7 alt=''></td></tr>"); 147 148 out.write("<tr><td width=7><img SRC='"); 149 out.write(contextPath); 150 out.write("/images/parts/"); 151 out.write(titlePanel); 152 out.write("_"); 153 out.write(contentPanel); 154 out.write("_07.gif' width=7 height=7 alt=''></td>"); 155 156 out.write("<td background='"); 157 out.write(contextPath); 158 out.write("/images/parts/"); 159 out.write(titlePanel); 160 out.write("_08.gif'><img SRC='"); 161 out.write(contextPath); 162 out.write("/images/parts/"); 163 out.write(titlePanel); 164 out.write("_08.gif' width=7 height=7 alt=''></td>"); 165 166 out.write("<td width=7><img SRC='"); 167 out.write(contextPath); 168 out.write("/images/parts/"); 169 out.write(titlePanel); 170 out.write("_"); 171 out.write(contentPanel); 172 out.write("_09.gif' width=7 height=7 alt=''></td></tr>"); 173 174 out.write("<tr><td background='"); 175 out.write(contextPath); 176 out.write("/images/parts/"); 177 out.write(contentPanel); 178 out.write("_04.gif'><img SRC='"); 179 out.write(contextPath); 180 out.write("/images/parts/"); 181 out.write(contentPanel); 182 out.write("_04.gif' width=7 height=7 alt=''></td><td bgcolor='"); 183 out.write(contentBgColor); 184 out.write("' style='padding-top:6px;'>"); 185 } 186 187 public final static String BGCOLOR_WHITE = "#FFFFFF"; 188 } 189 | Popular Tags |