logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject svn commit: r349199 - /logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java
Date Sun, 27 Nov 2005 10:21:49 GMT
Author: psmith
Date: Sun Nov 27 02:21:39 2005
New Revision: 349199

URL: http://svn.apache.org/viewcvs?rev=349199&view=rev
Log:
Re-ordered the way the plugins are started.  This means that by the time
the plugins' .activateOptions() method is called, the component
has been added to the component tree such that it can detect what
JFrame it belongs to (handy for allowing the plugin
to inject menu's into the main JFrame menu.

Modified:
    logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java

Modified: logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java
URL: http://svn.apache.org/viewcvs/logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java?rev=349199&r1=349198&r2=349199&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java (original)
+++ logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/LogUI.java Sun Nov 27 02:21:39
2005
@@ -474,12 +474,21 @@
     try {
       Class vfsPluginClass = Class.forName("org.apache.log4j.chainsaw.vfs.VFSPlugin");
       Plugin vfsPlugin = (Plugin) vfsPluginClass.newInstance();
-      vfsPlugin.activateOptions();
       pluginRegistry.addPlugin(vfsPlugin);
+      vfsPlugin.activateOptions();
       MessageCenter.getInstance().getLogger().info("Looks like VFS is available... WooHoo!");
     } catch (Throwable e) {
       MessageCenter.getInstance().getLogger().error("Doesn't look like VFS is available",
e);
     }
+    try {
+        Class pluginClass = Class.forName("org.apache.log4j.chainsaw.zeroconf.ZeroConfPlugin");
+        Plugin plugin = (Plugin) pluginClass.newInstance();
+        pluginRegistry.addPlugin(plugin);
+        plugin.activateOptions();
+        MessageCenter.getInstance().getLogger().info("Looks like ZeroConf stuff is available...
WooHoo!");
+    } catch (Throwable e) {
+        MessageCenter.getInstance().getLogger().error("Doesn't look like ZeroConf is available",
e);
+    }
   }
 
   private void setupReceiverPanel() {
@@ -712,7 +721,6 @@
 
     panePanel.add(getTabbedPane());
     addWelcomePanel();
-    initPlugins(pluginRegistry);
 
     getContentPane().add(toolbar, BorderLayout.NORTH);
     getContentPane().add(statusBar, BorderLayout.SOUTH);
@@ -722,6 +730,13 @@
     mainReceiverSplitPane.setDividerLocation(-1);
 
     getContentPane().add(mainReceiverSplitPane, BorderLayout.CENTER);
+
+    /**
+     * We need to make sure that all the internal GUI components have been added to the
+     * JFrame so that any plugns that get activated during initPlugins(...) method
+     * have access to inject menus  
+     */
+    initPlugins(pluginRegistry);
 
     mainReceiverSplitPane.setResizeWeight(1.0);
     addWindowListener(



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


Mime
View raw message