You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/03/30 01:36:53 UTC

svn commit: r389930 - /jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java

Author: sebb
Date: Wed Mar 29 15:36:50 2006
New Revision: 389930

URL: http://svn.apache.org/viewcvs?rev=389930&view=rev
Log:
Documentation update

Modified:
    jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java

Modified: jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java?rev=389930&r1=389929&r2=389930&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/SavePropertyDialog.java Wed Mar 29 15:36:50 2006
@@ -42,6 +42,11 @@
 import org.apache.log.Logger;
 
 /**
+ * Generates Configure pop-up dialogue for Listeners from all methods in SampleSaveConfiguration
+ * with the signature "boolean saveXXX()". 
+ * There must be a corresponding "void setXXX(boolean)" method, and a property save_XXX which is
+ * used to name the field on the dialogue.
+ * 
  * @author mstover
  */
 public class SavePropertyDialog extends JDialog implements ActionListener {
@@ -52,7 +57,9 @@
 
 	private static final long serialVersionUID = 1;
 
-    private static final String NAME_SAVE_PFX = "save"; // $NON-NLS-1$
+    private static final String NAME_SAVE_PFX   = "save";  // $NON-NLS-1$ i.e. boolean saveXXX()
+    private static final String NAME_SET_PREFIX = "set";   // $NON-NLS-1$ i.e. void setXXX(boolean)
+    private static final String RESOURCE_PREFIX = "save_"; // $NON-NLS-1$ e.g. save_XXX property
 
     private SampleSaveConfiguration saveConfig;
 
@@ -103,13 +110,14 @@
 					try {
 						name = name.substring(4);
 						JCheckBox check = new JCheckBox(
-                                JMeterUtils.getResString("save_" + name)// $NON-NLS-1$
+                                JMeterUtils.getResString(RESOURCE_PREFIX + name)// $NON-NLS-1$
                                 ,((Boolean) methods[i].invoke(saveConfig, new Object[0])).booleanValue());
 						checkPanel.add(check, BorderLayout.NORTH);
 						check.addActionListener(this);
-						check.setActionCommand("set" + name);// $NON-NLS-1$
-						if (!functors.containsKey(check.getActionCommand())) {
-							functors.put(check.getActionCommand(), new Functor(check.getActionCommand()));
+                        String actionCommand = NAME_SET_PREFIX + name; // $NON-NLS-1$
+						check.setActionCommand(actionCommand);
+                        if (!functors.containsKey(actionCommand)) {
+							functors.put(actionCommand, new Functor(actionCommand));
 						}
 					} catch (Exception e) {
 						log.warn("Problem creating save config dialog", e);



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