1 21 22 package org.opensubsystems.patterns.dialoglayout.www; 23 24 import javax.servlet.jsp.JspException ; 25 26 import org.opensubsystems.core.www.BlockElementTag; 27 import org.opensubsystems.core.www.TagUtils; 28 import org.opensubsystems.patterns.tabbeddialog.www.TabbedDialogTag; 29 30 49 public class DoubleSelectRightHalfTag extends BlockElementTag 50 { 51 53 56 private static final long serialVersionUID = 868273535333714235L; 57 58 61 protected String m_strDoubleselectcssclass; 62 63 66 protected String m_strDoubleselectbuttonscssclass; 67 68 74 protected String m_strFocus; 75 76 85 protected String m_strDisabled; 86 87 90 protected String m_strSize; 91 92 94 97 public DoubleSelectRightHalfTag() 98 { 99 super("clsDialogRowRightHalf", BlockElementTag.DIV_BLOCK_ELEMENT); 100 101 m_strSize = "8"; 102 m_strDoubleselectcssclass = "clsDoubleSelectListColumnRight"; 103 m_strDoubleselectbuttonscssclass = "clsDoubleSelectListButtonColumnRight"; 104 m_strDisabled = Boolean.FALSE.toString(); 105 } 106 107 109 112 public int doStartTag( 113 ) throws JspException 114 { 115 StringBuffer sbHtml = new StringBuffer (); 116 String strCurrentId = getCurrentId(); 119 120 152 153 sbHtml.append("<"); 155 sbHtml.append(m_strType); 156 sbHtml.append(" id=\""); 157 sbHtml.append(strCurrentId); 158 sbHtml.append(m_strId); 159 sbHtml.append("doubleselectrighthalf\" class=\"clsDialogRowRightHalf\">\n"); 160 161 sbHtml.append("<"); 162 sbHtml.append(m_strType); 163 if ((m_strDoubleselectbuttonscssclass != null) 164 && (m_strDoubleselectbuttonscssclass.length() > 0)) 165 { 166 sbHtml.append(" class=\""); 167 sbHtml.append(m_strDoubleselectbuttonscssclass); 168 sbHtml.append("\""); 169 } 170 sbHtml.append(">\n"); 171 sbHtml.append("<div class=\"clsDSButton\"><button style=\"width:100%;\" " + 173 "class=\"clsImageMoveTopTextButton\" type=\"button\" " + 174 "accesskey=\"T\" id=\""); 175 sbHtml.append(strCurrentId); 176 sbHtml.append(m_strId); 177 sbHtml.append("_dstop\" onclick=\"moveSelectedItemsTop('"); 178 sbHtml.append(strCurrentId); 179 sbHtml.append(m_strId); 180 sbHtml.append("doubleselectdestination', '"); 181 sbHtml.append(strCurrentId); 182 sbHtml.append(m_strId); 183 sbHtml.append("_assigned_items');\"><u>T</u>op</button></div>\n"); 184 sbHtml.append("<div class=\"clsDSButton\"><button style=\"width:100%;\" " + 186 "class=\"clsImageMoveOneUpTextButton\" type=\"button\" " + 187 "accesskey=\"U\" id=\""); 188 sbHtml.append(strCurrentId); 189 sbHtml.append(m_strId); 190 sbHtml.append("_dsup\" onclick=\"moveSelectedItemsUp('"); 191 sbHtml.append(strCurrentId); 192 sbHtml.append(m_strId); 193 sbHtml.append("doubleselectdestination', '"); 194 sbHtml.append(strCurrentId); 195 sbHtml.append(m_strId); 196 sbHtml.append("_assigned_items');\"><u>U</u>p</button></div>\n"); 197 sbHtml.append("<div class=\"clsDSButton\"><button style=\"width:100%;\" " + 199 "class=\"clsImageMoveOneDownTextButton\" type=\"button\" " + 200 "accesskey=\"w\" id=\""); 201 sbHtml.append(strCurrentId); 202 sbHtml.append(m_strId); 203 sbHtml.append("_dsdown\" onclick=\"moveSelectedItemsDown('"); 204 sbHtml.append(strCurrentId); 205 sbHtml.append(m_strId); 206 sbHtml.append("doubleselectdestination', '"); 207 sbHtml.append(strCurrentId); 208 sbHtml.append(m_strId); 209 sbHtml.append("_assigned_items');\">Do<u>w</u>n</button></div>\n"); 210 sbHtml.append("<div class=\"clsDSButton\"><button style=\"width:100%;\" " + 212 "class=\"clsImageMoveBottomTextButton\" type=\"button\" " + 213 "accesskey=\"B\" id=\""); 214 sbHtml.append(strCurrentId); 215 sbHtml.append(m_strId); 216 sbHtml.append("_dsbottom\" onclick=\"moveSelectedItemsBottom('"); 217 sbHtml.append(strCurrentId); 218 sbHtml.append(m_strId); 219 sbHtml.append("doubleselectdestination', '"); 220 sbHtml.append(strCurrentId); 221 sbHtml.append(m_strId); 222 sbHtml.append("_assigned_items');\"><u>B</u>ottom</button></div>\n"); 223 224 sbHtml.append("</"); 225 sbHtml.append(m_strType); 226 sbHtml.append(">\n"); 227 228 sbHtml.append("<"); 229 sbHtml.append(m_strType); 230 sbHtml.append(" id=\""); 231 sbHtml.append(strCurrentId); 232 sbHtml.append(m_strId); 233 sbHtml.append("doubleselectrightcolumn\""); 234 if ((m_strDoubleselectcssclass != null) && (m_strDoubleselectcssclass.length() > 0)) 235 { 236 sbHtml.append(" class=\""); 237 sbHtml.append(m_strDoubleselectcssclass); 238 sbHtml.append("\""); 239 } 240 sbHtml.append(">\n"); 241 242 sbHtml.append("<select multiple id=\""); 243 sbHtml.append(strCurrentId); 244 sbHtml.append(m_strId); 245 sbHtml.append("doubleselectdestination\" class=\"clsStretchSingleLineEdit\" size=\""); 246 sbHtml.append(m_strSize); 247 sbHtml.append("\" ondblclick=\"moveBetweenLists('"); 248 sbHtml.append(strCurrentId); 249 sbHtml.append(m_strId); 250 sbHtml.append("', '"); 251 sbHtml.append(strCurrentId); 252 sbHtml.append(m_strId); 253 sbHtml.append("doubleselectdestination', '"); 254 sbHtml.append(strCurrentId); 255 sbHtml.append(m_strId); 256 sbHtml.append("doubleselectsource', false, '"); 257 sbHtml.append(strCurrentId); 258 sbHtml.append(m_strId); 259 sbHtml.append("_assigned_items', true);\" onchange=\"changeDSButtons('"); 260 sbHtml.append(strCurrentId); 261 sbHtml.append(m_strId); 262 sbHtml.append("', '"); 263 sbHtml.append(strCurrentId); 264 sbHtml.append(m_strId); 265 sbHtml.append("doubleselectdestination', '"); 266 sbHtml.append(strCurrentId); 267 sbHtml.append(m_strId); 268 sbHtml.append("doubleselectsource');\""); 269 270 if (isDisabledControl()) 271 { 272 sbHtml.append(" disabled=\"disabled\""); 273 } 274 sbHtml.append(">\n"); 275 276 TagUtils.write(pageContext, sbHtml.toString()); 277 278 if (isFocusedControl()) 279 { 280 285 sbHtml.delete(0, sbHtml.length()); 288 sbHtml.append(strCurrentId); 289 sbHtml.append(m_strId); 290 291 cache(TabbedDialogTag.FOCUSED_CONTROL_ID, sbHtml.toString()); 292 } 293 294 return (EVAL_BODY_INCLUDE); 295 } 296 297 300 public int doEndTag( 301 ) throws JspException 302 { 303 StringBuffer sbHtml = new StringBuffer (); 305 306 sbHtml.append("</select>\n"); 307 sbHtml.append("</"); 308 sbHtml.append(m_strType); 309 sbHtml.append(">\n"); 310 311 sbHtml.append("</"); 312 sbHtml.append(m_strType); 313 sbHtml.append(">"); 314 315 TagUtils.write(pageContext, sbHtml.toString()); 316 317 return (EVAL_PAGE); 318 } 319 320 323 public String getDoubleselectcssclass() 324 { 325 return m_strDoubleselectcssclass; 326 } 327 328 331 public String getDoubleselectbuttonscssclass() 332 { 333 return m_strDoubleselectbuttonscssclass; 334 } 335 336 340 public String getFocus() 341 { 342 return m_strFocus; 343 } 344 345 348 public void setDoubleselectcssclass( 349 String strInputcssclass 350 ) 351 { 352 m_strDoubleselectcssclass = strInputcssclass; 353 } 354 355 359 public void setDoubleselectbuttonscssclass( 360 String strDoubleselectbuttonscssclass 361 ) 362 { 363 m_strDoubleselectbuttonscssclass = strDoubleselectbuttonscssclass; 364 } 365 366 370 public void setFocus( 371 String strFocus 372 ) 373 { 374 m_strFocus = strFocus; 375 } 376 377 381 public void setFocus( 382 boolean bFocus 383 ) 384 { 385 m_strFocus = Boolean.toString(bFocus); 386 } 387 388 392 public boolean isFocusedControl( 393 ) 394 { 395 return ((Boolean.TRUE.toString().equalsIgnoreCase(m_strFocus)) 396 || ("1".equals(m_strFocus))); 397 } 398 399 403 public String getDisabled( 404 ) 405 { 406 return m_strDisabled; 407 } 408 409 413 public void setDisabled( 414 String strDisabled 415 ) 416 { 417 m_strDisabled = strDisabled; 418 } 419 420 424 public void setDisabled( 425 boolean bDisabled 426 ) 427 { 428 m_strDisabled = Boolean.toString(bDisabled); 429 } 430 431 434 public boolean isDisabledControl( 435 ) 436 { 437 return ((Boolean.TRUE.toString().equalsIgnoreCase(m_strDisabled)) 438 || ("1".equals(m_strDisabled))); 439 } 440 441 442 445 public String getSize( 446 ) 447 { 448 return m_strSize; 449 } 450 451 454 public void setSize( 455 String strSize 456 ) 457 { 458 m_strSize = strSize; 459 } 460 } 461 | Popular Tags |