Index: JMeter.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/JMeter.java,v retrieving revision 1.7 diff -u -r1.7 JMeter.java --- JMeter.java 31 Dec 2002 18:05:53 -0000 1.7 +++ JMeter.java 9 Jan 2003 04:51:36 -0000 @@ -192,7 +192,7 @@ */ public void startGui(CLOption testFile) throws IllegalUserActionException, IllegalAccessException, ClassNotFoundException, InstantiationException { - PluginManager.install(this); + PluginManager.install(this, true); JMeterTreeModel treeModel = new JMeterTreeModel(); JMeterTreeListener treeLis = new JMeterTreeListener(treeModel); treeLis.setActionHandler(ActionRouter.getInstance()); @@ -329,7 +329,7 @@ public void startNonGui(CLOption testFile, CLOption logFile) throws IllegalUserActionException, IllegalAccessException, ClassNotFoundException, InstantiationException { JMeter driver = new JMeter(); - PluginManager.install(this); + PluginManager.install(this, false); if (testFile == null) { throw new IllegalUserActionException(); Index: PluginManager.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/plugin/PluginManager.java,v retrieving revision 1.1 diff -u -r1.1 PluginManager.java --- PluginManager.java 31 Dec 2002 18:05:54 -0000 1.1 +++ PluginManager.java 9 Jan 2003 04:52:21 -0000 @@ -61,7 +61,6 @@ import javax.swing.*; import org.apache.jmeter.gui.GUIFactory; -import org.apache.jmeter.util.JMeterUtils; /** @@ -77,34 +76,45 @@ { } - - public static void install(JMeterPlugin plugin) + /** + * Installs a plugin. + * @param plugin The plugin to install. + * @param useGui Indication of whether or not the gui will be used. + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public static void install(JMeterPlugin plugin, boolean useGui) throws ClassNotFoundException, InstantiationException, - IllegalAccessException + IllegalAccessException { - instance.installPlugin(plugin); + if (useGui) + { + instance.installPlugin(plugin); + } } private void installPlugin(JMeterPlugin plugin) throws ClassNotFoundException, InstantiationException, - IllegalAccessException + IllegalAccessException { String[][] icons = plugin.getIconMappings(); ClassLoader classloader = plugin.getClass().getClassLoader(); for (int i = 0; i < icons.length; i++) - { + { URL resource = classloader.getResource(icons[i][1].trim()); if (resource == null) - { + { // todo: log or throw exception } - else - { + else + { GUIFactory.registerIcon(icons[i][0], new ImageIcon(resource)); } } } + }