1 26 27 package org.objectweb.jonas.webapp.taglib; 28 29 import javax.servlet.jsp.tagext.Tag ; 30 31 public class GridRowTag extends GridTableBaseTag { 32 33 35 private boolean changeStyle = false; 36 37 public boolean isChangeStyle() { 38 return changeStyle; 39 } 40 41 public void setChangeStyle(boolean changeStyle) { 42 this.changeStyle = changeStyle; 43 } 44 45 47 50 public void release() { 51 super.release(); 52 changeStyle = false; 53 } 54 55 57 60 protected String getHtmlElement() { 61 return "tr"; 62 } 63 64 70 protected String prepareStyles() { 71 StringBuffer styles = new StringBuffer (); 72 if (getStyle() != null) { 73 styles.append(" style=\""); 74 styles.append(getStyle()); 75 styles.append("\""); 76 } 77 78 String sClass = getStyleClass(); 80 if (sClass == null) { 81 sClass = getRowClass(); 82 } 83 if (sClass != null) { 85 styles.append(" class=\""); 86 styles.append(sClass); 87 styles.append("\""); 88 } 89 90 if (getStyleId() != null) { 91 styles.append(" id=\""); 92 styles.append(getStyleId()); 93 styles.append("\""); 94 } 95 if (getTitle() != null) { 96 styles.append(" title=\""); 97 styles.append(getTitle()); 98 styles.append("\""); 99 } 100 return styles.toString(); 101 } 102 103 106 protected String getRowClass() { 107 Tag tag = findAncestorWithClass(this, GridTag.class); 109 if (tag == null) { 110 return null; 111 } 112 GridTag oTag = (GridTag) tag; 114 return oTag.getRowStyle(changeStyle); 115 } 116 117 } | Popular Tags |