[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jmeter-dev
Subject:    cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui ProxyControlG
From:       jsalvata () apache ! org
Date:       2002-12-31 18:05:54
[Download RAW message or body]

jsalvata    2002/12/31 10:05:54

  Modified:    .        .cvsignore
               bin      jmeter.properties
               lib      .cvsignore
               src/core/org/apache/jmeter JMeter.java
               src/core/org/apache/jmeter/control/gui WorkBenchGui.java
               src/core/org/apache/jmeter/gui
                        AbstractJMeterGuiComponent.java
                        JMeterGUIComponent.java MainFrame.java
                        NamePanel.java
               src/core/org/apache/jmeter/gui/action AddParent.java
                        AddToTree.java
               src/core/org/apache/jmeter/gui/tree JMeterCellRenderer.java
                        JMeterTreeModel.java JMeterTreeNode.java
               src/core/org/apache/jmeter/threads/gui ThreadGroupGui.java
               src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui
                        ProxyControlGui.java
  Added:       bin      .cvsignore
               src/core/org/apache/jmeter/gui GUIFactory.java
               src/core/org/apache/jmeter/plugin JMeterPlugin.java
                        PluginManager.java
  Removed:     src/core/org/apache/jmeter/gui GuiFactory.java
  Log:
  Show icons in testplan tree.
  
  Revision  Changes    Path
  1.5       +3 -1      jakarta-jmeter/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/.cvsignore,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- .cvsignore	29 Dec 2002 16:59:41 -0000	1.4
  +++ .cvsignore	31 Dec 2002 18:05:53 -0000	1.5
  @@ -1,2 +1,4 @@
   velocity.log
  -bin/classes
  +build
  +jmeter.log
  +docs
  
  
  
  1.51      +8 -8      jakarta-jmeter/bin/jmeter.properties
  
  Index: jmeter.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/bin/jmeter.properties,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- jmeter.properties	30 Dec 2002 05:08:28 -0000	1.50
  +++ jmeter.properties	31 Dec 2002 18:05:53 -0000	1.51
  @@ -51,14 +51,14 @@
   #  Windows = com.sun.java.swing.plaf.windows.WindowsLookAndFeel
   jmeter.laf=javax.swing.plaf.metal.MetalLookAndFeel
   
  -#icons
  -timer.tree.icon=timer.gif
  -listener.tree.icon=ear.gif
  -bench.tree.icon=clipboard.gif
  -thread.tree.icon=thread.gif
  -control.tree.icon=knob.gif
  -plan.tree.icon=beaker.gif
  -config.tree.icon=leafnode.gif
  +#icons -> moved to program code
  +#timer.tree.icon=timer.gif
  +#listener.tree.icon=ear.gif
  +#bench.tree.icon=clipboard.gif
  +#thread.tree.icon=thread.gif
  +#control.tree.icon=knob.gif
  +#plan.tree.icon=beaker.gif
  +#config.tree.icon=leafnode.gif
   
   # Remote Hosts - comma delimited
   remote_hosts=127.0.0.1
  
  
  
  1.1                  jakarta-jmeter/bin/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  ApacheJMeter.jar
  HTTPSamplerFullTestFile.txt
  jmeter.log
  testresults.txt
  
  
  
  1.3       +8 -1      jakarta-jmeter/lib/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/lib/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore	29 Dec 2002 18:05:19 -0000	1.2
  +++ .cvsignore	31 Dec 2002 18:05:53 -0000	1.3
  @@ -1,3 +1,10 @@
   ext
  -ext/*
   jorphan.jar
  +activation.jar
  +iaik_jce.jar
  +imap.jar
  +mail.jar
  +mailapi.jar
  +pop3.jar
  +smtp.jar
  +w3c_http.jar
  
  
  
  1.7       +46 -4     jakarta-jmeter/src/core/org/apache/jmeter/JMeter.java
  
  Index: JMeter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/JMeter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JMeter.java	17 Oct 2002 19:47:15 -0000	1.6
  +++ JMeter.java	31 Dec 2002 18:05:53 -0000	1.7
  @@ -77,6 +77,18 @@
   import org.apache.jmeter.save.SaveService;
   import org.apache.jmeter.testelement.TestListener;
   import org.apache.jmeter.util.JMeterUtils;
  +import org.apache.jmeter.plugin.JMeterPlugin;
  +import org.apache.jmeter.plugin.PluginManager;
  +import org.apache.jmeter.control.gui.TestPlanGui;
  +import org.apache.jmeter.control.gui.AbstractControllerGui;
  +import org.apache.jmeter.control.gui.WorkBenchGui;
  +import org.apache.jmeter.threads.gui.ThreadGroupGui;
  +import org.apache.jmeter.timers.gui.AbstractTimerGui;
  +import org.apache.jmeter.visualizers.gui.AbstractVisualizer;
  +import org.apache.jmeter.config.gui.AbstractModifierGui;
  +import org.apache.jmeter.config.gui.AbstractConfigGui;
  +import org.apache.jmeter.config.gui.AbstractResponseBasedModifierGui;
  +import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
   import org.apache.log.Hierarchy;
   import org.apache.log.Logger;
   import org.apache.jorphan.collections.HashTree;
  @@ -88,7 +100,7 @@
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    */
  -public class JMeter {
  +public class JMeter implements JMeterPlugin {
   	transient private static Logger log = \
Hierarchy.getDefaultHierarchy().getLoggerFor(  "jmeter");
   
  @@ -178,8 +190,9 @@
   	/**
   	 * Starts up JMeter in GUI mode
   	 */
  -	public void startGui(CLOption testFile) throws IllegalUserActionException {
  +	public void startGui(CLOption testFile) throws IllegalUserActionException, \
IllegalAccessException, ClassNotFoundException, InstantiationException {  
  +        PluginManager.install(this);
   		JMeterTreeModel treeModel = new JMeterTreeModel();
   		JMeterTreeListener treeLis = new JMeterTreeListener(treeModel);
   		treeLis.setActionHandler(ActionRouter.getInstance());
  @@ -244,7 +257,11 @@
   			System.out.println(e.getMessage());
   			System.out.println("Incorrect Usage");
   			System.out.println(CLUtil.describeOptions(options).toString());
  -		}
  +		} catch (Exception e) {
  +            e.printStackTrace();
  +            System.out.println("An error occurred: " + e.getMessage());
  +            System.exit(-1);
  +        }
   	}
   
   	/**
  @@ -310,8 +327,10 @@
   	}
   
   	public void startNonGui(CLOption testFile, CLOption logFile)
  -		throws IllegalUserActionException {
  +		throws IllegalUserActionException, IllegalAccessException, \
ClassNotFoundException, InstantiationException {  JMeter driver = new JMeter();
  +        PluginManager.install(this);
  +
   		if (testFile == null) {
   			throw new IllegalUserActionException();
   		}
  @@ -397,4 +416,27 @@
   	private static void println(String str) {
   		System.out.println(str);
   	}
  +
  +
  +    public String[][] getIconMappings()
  +    {
  +        return new String[][] {
  +            { TestPlanGui.class.getName(), "org/apache/jmeter/images/beaker.gif"},
  +            { AbstractTimerGui.class.getName(), \
"org/apache/jmeter/images/timer.gif"},  +            { \
ThreadGroupGui.class.getName(), "org/apache/jmeter/images/thread.gif"},  +            \
{ AbstractVisualizer.class.getName(), "org/apache/jmeter/images/meter.png"},  +       \
{ AbstractConfigGui.class.getName(), "org/apache/jmeter/images/testtubes.png"},  +    \
{ AbstractModifierGui.class.getName(), "org/apache/jmeter/images/testtubes.gif"},  +  \
{ AbstractResponseBasedModifierGui.class.getName(), \
"org/apache/jmeter/images/testtubes.gif"},  +            { \
AbstractControllerGui.class.getName(), "org/apache/jmeter/images/knob.gif"},  +       \
{ WorkBenchGui.class.getName(), "org/apache/jmeter/images/clipboard.gif"},  +         \
{ AbstractSamplerGui.class.getName(), "org/apache/jmeter/images/pipet.png"}  +        \
};  +    }
  +
  +
  +    public String[][] getResourceBundles()
  +    {
  +        return new String[0][];
  +    }
   }
  
  
  
  1.4       +14 -4     \
jakarta-jmeter/src/core/org/apache/jmeter/control/gui/WorkBenchGui.java  
  Index: WorkBenchGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/control/gui/WorkBenchGui.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WorkBenchGui.java	17 Oct 2002 19:47:15 -0000	1.3
  +++ WorkBenchGui.java	31 Dec 2002 18:05:54 -0000	1.4
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -65,6 +65,7 @@
   
   import org.apache.jmeter.gui.JMeterGUIComponent;
   import org.apache.jmeter.gui.NamePanel;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   import org.apache.jmeter.gui.util.MenuFactory;
   import org.apache.jmeter.testelement.TestElement;
   import org.apache.jmeter.testelement.WorkBench;
  @@ -81,9 +82,11 @@
   
   public class WorkBenchGui extends JPanel implements JMeterGUIComponent
   {
  -	NamePanel namePanel;
  +    NamePanel namePanel;
  +    private JMeterTreeNode node;
   
  -	/****************************************
  +
  +        /****************************************
   	 * !ToDo (Constructor description)
   	 ***************************************/
   	public WorkBenchGui()
  @@ -199,4 +202,11 @@
   
   		this.add(mainPanel);
   	}
  +
  +
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        this.node = node;
  +        namePanel.setNode(node);
  +    }
   }
  
  
  
  1.3       +76 -7     \
