logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw TableColorizingRenderer.java
Date Tue, 30 Sep 2003 23:19:49 GMT
psmith      2003/09/30 16:19:49

  Modified:    src/java/org/apache/log4j/chainsaw
                        TableColorizingRenderer.java
  Log:
  This renderer can now be configured with a custom
  Date Format object.
  
  Revision  Changes    Path
  1.6       +11 -2     jakarta-log4j/src/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
  
  Index: TableColorizingRenderer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TableColorizingRenderer.java	14 Sep 2003 04:08:16 -0000	1.5
  +++ TableColorizingRenderer.java	30 Sep 2003 23:19:49 -0000	1.6
  @@ -96,7 +96,7 @@
     private final JLabel idComponent = new JLabel();
     private final JLabel levelComponent = new JLabel();
     private String levelDisplay = ChainsawConstants.LEVEL_DISPLAY_ICONS;
  -
  +  private DateFormat dateFormatInUse = DATE_FORMATTER;
     /**
      * Creates a new TableColorizingRenderer object.
      */
  @@ -226,6 +226,15 @@
   
       return c;
     }
  +  
  +  /**
  +   * Changes the Date Formatting object to be used for rendering dates.
  +   * @param formatter
  +   */
  +  void setDateFormatter(DateFormat formatter){
  +  	this.dateFormatInUse = formatter;
  +  }
  +  
   
     /**
      *Format date field
  @@ -238,7 +247,7 @@
       if (!(o instanceof Date)) {
         return o;
       } else {
  -      return DATE_FORMATTER.format((Date) o);
  +      return dateFormatInUse.format((Date) o);
       }
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message