jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1332459 - in /jmeter/trunk/src: core/org/apache/jmeter/config/gui/ArgumentsPanel.java protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
Date Mon, 30 Apr 2012 22:58:45 GMT
Author: sebb
Date: Mon Apr 30 22:58:45 2012
New Revision: 1332459

URL: http://svn.apache.org/viewvc?rev=1332459&view=rev
Log:
Bug 53164 - New System sampler
Rework changes: restore original API so HTTPArgsPanel does not need to change

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java?rev=1332459&r1=1332458&r2=1332459&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java Mon Apr 30 22:58:45
2012
@@ -184,14 +184,15 @@ public class ArgumentsPanel extends Abst
      * @param bkg background colour
      * @param enableUpDown Add up/down buttons
      * @param standalone is standalone
-     * @param columns
+     * @param model the table model to use
      */
     public ArgumentsPanel(String label, Color bkg, boolean enableUpDown, boolean standalone,
ObjectTableModel model) {
         tableLabel = new JLabel(label);
         this.enableUpDown = enableUpDown;
         this.background = bkg;
         this.standalone = standalone;
-        init(model);
+        this.tableModel = model;
+        init();
     }
 
     /**
@@ -544,9 +545,9 @@ public class ArgumentsPanel extends Abst
 
     /**
      * Initialize the table model used for the arguments table.
-     * @param model ObjectTableModel
      */
-    protected void initializeTableModel(ObjectTableModel model) {
+    protected void initializeTableModel() {
+    if (tableModel == null) {
         if(standalone) {
             tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1,
COLUMN_RESOURCE_NAMES_2 },
                     Argument.class,
@@ -560,10 +561,7 @@ public class ArgumentsPanel extends Abst
                     new Functor("setDescription") },  // $NON-NLS-1$
                     new Class[] { String.class, String.class, String.class });
         } else {
-            if(model != null) {
-                tableModel = model;
-            } else  {
-                tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0,
COLUMN_RESOURCE_NAMES_1 },
+            tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1
},
                     Argument.class,
                     new Functor[] {
                     new Functor("getName"), // $NON-NLS-1$
@@ -578,7 +576,7 @@ public class ArgumentsPanel extends Abst
 
     public static boolean testFunctors(){
         ArgumentsPanel instance = new ArgumentsPanel();
-        instance.initializeTableModel(null);
+        instance.initializeTableModel();
         return instance.tableModel.checkFunctors(null,instance.getClass());
     }
 
@@ -593,12 +591,11 @@ public class ArgumentsPanel extends Abst
 
     /**
      * Create the main GUI panel which contains the argument table.
-     * @param model ObjectTableModel
      *
      * @return the main GUI panel
      */
-    private Component makeMainPanel(ObjectTableModel model) {
-        initializeTableModel(model);
+    private Component makeMainPanel() {
+        initializeTableModel();
         table = new JTable(tableModel);
         table.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
         table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
@@ -676,9 +673,8 @@ public class ArgumentsPanel extends Abst
 
     /**
      * Initialize the components and layout of this component.
-     * @param model ObjectTableModel
      */
-    private void init(ObjectTableModel model) {
+    private void init() {
         JPanel p = this;
 
         if (standalone) {
@@ -691,7 +687,7 @@ public class ArgumentsPanel extends Abst
         p.setLayout(new BorderLayout());
 
         p.add(makeLabelPanel(), BorderLayout.NORTH);
-        p.add(makeMainPanel(model), BorderLayout.CENTER);
+        p.add(makeMainPanel(), BorderLayout.CENTER);
         // Force a minimum table height of 70 pixels
         p.add(Box.createVerticalStrut(70), BorderLayout.WEST);
         p.add(makeButtonPanel(), BorderLayout.SOUTH);

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java?rev=1332459&r1=1332458&r2=1332459&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
Mon Apr 30 22:58:45 2012
@@ -46,30 +46,26 @@ public class HTTPArgumentsPanel extends 
     private static final String INCLUDE_EQUALS = "include_equals"; //$NON-NLS-1$
 
     @Override
-    protected void initializeTableModel(ObjectTableModel model) {
-        if(model == null) {
-            tableModel = new ObjectTableModel(new String[] {
-                    ArgumentsPanel.COLUMN_RESOURCE_NAMES_0, ArgumentsPanel.COLUMN_RESOURCE_NAMES_1,
ENCODE_OR_NOT, INCLUDE_EQUALS },
-                    HTTPArgument.class,
-                    new Functor[] {
-                    new Functor("getName"), //$NON-NLS-1$
-                    new Functor("getValue"), //$NON-NLS-1$
-                    new Functor("isAlwaysEncoded"), //$NON-NLS-1$
-                    new Functor("isUseEquals") }, //$NON-NLS-1$
-                    new Functor[] {
-                    new Functor("setName"), //$NON-NLS-1$
-                    new Functor("setValue"), //$NON-NLS-1$
-                    new Functor("setAlwaysEncoded"), //$NON-NLS-1$
-                    new Functor("setUseEquals") }, //$NON-NLS-1$
-                    new Class[] {String.class, String.class, Boolean.class, Boolean.class
});
-        } else {
-            tableModel = model;
-        }
+    protected void initializeTableModel() {
+        tableModel = new ObjectTableModel(new String[] {
+                ArgumentsPanel.COLUMN_RESOURCE_NAMES_0, ArgumentsPanel.COLUMN_RESOURCE_NAMES_1,
ENCODE_OR_NOT, INCLUDE_EQUALS },
+                HTTPArgument.class,
+                new Functor[] {
+                new Functor("getName"), //$NON-NLS-1$
+                new Functor("getValue"), //$NON-NLS-1$
+                new Functor("isAlwaysEncoded"), //$NON-NLS-1$
+                new Functor("isUseEquals") }, //$NON-NLS-1$
+                new Functor[] {
+                new Functor("setName"), //$NON-NLS-1$
+                new Functor("setValue"), //$NON-NLS-1$
+                new Functor("setAlwaysEncoded"), //$NON-NLS-1$
+                new Functor("setUseEquals") }, //$NON-NLS-1$
+                new Class[] {String.class, String.class, Boolean.class, Boolean.class });
     }
 
     public static boolean testFunctors(){
         HTTPArgumentsPanel instance = new HTTPArgumentsPanel();
-        instance.initializeTableModel(null);
+        instance.initializeTableModel();
         return instance.tableModel.checkFunctors(null,instance.getClass());
     }
 



Mime
View raw message