jakarta-jmeter/src/core/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java  
  Index: AbstractJMeterGuiComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractJMeterGuiComponent.java	19 Aug 2002 22:33:13 -0000	1.2
  +++ AbstractJMeterGuiComponent.java	31 Dec 2002 18:05:54 -0000	1.3
  @@ -1,3 +1,58 @@
  +/*
  + * ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, 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 "Apache" and "Apache Software Foundation" and
  + * "Apache JMeter" must not be used to endorse or promote products
  + * derived from this software without prior written permission. For
  + * written permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + * "Apache JMeter", 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 (INCLUDING, 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.jmeter.gui;
   
   import java.util.Collection;
  @@ -5,6 +60,7 @@
   import javax.swing.JPanel;
   import javax.swing.JPopupMenu;
   import org.apache.jmeter.testelement.TestElement;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   
   /**
    * @author mstover
  @@ -15,10 +71,12 @@
   public abstract class AbstractJMeterGuiComponent
   	extends JPanel
   	implements JMeterGUIComponent {
  -		
  -		private boolean enabled = true;
   
  -	public AbstractJMeterGuiComponent() {
  +    private boolean enabled = true;
  +    private JMeterTreeNode node;
  +
  +
  +        public AbstractJMeterGuiComponent() {
   		namePanel = new NamePanel();
   		setName(getStaticLabel());
   	}
  @@ -29,12 +87,12 @@
   	public void setName(String name) {
   		namePanel.setName(name);
   	}
  -	
  +
   	public boolean isEnabled()
   	{
   		return enabled;
   	}
  -	
  +
   	public void setEnabled(boolean e)
   	{
   		enabled = e;
  @@ -52,7 +110,7 @@
   	}
   
   	protected NamePanel namePanel;
  -	
  +
   	/****************************************
   	 * !ToDo (Method description)
   	 *
  @@ -71,4 +129,15 @@
   	}
   
   
  -}
  \ No newline at end of file
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        this.node = node;
  +        getNamePanel().setNode(node);
  +    }
  +
  +
  +    protected JMeterTreeNode getNode()
  +    {
  +        return node;
  +    }
  +}
  
  
  
  1.3       +62 -3     \
jakarta-jmeter/src/core/org/apache/jmeter/gui/JMeterGUIComponent.java  
  Index: JMeterGUIComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/JMeterGUIComponent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JMeterGUIComponent.java	19 Aug 2002 22:33:13 -0000	1.2
  +++ JMeterGUIComponent.java	31 Dec 2002 18:05:54 -0000	1.3
  @@ -1,7 +1,63 @@
  +/*
  + * ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, 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 "Apache" and "Apache Software Foundation" and
  + * "Apache JMeter" must not be used to endorse or promote products
  + * derived from this software without prior written permission. For
  + * written permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + * "Apache JMeter", 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 (INCLUDING, 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.jmeter.gui;
   import java.util.Collection;
   import javax.swing.JPopupMenu;
   import org.apache.jmeter.testelement.TestElement;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   /****************************************
    * <p>
    *
  @@ -48,13 +104,13 @@
   	 *@return   !ToDo (Return description)
   	 ***************************************/
   	public TestElement createTestElement();
  -	
  +
   	/**
   	 * Test GUI elements can be turned disabled, in which case
   	 * they do not become part of the test when run.
   	 */
   	public boolean isEnabled();
  -	
  +
   	public void setEnabled(boolean enabled);
   
   	/****************************************
  @@ -79,4 +135,7 @@
   	 *@return   !ToDo (Return description)
   	 ***************************************/
   	public Collection getMenuCategories();
  +
  +
  +    public void setNode(JMeterTreeNode node);
   }
  
  
  
  1.7       +10 -8     jakarta-jmeter/src/core/org/apache/jmeter/gui/MainFrame.java
  
  Index: MainFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/MainFrame.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MainFrame.java	17 Oct 2002 19:47:16 -0000	1.6
  +++ MainFrame.java	31 Dec 2002 18:05:54 -0000	1.7
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -145,11 +145,11 @@
   		init();
   		this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);
   	}
  -	
  +
   	public MainFrame()
   	{
   	}
  -	
  +
   
   	/****************************************
   	 * !ToDo (Method description)
  @@ -160,7 +160,7 @@
   	{
   		menuBar.setFileSaveEnabled(enabled);
   	}
  -	
  +
   	public void showStoppingMessage(String host)
   	{
   		stoppingMessage = new JDialog(this,
  @@ -328,7 +328,7 @@
   		hosts.remove(host);
   		if(hosts.size() == 0)
   		{
  -			runningIndicator.setIcon(stoppedIcon);			
  +			runningIndicator.setIcon(stoppedIcon);
   		}
   		menuBar.setRunning(false,host);
   		if(stoppingMessage != null)
  @@ -425,6 +425,8 @@
   	{
   		tree = new JTree(this.treeModel);
   		tree.setCellRenderer(getCellRenderer());
  +		tree.setRootVisible(false);
  +		tree.setShowsRootHandles(true);
   		treeListener.setJTree(tree);
   		tree.addTreeSelectionListener(treeListener);
   		tree.addMouseListener(treeListener);
  
  
  
  1.2       +59 -12    jakarta-jmeter/src/core/org/apache/jmeter/gui/NamePanel.java
  
  Index: NamePanel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/NamePanel.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NamePanel.java	11 Aug 2002 19:24:43 -0000	1.1
  +++ NamePanel.java	31 Dec 2002 18:05:54 -0000	1.2
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -60,9 +60,14 @@
   import javax.swing.JPanel;
   import javax.swing.JPopupMenu;
   import javax.swing.JTextField;
  +import javax.swing.event.DocumentListener;
  +import javax.swing.event.DocumentEvent;
  +
   import org.apache.jmeter.testelement.TestElement;
   import org.apache.jmeter.testelement.WorkBench;
   import org.apache.jmeter.util.JMeterUtils;
  +import org.apache.jmeter.util.LocaleChangeEvent;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   /****************************************
    * Title: JMeter Description: Copyright: Copyright (c) 2000 Company: Apache
    *
  @@ -73,11 +78,12 @@
   
   public class NamePanel extends JPanel implements JMeterGUIComponent
   {
  -	private JTextField nameField = new JTextField(30);
  -
  +    private JTextField nameField = new JTextField(30);
  +    private JLabel nameLabel;
  +    private JMeterTreeNode node;
   
   
  -	/****************************************
  +        /****************************************
   	 * !ToDo (Constructor description)
   	 ***************************************/
   	public NamePanel()
  @@ -161,11 +167,52 @@
   		return nameField.getText();
   	}
   
  -	private void init()
  -	{
  -		this.setLayout(new FlowLayout(FlowLayout.LEFT));
  -		this.add(new JLabel(JMeterUtils.getResString("name")));
  -		this.add(nameField);
  -	}
  -
  +    private void init() {
  +        this.setLayout(new FlowLayout(FlowLayout.LEFT));
  +        nameLabel = new JLabel(JMeterUtils.getResString("name"));
  +        nameLabel.setName("name");
  +
  +        this.add(nameLabel);
  +        this.add(nameField);
  +        nameLabel.setLabelFor(nameField);
  +        nameField.setName("name");
  +        nameField.getDocument().addDocumentListener(new DocumentListener() {
  +            public void insertUpdate(DocumentEvent e) {
  +                updateName(nameField.getText());
  +            }
  +
  +
  +            public void removeUpdate(DocumentEvent e) {
  +                updateName(nameField.getText());
  +            }
  +
  +
  +            public void changedUpdate(DocumentEvent e) {
  +                // not for text fields
  +            }
  +        });
  +    }
  +
  +
  +    private void updateName(String newValue) {
  +        if (getNode() != null) {
  +            getNode().nameChanged();
  +        }
  +    }
  +
  +
  +    public void localeChanged(LocaleChangeEvent event) {
  +        nameLabel.setText(JMeterUtils.getResString(nameLabel.getName()));
  +    }
  +
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        this.node = node;
  +    }
  +
  +
  +    protected JMeterTreeNode getNode()
  +    {
  +        return node;
  +    }
   }
  
  
  
  1.1                  jakarta-jmeter/src/core/org/apache/jmeter/gui/GUIFactory.java
  
  Index: GUIFactory.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, 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 "Apache" and "Apache Software Foundation" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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 (INCLUDING, 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.jmeter.gui;
  
  import java.util.*;
  
  import javax.swing.*;
  
  
  /**
   * @author Oliver Rossmueller
   */
  public class GUIFactory {
  
      private static final Map guiMap = new HashMap();
      private static final Map iconMap = new HashMap();
  
  
      public static ImageIcon getIcon(Class elementClass)
      {
          String key = elementClass.getName();
          ImageIcon icon = (ImageIcon)iconMap.get(key);
  
          if (icon != null)
  	{
              return icon;
          }
          if (elementClass.getSuperclass() != null)
  	{
              return getIcon(elementClass.getSuperclass());
          }
          return null;
      }
  
  
      public static JComponent getGUI(Class elementClass)
      {
          String key = elementClass.getName();
          JComponent gui = (JComponent)guiMap.get(key);
  
          if (gui != null)
  	{
              return gui;
          }
          if (elementClass.getSuperclass() != null)
  	{
              return getGUI(elementClass.getSuperclass());
          }
          return null;
      }
  
  
      public static void registerIcon(String key, ImageIcon icon)
      {
          iconMap.put(key, icon);
      }
  
  
      public static void registerGUI(String key, Class guiClass)
              throws InstantiationException, IllegalAccessException
      {
          JMeterGUIComponent gui = (JMeterGUIComponent)guiClass.newInstance();
          JComponent component = (JComponent)gui;
          guiMap.put(key, gui);
      }
  }
  
  
  
  1.4       +57 -2     \
jakarta-jmeter/src/core/org/apache/jmeter/gui/action/AddParent.java  
  Index: AddParent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/action/AddParent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AddParent.java	29 Aug 2002 18:17:38 -0000	1.3
  +++ AddParent.java	31 Dec 2002 18:05:54 -0000	1.4
  @@ -1,3 +1,58 @@
  +/*
  + * ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, 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 "Apache" and "Apache Software Foundation" and
  + * "Apache JMeter" must not be used to endorse or promote products
  + * derived from this software without prior written permission. For
  + * written permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + * "Apache JMeter", 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 (INCLUDING, 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.jmeter.gui.action;
   import java.awt.Component;
   import java.awt.event.ActionEvent;
  @@ -71,7 +126,7 @@
   	protected void addParentToTree(JMeterGUIComponent newParent)
   	{
   		GuiPackage guiPackage = GuiPackage.getInstance();
  -		JMeterTreeNode newNode = new JMeterTreeNode(newParent);
  +		JMeterTreeNode newNode = new JMeterTreeNode(newParent, \
                guiPackage.getTreeModel());
   		JMeterTreeNode currentNode = guiPackage.getTreeListener().getCurrentNode();
   		JMeterTreeNode parentNode = (JMeterTreeNode)currentNode.getParent();
   		int index = parentNode.getIndex(currentNode);
  
  
  
  1.5       +6 -6      \
jakarta-jmeter/src/core/org/apache/jmeter/gui/action/AddToTree.java  
  Index: AddToTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/action/AddToTree.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AddToTree.java	29 Aug 2002 18:17:38 -0000	1.4
  +++ AddToTree.java	31 Dec 2002 18:05:54 -0000	1.5
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -87,7 +87,7 @@
   		allJMeterComponentCommands = new HashMap();
   		allJMeterComponentCommands.put("Add","Add");
   		List classes;
  -		
  +
   	}
   
   
  @@ -109,7 +109,7 @@
   	 *@param  guiPackage  Description of Parameter
   	 */
   	public void doAction(ActionEvent e)
  -	{		
  +	{
   		try
   		{
   			JMeterGUIComponent gui = (JMeterGUIComponent) \
Class.forName(((JComponent)e.getSource()).getName()).newInstance();  @@ -124,7 +124,7 \
@@  protected void addObjectToTree(JMeterGUIComponent guiObject)
   	{
   		GuiPackage guiPackage = GuiPackage.getInstance();
  -		JMeterTreeNode node = new JMeterTreeNode(guiObject);
  +		JMeterTreeNode node = new JMeterTreeNode(guiObject, guiPackage.getTreeModel());
   		guiPackage.getTreeModel().insertNodeInto(node,
   				guiPackage.getTreeListener().getCurrentNode(),
   				guiPackage.getTreeListener().getCurrentNode().getChildCount());
  
  
  
  1.3       +25 -28    \
jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterCellRenderer.java  
  Index: JMeterCellRenderer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterCellRenderer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JMeterCellRenderer.java	19 Aug 2002 22:33:13 -0000	1.2
  +++ JMeterCellRenderer.java	31 Dec 2002 18:05:54 -0000	1.3
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -52,14 +52,13 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  - package org.apache.jmeter.gui.tree;
  +package org.apache.jmeter.gui.tree;
  +
   
   import javax.swing.tree.*;
   import javax.swing.*;
  +
   import java.awt.Component;
  -import org.apache.jmeter.gui.JMeterGUIComponent;
  -import org.apache.jmeter.gui.GuiFactory;
  -import org.apache.jmeter.gui.GuiPackage;
   
   /**
    * Title:        JMeter
  @@ -73,28 +72,26 @@
   public class JMeterCellRenderer extends DefaultTreeCellRenderer
   {
   
  -	 ImageIcon timer;
  -
  -	public JMeterCellRenderer()
  -	{
  -		 timer = org.apache.jmeter.util.JMeterUtils.getImage("timer.gif");
  -	}
  -
  -	public Component getTreeCellRendererComponent(JTree tree,
  -															 Object value,
  -															 boolean sel,
  -															 boolean expanded,
  -															 boolean leaf,
  -															 int row,
  -															 boolean hasFocus)
  -	{
  -		super.getTreeCellRendererComponent(tree,((JMeterGUIComponent)value).getName(),
  -				sel,expanded,leaf,row,hasFocus);
  -		this.setEnabled(((JMeterGUIComponent)value).isEnabled());
  -		ImageIcon ic = ((JMeterTreeNode)value).getIcon();
  -		if (ic!=null)
  -			 setIcon(ic);
  -		return this;
  -	}
  +    public JMeterCellRenderer()
  +    {
  +    }
  +
  +
  +    public Component getTreeCellRendererComponent(JTree tree,
  +                                                  Object value,
  +                                                  boolean sel,
  +                                                  boolean expanded,
  +                                                  boolean leaf,
  +                                                  int row,
  +                                                  boolean hasFocus)
  +    {
  +        super.getTreeCellRendererComponent(tree, \
((JMeterTreeNode)value).getName(), sel, expanded, leaf, row, hasFocus);  +        \
this.setEnabled(((JMeterTreeNode)value).isEnabled());  +        ImageIcon ic = \
((JMeterTreeNode)value).getIcon();  +        if (ic != null) {
  +            setIcon(ic);
  +        }
  +        return this;
  +    }
   }
   
  
  
  
  1.7       +11 -11    \
jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java  
  Index: JMeterTreeModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JMeterTreeModel.java	17 Oct 2002 19:47:16 -0000	1.6
  +++ JMeterTreeModel.java	31 Dec 2002 18:05:54 -0000	1.7
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -80,16 +80,16 @@
   
   public class JMeterTreeModel extends DefaultTreeModel
   {
  -	
  +
   	/****************************************
   	 * !ToDo (Constructor description)
   	 ***************************************/
   	public JMeterTreeModel()
   	{
  -		super(new JMeterTreeNode(new NamePanel()));
  -		this.insertNodeInto(new JMeterTreeNode(new TestPlanGui()),
  +		super(new JMeterTreeNode(new NamePanel(), null));
  +		this.insertNodeInto(new JMeterTreeNode(new TestPlanGui(), this),
   				(JMeterTreeNode)getRoot(), 0);
  -		this.insertNodeInto(new JMeterTreeNode(new WorkBenchGui()),
  +		this.insertNodeInto(new JMeterTreeNode(new WorkBenchGui(), this),
   				(JMeterTreeNode)getRoot(), 1);
   	}
   
  @@ -107,7 +107,7 @@
   	}
   
   	/****************************************
  -	 * Adds the sub tree at the given node.  Returns a boolean indicating 
  +	 * Adds the sub tree at the given node.  Returns a boolean indicating
   	 * whether the added sub tree was a full test plan.
   	 *
   	 *@param subTree                         !ToDo
  @@ -152,7 +152,7 @@
   		{
   			throw new IllegalUserActionException("This node cannot hold sub-elements");
   		}
  -		JMeterTreeNode newNode = new JMeterTreeNode((JMeterGUIComponent)component);
  +		JMeterTreeNode newNode = new JMeterTreeNode((JMeterGUIComponent)component, \
this);  this.insertNodeInto(newNode, node, node.getChildCount());
   		return newNode;
   	}
  @@ -201,14 +201,14 @@
   	{
   		return getCurrentSubTree((JMeterTreeNode)((JMeterTreeNode)this.getRoot()).getChildAt(0));
  }
  -	
  +
   	public void clearTestPlan()
   	{
   		super.removeNodeFromParent((JMeterTreeNode)getChild(getRoot(), 0));
  -		this.insertNodeInto(new JMeterTreeNode(new TestPlanGui()),
  +		this.insertNodeInto(new JMeterTreeNode(new TestPlanGui(), this),
   				(JMeterTreeNode)getRoot(), 0);
   		super.removeNodeFromParent((JMeterTreeNode)getChild(getRoot(), 1));
  -		this.insertNodeInto(new JMeterTreeNode(new WorkBenchGui()),
  +		this.insertNodeInto(new JMeterTreeNode(new WorkBenchGui(), this),
   				(JMeterTreeNode)getRoot(), 1);
   	}
   }
  
  
  
  1.3       +26 -15    \
jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java  
  Index: JMeterTreeNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JMeterTreeNode.java	19 Aug 2002 22:33:13 -0000	1.2
  +++ JMeterTreeNode.java	31 Dec 2002 18:05:54 -0000	1.3
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -59,6 +59,8 @@
   import javax.swing.JPopupMenu;
   import java.util.Collection;
   import org.apache.jmeter.gui.JMeterGUIComponent;
  +import org.apache.jmeter.gui.GUIFactory;
  +
   import java.awt.event.MouseListener;
   import java.awt.event.MouseEvent;
   import org.apache.jmeter.testelement.TestElement;
  @@ -74,30 +76,29 @@
   
   public class JMeterTreeNode extends DefaultMutableTreeNode implements \
JMeterGUIComponent  {
  +    JMeterTreeModel treeModel;
   
  -	public JMeterTreeNode()
  -	{
  -		this.setUserObject(new org.apache.jmeter.control.gui.WorkBenchGui());
  -	}
   
  -	public JMeterTreeNode(JMeterGUIComponent userObj)
  +	public JMeterTreeNode(JMeterGUIComponent userObj, JMeterTreeModel treeModel)
   	{
   		super(userObj);
  +		this.treeModel = treeModel;
  +		userObj.setNode(this);
   	}
  -	
  +
   	public boolean isEnabled()
   	{
   		return ((JMeterGUIComponent)getUserObject()).isEnabled();
   	}
  -	
  +
   	public void setEnabled(boolean enabled)
   	{
   		((JMeterGUIComponent)getUserObject()).setEnabled(enabled);
   	}
  -	
  +
   	public ImageIcon getIcon()
   	{
  -		return null;
  +		return GUIFactory.getIcon(getUserObject().getClass());
   	}
   
   	public Collection getMenuCategories()
  @@ -132,8 +133,7 @@
   	 ***********************************************************/
   	public void setName(String name)
   	{
  -		Object userObj = getUserObject();
  -		((JMeterGUIComponent)userObj).setName(name);
  +		((JMeterGUIComponent)getUserObject()).setName(name);
   	}
   
   	/************************************************************
  @@ -143,7 +143,18 @@
   	 ***********************************************************/
   	public String getName()
   	{
  -		Object userObj = getUserObject();
  -		return ((JMeterGUIComponent)userObj).getName();
  +		return ((JMeterGUIComponent)getUserObject()).getName();
   	}
  +
  +
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        ((JMeterGUIComponent)getUserObject()).setNode(node);
  +    }
  +
  +
  +    public void nameChanged()
  +    {
  +        treeModel.nodeChanged(this);
  +    }
   }
  
  
  
  1.1                  \
jakarta-jmeter/src/core/org/apache/jmeter/plugin/JMeterPlugin.java  
  Index: JMeterPlugin.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, 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 "Apache" and "Apache Software Foundation" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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 (INCLUDING, 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.jmeter.plugin;
  
  /**
   * @author Oliver Rossmueller
   */
  public interface JMeterPlugin {
  
      public String[][] getIconMappings();
  
      public String[][] getResourceBundles();
  }
  
  
  
  1.1                  \
jakarta-jmeter/src/core/org/apache/jmeter/plugin/PluginManager.java  
  Index: PluginManager.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, 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 "Apache" and "Apache Software Foundation" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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 (INCLUDING, 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.jmeter.plugin;
  
  
  import java.net.URL;
  
  import javax.swing.*;
  
  import org.apache.jmeter.gui.GUIFactory;
  import org.apache.jmeter.util.JMeterUtils;
  
  
  /**
   * @author Oliver Rossmueller
   */
  public class PluginManager
  {
  
      private static final PluginManager instance = new PluginManager();
  
  
      private PluginManager()
      {
      }
  
  
      public static void install(JMeterPlugin plugin)
              throws ClassNotFoundException, InstantiationException,
  		   IllegalAccessException
      {
          instance.installPlugin(plugin);
      }
  
  
      private void installPlugin(JMeterPlugin plugin)
              throws ClassNotFoundException, InstantiationException,
  		   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
  	    {
                  GUIFactory.registerIcon(icons[i][0], new ImageIcon(resource));
              }
          }
      }
  }
  
  
  
  1.4       +10 -3     \
jakarta-jmeter/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java  
  Index: ThreadGroupGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThreadGroupGui.java	17 Oct 2002 19:47:17 -0000	1.3
  +++ ThreadGroupGui.java	31 Dec 2002 18:05:54 -0000	1.4
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -69,6 +69,7 @@
   import org.apache.jmeter.control.gui.LoopControlPanel;
   import org.apache.jmeter.gui.JMeterGUIComponent;
   import org.apache.jmeter.gui.NamePanel;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   import org.apache.jmeter.gui.util.FocusRequester;
   import org.apache.jmeter.gui.util.MenuFactory;
   import org.apache.jmeter.gui.util.NumberFieldErrorListener;
  @@ -193,7 +194,7 @@
   		loopPanel = new LoopControlPanel(false);
   		LoopController looper= (LoopController)loopPanel.createTestElement();
   		looper.setLoops(-1);
  -		loopPanel.configure(looper);		
  +		loopPanel.configure(looper);
   		return loopPanel;
   	}
   
  @@ -265,4 +266,10 @@
   
   		this.add(mainPanel);
   	}
  +
  +
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        namePanel.setNode(node);
  +    }
   }
  
  
  
  1.4       +17 -10    \
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
  
  Index: ProxyControlGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProxyControlGui.java	28 Aug 2002 15:53:00 -0000	1.3
  +++ ProxyControlGui.java	31 Dec 2002 18:05:54 -0000	1.4
  @@ -2,7 +2,7 @@
    * ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -87,6 +87,7 @@
   import org.apache.jmeter.gui.GuiPackage;
   import org.apache.jmeter.gui.JMeterGUIComponent;
   import org.apache.jmeter.gui.NamePanel;
  +import org.apache.jmeter.gui.tree.JMeterTreeNode;
   import org.apache.jmeter.gui.util.MenuFactory;
   import org.apache.jmeter.gui.util.PowerTableModel;
   import org.apache.jmeter.protocol.http.proxy.ProxyControl;
  @@ -126,7 +127,7 @@
   	private final static String ADD_EXCLUDE = "add_exclude";
   	private final static String DELETE_INCLUDE = "delete_include";
   	private final static String DELETE_EXCLUDE = "delete_exclude";
  -	
  +
   	private final static String INCLUDE_COL = \
