You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by sd...@apache.org on 2004/05/13 08:16:50 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw LogPanel.java LogUI.java ChainsawAbout.java

sdeboy      2004/05/12 23:16:50

  Modified:    src/java/org/apache/log4j/chainsaw LogPanel.java LogUI.java
                        ChainsawAbout.java
  Log:
  - updated hide/show column logic that wasn't working correctly when columns are added dynamically (properties)
  - (no ability yet to hide dynamically added columns)
  - added attribution to Oliver Burn in the help-about box
  
  Revision  Changes    Path
  1.71      +19 -9     logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java
  
  Index: LogPanel.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- LogPanel.java	12 May 2004 06:37:30 -0000	1.70
  +++ LogPanel.java	13 May 2004 06:16:50 -0000	1.71
  @@ -216,6 +216,10 @@
     private final JPanel findPanel;
     private JTextField findField;
     private int dividerSize;
  +  static final String TABLE_COLUMN_ORDER = "table.columns.order";
  +  static final String TABLE_COLUMN_WIDTHS = "table.columns.widths";
  +  static final String COLUMNS_EXTENSION = ".columns";
  +  static final String COLORS_EXTENSION = ".colors";
   
     /**
      * Creates a new LogPanel object.  If a LogPanel with this identifier has
  @@ -448,6 +452,7 @@
   
             while (enumeration.hasMoreElements()) {
               TableColumn column = (TableColumn) enumeration.nextElement();
  +
               columnSet.add(column.getHeaderValue());
             }
   
  @@ -790,7 +795,9 @@
       tableModel.addNewKeyListener(
         new NewKeyListener() {
           public void newKeyAdded(NewKeyEvent e) {
  -          table.addColumn(new TableColumn(e.getNewModelIndex()));
  +          TableColumn col = new TableColumn(e.getNewModelIndex());
  +          col.setHeaderValue(e.getKey());
  +          table.addColumn(col);
           }
         });
   
  @@ -1341,7 +1348,7 @@
       File f =
         new File(
           SettingsManager.getInstance().getSettingsDirectory() + File.separator
  -        + identifier + LogUI.COLUMNS_EXTENSION);
  +        + identifier + COLUMNS_EXTENSION);
   
       if (f.exists()) {
         loadColumnSettings();
  @@ -1352,7 +1359,7 @@
       File f2 =
         new File(
           SettingsManager.getInstance().getSettingsDirectory() + File.separator
  -        + identifier + LogUI.COLORS_EXTENSION);
  +        + identifier + COLORS_EXTENSION);
   
       if (f2.exists()) {
         loadColorSettings();
  @@ -1940,7 +1947,7 @@
         File f =
           new File(
             SettingsManager.getInstance().getSettingsDirectory()
  -          + File.separator + getIdentifier() + LogUI.COLUMNS_EXTENSION);
  +          + File.separator + getIdentifier() + COLUMNS_EXTENSION);
         o = new ObjectOutputStream(
             new BufferedOutputStream(new FileOutputStream(f)));
   
  @@ -1986,7 +1993,7 @@
         File f =
           new File(
             SettingsManager.getInstance().getSettingsDirectory()
  -          + File.separator + getIdentifier() + LogUI.COLORS_EXTENSION);
  +          + File.separator + getIdentifier() + COLORS_EXTENSION);
         o = new ObjectOutputStream(
             new BufferedOutputStream(new FileOutputStream(f)));
   
  @@ -2014,7 +2021,7 @@
       File f =
         new File(
           SettingsManager.getInstance().getSettingsDirectory() + File.separator
  -        + identifier + LogUI.COLUMNS_EXTENSION);
  +        + identifier + COLUMNS_EXTENSION);
   
       if (f.exists()) {
         ArrayList newColumns = new ArrayList();
  @@ -2071,7 +2078,7 @@
      * @param event
      */
     private void loadDefaultColumnSettings(LoadSettingsEvent event) {
  -    String columnOrder = event.getSetting(LogUI.TABLE_COLUMN_ORDER);
  +    String columnOrder = event.getSetting(TABLE_COLUMN_ORDER);
   
       TableColumnModel columnModel = table.getColumnModel();
   
  @@ -2106,7 +2113,7 @@
         table.addColumn(element);
       }
   
  -    String columnWidths = event.getSetting(LogUI.TABLE_COLUMN_WIDTHS);
  +    String columnWidths = event.getSetting(TABLE_COLUMN_WIDTHS);
   
       tok = new StringTokenizer(columnWidths, ",");
       index = 0;
  @@ -2150,7 +2157,7 @@
       File f =
         new File(
           SettingsManager.getInstance().getSettingsDirectory() + File.separator
  -        + identifier + LogUI.COLORS_EXTENSION);
  +        + identifier + COLORS_EXTENSION);
   
       if (f.exists()) {
         ObjectInputStream s = null;
  @@ -2477,6 +2484,9 @@
           if (
             (column.getModelIndex() + 1) == ChainsawColumns.INDEX_THROWABLE_COL_NAME) {
             column.setCellEditor(throwableRenderPanel);
  +        }
  +        if (column.getModelIndex() > 0) {
  +            preferenceModel.setColumnVisible(column.getHeaderValue().toString(), true);
           }
         }
       }
  
  
  
  1.91      +0 -4      logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- LogUI.java	12 May 2004 15:39:03 -0000	1.90
  +++ LogUI.java	13 May 2004 06:16:50 -0000	1.91
  @@ -127,10 +127,6 @@
     private static final String MAIN_WINDOW_WIDTH = "main.window.width";
     private static final String MAIN_WINDOW_Y = "main.window.y";
     private static final String MAIN_WINDOW_X = "main.window.x";
  -  static final String TABLE_COLUMN_ORDER = "table.columns.order";
  -  static final String TABLE_COLUMN_WIDTHS = "table.columns.widths";
  -  static final String COLUMNS_EXTENSION = ".columns";
  -  static final String COLORS_EXTENSION = ".colors";
     private static ChainsawSplash splash;
     private static final double DEFAULT_MAIN_RECEIVER_SPLIT_LOCATION = .8d;
     private final JFrame preferencesFrame = new JFrame();
  
  
  
  1.4       +1 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAbout.java
  
  Index: ChainsawAbout.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAbout.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChainsawAbout.java	3 May 2004 08:00:48 -0000	1.3
  +++ ChainsawAbout.java	13 May 2004 06:16:50 -0000	1.4
  @@ -66,7 +66,7 @@
       final JLabel info =
         new JLabel("<html>Chainsaw 2.0alpha<p><p>" +
        "Brought to you by the Log4J team:<p>" +
        "<b>http://logging.apache.org/log4j</b><p><p>" +
         "Bug report, mailing list and wiki information:<p>" +
      "<b>http://logging.apache.org/site/bugreport.html</b><p><p>" +
  -      "<b>Contributors:</b><ul><li>Scott Deboy &lt;sdeboy@apache.org&gt;</li><li>Paul Smith &lt;psmith@apache.org&gt;</li><li>Ceki G&uuml;lc&uuml; &lt;ceki@apache.org&gt;</li></ul></html>");
  +      "<b>Contributors:</b><ul><li>Scott Deboy &lt;sdeboy@apache.org&gt;</li><li>Paul Smith &lt;psmith@apache.org&gt;</li><li>Ceki G&uuml;lc&uuml; &lt;ceki@apache.org&gt;</li><li>Oliver Burn</li></ul></html>");
   
         JButton button = new JButton("Copy bug report link to clipboard");
         button.addActionListener(new ActionListener() {
  
  
  

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