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 DoubleSelectLeftHalfTag extends BlockElementTag 50 { 51 53 56 private static final long serialVersionUID = 6079284091799337577L; 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 DoubleSelectLeftHalfTag() 98 { 99 super("clsDialogRowLeftHalf", BlockElementTag.DIV_BLOCK_ELEMENT); 100 101 m_strSize = "8"; 102 m_strDoubleselectcssclass = "clsDoubleSelectListColumnLeft"; 103 m_strDoubleselectbuttonscssclass = "clsDoubleSelectListButtonColumnLeft"; 104 m_strDisabled = Boolean.FALSE.toString(); 105 } 106 107 109 112 public int doStartTag( 113 ) throws JspException 114 { 115 StringBuffer sbHtml = new StringBuffer (); 116 117 String strCurrentId = getCurrentId(); 120 121 153 154 sbHtml.append("<"); 156 sbHtml.append(m_strType); 157 sbHtml.append(" id=\""); 158 sbHtml.append(strCurrentId); 159 sbHtml.append(m_strId); 160 sbHtml.append("doubleselectlefthalf\" class=\"clsDialogRowLeftHalf\">\n"); 161 162 sbHtml.append("<"); 163 sbHtml.append(m_strType); 164 if ((m_strDoubleselectbuttonscssclass != null) 165 && (m_strDoubleselectbuttonscssclass.length() > 0)) 166 { 167 sbHtml.append(" class=\""); 168 sbHtml.append(m_strDoubleselectbuttonscssclass); 169 sbHtml.append("\""); 170 } 171 sbHtml.append(">\n"); 172 sbHtml.append("<div><button class=\"clsImageRightTextButton\"" + 174 " type=\"button\" accesskey=\"A\" id=\""); 175 sbHtml.append(strCurrentId); 176 sbHtml.append(m_strId); 177 sbHtml.append("_dsadd\" onclick=\"moveBetweenLists('"); 178 sbHtml.append(strCurrentId); 179 sbHtml.append(m_strId); 180 sbHtml.append("', '"); 181 sbHtml.append(strCurrentId); 182 sbHtml.append(m_strId); 183 sbHtml.append("doubleselectsource', '"); 184 sbHtml.append(strCurrentId); 185 sbHtml.append(m_strId); 186 sbHtml.append("doubleselectdestination', false, '"); 187 sbHtml.append(strCurrentId); 188 sbHtml.append(m_strId); 189 sbHtml.append("_assigned_items', false);\"><u>A</u>dd</button></div>\n"); 190 sbHtml.append("<div><button class=\"clsImageMoveRightAllTextButton\" type=\"button\"" + 192 " accesskey=\"l\" id=\""); 193 sbHtml.append(strCurrentId); 194 sbHtml.append(m_strId); 195 sbHtml.append("_dsaddall\" onclick=\"moveBetweenLists('"); 196 sbHtml.append(strCurrentId); 197 sbHtml.append(m_strId); 198 sbHtml.append("', '"); 199 sbHtml.append(strCurrentId); 200 sbHtml.append(m_strId); 201 sbHtml.append("doubleselectsource', '"); 202 sbHtml.append(strCurrentId); 203 sbHtml.append(m_strId); 204 sbHtml.append("doubleselectdestination', true, '"); 205 sbHtml.append(strCurrentId); 206 sbHtml.append(m_strId); 207 sbHtml.append("_assigned_items', false);\">Add a<u>l</u>l</button></div>\n"); 208 sbHtml.append("<div><button class=\"clsImageLeftTextButton\" type=\"button\"" + 210 " accesskey=\"m\" id=\""); 211 sbHtml.append(strCurrentId); 212 sbHtml.append(m_strId); 213 sbHtml.append("_dsremove\" onclick=\"moveBetweenLists('"); 214 sbHtml.append(strCurrentId); 215 sbHtml.append(m_strId); 216 sbHtml.append("', '"); 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("doubleselectsource', false, '"); 223 sbHtml.append(strCurrentId); 224 sbHtml.append(m_strId); 225 sbHtml.append("_assigned_items', true);\">Re<u>m</u>ove</button></div>\n"); 226 sbHtml.append("<div><button class=\"clsImageMoveLeftAllTextButton\" type=\"button\"" + 228 " accesskey=\"v\" id=\""); 229 sbHtml.append(strCurrentId); 230 sbHtml.append(m_strId); 231 sbHtml.append("_dsremoveall\" onclick=\"moveBetweenLists('"); 232 sbHtml.append(strCurrentId); 233 sbHtml.append(m_strId); 234 sbHtml.append("', '"); 235 sbHtml.append(strCurrentId); 236 sbHtml.append(m_strId); 237 sbHtml.append("doubleselectdestination', '"); 238 sbHtml.append(strCurrentId); 239 sbHtml.append(m_strId); 240 sbHtml.append("doubleselectsource', true, '"); 241 sbHtml.append(strCurrentId); 242 sbHtml.append(m_strId); 243 sbHtml.append("_assigned_items', true);\">Remo<u>v</u>e all</button></div>\n"); 244 245 sbHtml.append("</"); 246 sbHtml.append(m_strType); 247 sbHtml.append(">\n"); 248 249 sbHtml.append("<"); 250 sbHtml.append(m_strType); 251 sbHtml.append(" id=\""); 252 sbHtml.append(strCurrentId); 253 sbHtml.append(m_strId); 254 sbHtml.append("doubleselectleftcolumn\""); 255 if ((m_strDoubleselectcssclass != null) && (m_strDoubleselectcssclass.length() > 0)) 256 { 257 sbHtml.append(" class=\""); 258 sbHtml.append(m_strDoubleselectcssclass); 259 sbHtml.append("\""); 260 } 261 sbHtml.append(">\n"); 262 263 sbHtml.append("<select multiple id=\""); 264 sbHtml.append(strCurrentId); 265 sbHtml.append(m_strId); 266 sbHtml.append("doubleselectsource\" class=\"clsStretchSingleLineEdit\" size=\""); 267 sbHtml.append(m_strSize); 268 sbHtml.append("\" ondblclick=\"moveBetweenLists('"); 269 sbHtml.append(strCurrentId); 270 sbHtml.append(m_strId); 271 sbHtml.append("', '"); 272 sbHtml.append(strCurrentId); 273 sbHtml.append(m_strId); 274 sbHtml.append("doubleselectsource', '"); 275 sbHtml.append(strCurrentId); 276 sbHtml.append(m_strId); 277 sbHtml.append("doubleselectdestination', false, '"); 278 sbHtml.append(strCurrentId); 279 sbHtml.append(m_strId); 280 sbHtml.append("_assigned_items', false);\" onchange=\"changeDSButtons('"); 281 sbHtml.append(strCurrentId); 282 sbHtml.append(m_strId); 283 sbHtml.append("','"); 284 sbHtml.append(strCurrentId); 285 sbHtml.append(m_strId); 286 sbHtml.append("doubleselectsource', '"); 287 sbHtml.append(strCurrentId); 288 sbHtml.append(m_strId); 289 sbHtml.append("doubleselectdestination');\""); 290 291 if (isDisabledControl()) 292 { 293 sbHtml.append(" disabled=\"disabled\""); 294 } 295 sbHtml.append(">\n"); 296 297 TagUtils.write(pageContext, sbHtml.toString()); 298 299 if (isFocusedControl()) 300 { 301 306 sbHtml.delete(0, sbHtml.length()); 309 sbHtml.append(strCurrentId); 310 sbHtml.append(m_strId); 311 312 cache(TabbedDialogTag.FOCUSED_CONTROL_ID, sbHtml.toString()); 313 } 314 315 return (EVAL_BODY_INCLUDE); 316 } 317 318 321 public int doEndTag( 322 ) throws JspException 323 { 324 StringBuffer sbHtml = new StringBuffer (); 326 327 sbHtml.append("</select>\n"); 328 sbHtml.append("</"); 329 sbHtml.append(m_strType); 330 sbHtml.append(">\n"); 331 332 333 sbHtml.append("</"); 334 sbHtml.append(m_strType); 335 sbHtml.append(">"); 336 337 TagUtils.write(pageContext, sbHtml.toString()); 338 339 return (EVAL_PAGE); 340 } 341 342 345 public String getDoubleselectcssclass() 346 { 347 return m_strDoubleselectcssclass; 348 } 349 350 353 public String getDoubleselectbuttonscssclass() 354 { 355 return m_strDoubleselectbuttonscssclass; 356 } 357 358 362 public String getFocus() 363 { 364 return m_strFocus; 365 } 366 367 370 public void setDoubleselectcssclass( 371 String strDoubleselectcssclass 372 ) 373 { 374 m_strDoubleselectcssclass = strDoubleselectcssclass; 375 } 376 377 381 public void setDoubleselectbuttonscssclass( 382 String strDoubleselectbuttonscssclass 383 ) 384 { 385 m_strDoubleselectbuttonscssclass = strDoubleselectbuttonscssclass; 386 } 387 388 392 public void setFocus( 393 String strFocus 394 ) 395 { 396 m_strFocus = strFocus; 397 } 398 399 403 public void setFocus( 404 boolean bFocus 405 ) 406 { 407 m_strFocus = Boolean.toString(bFocus); 408 } 409 410 414 public boolean isFocusedControl( 415 ) 416 { 417 return ((Boolean.TRUE.toString().equalsIgnoreCase(m_strFocus)) 418 || ("1".equals(m_strFocus))); 419 } 420 421 425 public String getDisabled( 426 ) 427 { 428 return m_strDisabled; 429 } 430 431 435 public void setDisabled( 436 String strDisabled 437 ) 438 { 439 m_strDisabled = strDisabled; 440 } 441 442 446 public void setDisabled( 447 boolean bDisabled 448 ) 449 { 450 m_strDisabled = Boolean.toString(bDisabled); 451 } 452 453 456 public boolean isDisabledControl( 457 ) 458 { 459 return ((Boolean.TRUE.toString().equalsIgnoreCase(m_strDisabled)) 460 || ("1".equals(m_strDisabled))); 461 } 462 463 466 public String getSize( 467 ) 468 { 469 return m_strSize; 470 } 471 472 475 public void setSize( 476 String strSize 477 ) 478 { 479 m_strSize = strSize; 480 } 481 } 482 | Popular Tags |