psmith 2003/12/18 22:50:57
Modified: src/java/org/apache/log4j/chainsaw WelcomePanel.java
ChainsawConstants.java
Log:
Moved out some constants into the Constants class.
Revision Changes Path
1.7 +6 -20
jakarta-log4j/src/java/org/apache/log4j/chainsaw/WelcomePanel.java
Index: WelcomePanel.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/WelcomePanel.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WelcomePanel.java 9 Nov 2003 09:59:28 -0000 1.6
+++ WelcomePanel.java 19 Dec 2003 06:50:57 -0000 1.7
@@ -77,9 +77,8 @@
/**
- * An initial Welcome Panel that is used when Chainsaw starts up, displays
- * a HTML page that should be located in the current Classloaders classpath
- * providing some useful tips on startup.
+ * An initial Welcome Panel that is used when Chainsaw starts up, can displays
+ * a HTML pages based on URLs.
*
* @author Paul Smith
* @author Scott Deboy <[EMAIL PROTECTED]>
@@ -88,9 +87,6 @@
private Stack urlStack = new Stack();
private final JEditorPane textInfo = new JEditorPane();
private final URLToolbar urlToolbar = new URLToolbar();
- private final URL helpURL;
- private final URL exampleConfigURL;
- private final URL tutorialURL;
private LogUI logui;
public WelcomePanel(LogUI logui) {
@@ -99,17 +95,7 @@
setBackground(Color.white);
add(urlToolbar, BorderLayout.NORTH);
- helpURL =
- getClass().getClassLoader().getResource(
- "org/apache/log4j/chainsaw/WelcomePanel.html");
-
- exampleConfigURL =
- getClass().getClassLoader().getResource(
- "org/apache/log4j/chainsaw/log4j-receiver-sample.xml");
-
- tutorialURL =
- getClass().getClassLoader().getResource(
- "org/apache/log4j/chainsaw/help/tutorial.html");
+ URL helpURL = ChainsawConstants.WELCOME_URL;
if (helpURL != null) {
textInfo.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
@@ -162,7 +148,7 @@
* @return
*/
public final URL getTutorialURL() {
- return tutorialURL;
+ return ChainsawConstants.TUTORIAL_URL;
}
private class URLToolbar extends JToolBar {
@@ -180,7 +166,7 @@
private final Action homeAction =
new AbstractAction(null, new ImageIcon(ChainsawIcons.ICON_HOME)) {
public void actionPerformed(ActionEvent e) {
- setURL(helpURL);
+ setURL(ChainsawConstants.WELCOME_URL);
urlStack.clear();
}
};
@@ -213,7 +199,7 @@
final Action exampleConfigAction =
new AbstractAction("View example Receiver configuration") {
public void actionPerformed(ActionEvent e) {
- setURL(exampleConfigURL);
+ setURL(ChainsawConstants.EXAMLE_CONFIG_URL);
}
};
1.6 +63 -2
jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawConstants.java
Index: ChainsawConstants.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawConstants.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ChainsawConstants.java 10 Dec 2003 21:35:06 -0000 1.5
+++ ChainsawConstants.java 19 Dec 2003 06:50:57 -0000 1.6
@@ -1,16 +1,77 @@
/*
- * @author Paul Smith <[EMAIL PROTECTED]>
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "log4j" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
*
-*/
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation. For more information on the
+ * Apache Software Foundation, please see <http://www.apache.org/>.
+ *
+ */
+
package org.apache.log4j.chainsaw;
+import java.net.URL;
+
/**
+ *
+ * Constants used throught Chainsaw.
+ *
* @author Paul Smith <[EMAIL PROTECTED]>
* @author Scott Deboy <[EMAIL PROTECTED]>
*
*/
public class ChainsawConstants {
private ChainsawConstants(){}
+
+ public static final URL WELCOME_URL =
ChainsawConstants.class.getClassLoader().getResource(
+ "org/apache/log4j/chainsaw/WelcomePanel.html");
+
+ public static final URL EXAMLE_CONFIG_URL =
+ ChainsawConstants.class.getClassLoader().getResource(
+ "org/apache/log4j/chainsaw/log4j-receiver-sample.xml");
+
+ public static final URL TUTORIAL_URL =
+ ChainsawConstants.class.getClassLoader().getResource(
+ "org/apache/log4j/chainsaw/help/tutorial.html");
static final String MAIN_PANEL = "panel";
static final String LOWER_PANEL = "lower";
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]