JMeterUtils.getResString("patterns_to_include");  private final static String \
EXCLUDE_COL = JMeterUtils.getResString("patterns_to_exclude");  
  @@ -161,7 +162,7 @@
   		List includeList = getDataList(includeModel,INCLUDE_COL);
   		element.setIncludeList(includeList);
   	}
  -	
  +
   	private void setExcludeListInProxyControl(ProxyControl element)
   	{
   		List excludeList = getDataList(excludeModel,EXCLUDE_COL);
  @@ -177,8 +178,8 @@
   		}
   		return list;
   	}
  -	
  -	
  +
  +
   
   	public void setName(String name)
   	{
  @@ -216,7 +217,7 @@
   			model.addRow(new Object[]{iter.next()});
   		}
   	}
  -	
  +
   	public void focusLost(FocusEvent e)
   	{
   		try
  @@ -227,7 +228,7 @@
   		{
   		}
   	}
  -	
  +
   	public void focusGained(FocusEvent e)
   	{
   	}
  @@ -303,7 +304,7 @@
   					"invalid_variables"),"Error",JOptionPane.ERROR_MESSAGE);
   		}
   	}
  -	
  +
   	private void enableRestart()
   	{
   		if(model != null)
  @@ -421,7 +422,7 @@
   		stop = new JButton(JMeterUtils.getResString("stop"));
   		stop.addActionListener(this);
   		stop.setActionCommand(STOP);
  -		
  +
   		restart = new JButton(JMeterUtils.getResString("restart"));
   		restart.addActionListener(this);
   		restart.setActionCommand(RESTART);
  @@ -502,4 +503,10 @@
   		excludeTable.addFocusListener(this);
   		return panel;
   	}
  +
  +
  +    public void setNode(JMeterTreeNode node)
  +    {
  +        namePanel.setNode(node);
  +    }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:jmeter-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jmeter-dev-help@jakarta.apache.org>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic