jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1514558 - /jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java
Date Fri, 16 Aug 2013 01:43:52 GMT
Author: sebb
Date: Fri Aug 16 01:43:52 2013
New Revision: 1514558

URL: http://svn.apache.org/r1514558
Log:
Need GUI Editor to process fields which are based on Enums with localised display strings
Better invocation strategy - pass in enum class and resource bundle
Oops - missed this from svn commit: r1514547
Bugzilla Id: 55241

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java?rev=1514558&r1=1514557&r2=1514558&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java Fri Aug 16 01:43:52
2013
@@ -164,9 +164,12 @@ public abstract class BeanInfoSupport ex
 
     /**
      * Get the property descriptor for the property of the given name.
+     * Sets the GUITYPE to the provided editor.
      *
      * @param name
      *            property name
+     * @param editor the TypeEditor enum that describes the property editor
+     *
      * @return descriptor for a property of that name, or null if there's none
      */
     protected PropertyDescriptor property(String name, TypeEditor editor) {
@@ -178,6 +181,26 @@ public abstract class BeanInfoSupport ex
     }
 
     /**
+     * Get the property descriptor for the property of the given name.
+     * Sets the GUITYPE to the provided enum.
+     *
+     * @param name
+     *            property name
+     * @param enumClass the enum class that is to be used by the editor
+     * @param rb the resource bundle to use for creating the display names
+     * @return descriptor for a property of that name, or null if there's none
+     */
+    protected PropertyDescriptor property(final String name, 
+            final Class<? extends Enum<?>> enumClass, final ResourceBundle rb)
{
+        PropertyDescriptor property = property(name);
+        if (property != null) {
+            property.setValue(GenericTestBeanCustomizer.GUITYPE, enumClass);
+            property.setValue(GenericTestBeanCustomizer.RESOURCE_BUNDLE, rb);
+        }
+        return property;
+    }
+
+    /**
      * Set the bean's 16x16 colour icon.
      *
      * @param resourceName



Mime
View raw message