Update of /cvsroot/displaytag/displaytag/src/org/apache/taglibs/display
In directory sc8-pr-cvs1:/tmp/cvs-serv16574/src/org/apache/taglibs/display

Modified Files:
        ColumnTag.java TableTag.java 
Log Message:
Implemented [ 682246 ] wish for titleColSpan attribute for <display:column>.

Index: ColumnTag.java
===================================================================
RCS file: 
/cvsroot/displaytag/displaytag/src/org/apache/taglibs/display/ColumnTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ColumnTag.java      12 Jun 2003 17:22:16 -0000      1.5
--- ColumnTag.java      12 Jun 2003 17:51:57 -0000      1.6
***************
*** 119,123 ****
   *                    appended to the end if this column is linked, and the user
   *                    can mouseover the elipse to get the full text. (optional)
!  * </pre></p>
   */
  public class ColumnTag extends BodyTagSupport implements Cloneable {
--- 119,125 ----
   *                    appended to the end if this column is linked, and the user
   *                    can mouseover the elipse to get the full text. (optional)
!  *
!  *   titleColSpan    - the number of columns that the title should span. Default is 
1.
!  *
   */
  public class ColumnTag extends BodyTagSupport implements Cloneable {
***************
*** 136,139 ****
--- 138,142 ----
      private int maxLength;
      private int maxWords;
+     private int titleColSpan = 1;
  
      private String width;
***************
*** 208,211 ****
--- 211,217 ----
      }
  
+     public void setTitleColSpan(int titleColSpan) {
+         this.titleColSpan = titleColSpan;
+     }
  
      public void setWidth(String v) {
***************
*** 308,311 ****
--- 314,321 ----
      public int getMaxWords() {
          return this.maxWords;
+     }
+ 
+     public int getTitleColSpan() {
+         return titleColSpan;
      }
  

Index: TableTag.java
===================================================================
RCS file: /cvsroot/displaytag/displaytag/src/org/apache/taglibs/display/TableTag.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TableTag.java       12 Jun 2003 17:37:58 -0000      1.9
--- TableTag.java       12 Jun 2003 17:51:57 -0000      1.10
***************
*** 1384,1388 ****
--- 1384,1395 ----
          buf.append("<tr class=\"tableRowHeader\">");
  
+         int titleColumnsToSkip = 0;
+ 
          for (int i = 0; i < this.columns.size(); i++) {
+             if (titleColumnsToSkip > 0) {
+                 titleColumnsToSkip--;
+                 continue;
+             }
+ 
              ColumnTag tag = (ColumnTag) this.columns.get(i);
  
***************
*** 1393,1396 ****
--- 1400,1409 ----
              if (tag.getAlign() != null)
                  buf.append(" align=\"" + tag.getAlign() + "\"");
+ 
+             int span = tag.getTitleColSpan();
+             if (span > 1) {
+                 buf.append(" colspan=\"" + span + "\"");
+                 titleColumnsToSkip = span - 1;
+             }
  
              if (tag.getHeaderStyleClass() != null) {




-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to