View Javadoc

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17
    18  package org.apache.log4j.chainsaw;
    19
    20  import java.awt.*;
    21  import java.net.URL;
    22
    23  /**
    24   * Constants used throught Chainsaw.
    25   *
    26   * @author Paul Smith &lt;psmith@apache.org&gt;
    27   * @author Scott Deboy &lt;sdeboy@apache.org&gt;
    28   */
    29  public class ChainsawConstants {
    30      private ChainsawConstants() {
    31      }
    32
    33      public static final int MILLIS_DELTA_RENDERING_HEIGHT_MAX = 50;
    34      public static final float MILLIS_DELTA_RENDERING_FACTOR = .002F;
    35
    36      public static final String DEFAULT_COLOR_RULE_NAME = "Default";
    37      public static final Color COLOR_DEFAULT_BACKGROUND = new Color(255, 255, 255);
    38      public static final Color COLOR_DEFAULT_FOREGROUND = Color.BLACK;
    39
    40      //top, bottom left and right border are all 2
    41      public static final int TABLE_BORDER_WIDTH = 2;
    42      //JTable defines its default height as 16, plus top & bottom borders
    43      public static final int DEFAULT_ROW_HEIGHT = 16 + (TABLE_BORDER_WIDTH * 2);
    44      public static final Color FIND_LOGGER_BACKGROUND = new Color(213, 226, 235);
    45      public static final Color FIND_LOGGER_FOREGROUND = Color.BLACK;
    46
    47      public static final Color INVALID_EXPRESSION_BACKGROUND = new Color(251, 186, 186);
    48
    49      public static final Color COLOR_ODD_ROW_BACKGROUND = new Color(227, 227, 227);
    50      public static final Color COLOR_ODD_ROW_FOREGROUND = Color.BLACK;
    51
    52      public static final Color COLOR_EVEN_ROW_BACKGROUND = COLOR_DEFAULT_BACKGROUND;
    53      public static final Color COLOR_EVEN_ROW_FOREGROUND = Color.BLACK;
    54
    55      public static final URL WELCOME_URL = ChainsawConstants.class.getClassLoader().getResource(
    56          "org/apache/log4j/chainsaw/WelcomePanel.html");
    57
    58      public static final URL EXAMPLE_CONFIG_URL =
    59          ChainsawConstants.class.getClassLoader().getResource("org/apache/log4j/chainsaw/log4j-receiver-sample.xml");
    60
    61      public static final URL TUTORIAL_URL =
    62          ChainsawConstants.class.getClassLoader().getResource("org/apache/log4j/chainsaw/help/tutorial.html");
    63      public static final URL RELEASE_NOTES_URL =
    64          ChainsawConstants.class.getClassLoader().getResource("org/apache/log4j/chainsaw/help/release-notes.html");
    65
    66      static final String MAIN_PANEL = "panel";
    67      static final String LOWER_PANEL = "lower";
    68      static final String UPPER_PANEL = "upper";
    69      static final String EMPTY_STRING = "";
    70      static final String FILTERS_EXTENSION = ".filters";
    71      static final String SETTINGS_EXTENSION = ".settings";
    72
    73      //COLUMN NAMES
    74      static final String LOGGER_COL_NAME = "LOGGER";
    75      static final String LOG4J_MARKER_COL_NAME_LOWERCASE = "marker";
    76      static final String TIMESTAMP_COL_NAME = "TIMESTAMP";
    77      static final String LEVEL_COL_NAME = "LEVEL";
    78      static final String THREAD_COL_NAME = "THREAD";
    79      static final String MESSAGE_COL_NAME = "MESSAGE";
    80      static final String NDC_COL_NAME = "NDC";
    81      static final String THROWABLE_COL_NAME = "THROWABLE";
    82      static final String CLASS_COL_NAME = "CLASS";
    83      static final String METHOD_COL_NAME = "METHOD";
    84      static final String FILE_COL_NAME = "FILE";
    85      static final String LINE_COL_NAME = "LINE";
    86      static final String PROPERTIES_COL_NAME = "PROPERTIES";
    87      static final String MILLIS_DELTA_COL_NAME_LOWERCASE = "millisdelta";
    88      static final String ID_COL_NAME = "ID";
    89
    90      //none is not a real column name, but is used by filters as a way to apply no filter for colors or display
    91      static final String NONE_COL_NAME = "None";
    92      static final String LOG4J_REMOTEHOST_KEY = "log4j.remoteSourceInfo";
    93      static final String UNKNOWN_TAB_NAME = "Unknown";
    94      static final String GLOBAL_MATCH = "*";
    95      public static final String DETAIL_CONTENT_TYPE = "text/html";
    96
    97      static final String LEVEL_DISPLAY = "level.display";
    98      static final String LEVEL_DISPLAY_ICONS = "icons";
    99      static final String LEVEL_DISPLAY_TEXT = "text";
    100
    101
    102     static final String DATETIME_FORMAT = "EEE MMM dd HH:mm:ss z yyyy";
    103
    104     //  TODO come up with a better page not found url
    105     public static final URL URL_PAGE_NOT_FOUND = WELCOME_URL;
    106
    107 }