Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoopControlPanel; non-standard GUI feedback #766

Closed
asfimport opened this issue Sep 17, 2001 · 6 comments
Closed

LoopControlPanel; non-standard GUI feedback #766

asfimport opened this issue Sep 17, 2001 · 6 comments

Comments

@asfimport
Copy link
Collaborator

khammond25 (Bug 3682):
In the latest version of org.apache.jmeter.gui.LoopControlPanel (, there are
two problems:

  1. When the "infinite" checkbox is checked, the text field is disabled, but the
    text label "Number of iterations" remains enabled. The defacto standard is to
    disable both the label and the text field.

  2. When the "infinite" checkbox is unchecked, and you enter an non-numeric
    value, you get an Error Dialog. This is fine, but when you click OK to leave
    the dialog, the text field you were typing in is cleared out and the "infinite"
    checkbox is checked. Since we are validating this field after every keypress,
    one typing mistake and your penalized. You have to deselect the checkbox and
    type in your value again. It's an extra mouse click. It's fine to clear out
    the text field, but since the user was trying to enter a valid iteration count,
    let him try it again without having him deselect the checkbox again.

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

khammond25 (migrated from Bugzilla):
Created attachment patch.LoopControlPanel.diff: Patch for LoopControlPanel.java; file contains the diff

patch.LoopControlPanel.diff
--- \jakarta-jmeter-cvs\jakarta-jmeter\src\org\apache\jmeter\gui\LoopControlPanel.java	Fri Aug 31 00:46:44 2001
+++ \jakarta-jmeter-nightly\2001.09.15\jakarta-jmeter\src\org\apache\jmeter\gui\LoopControlPanel.java	Tue Sep 18 05:37:46 2001
@@ -75,6 +75,7 @@
 	LoopController model;
 	JCheckBox infinite = new JCheckBox(JMeterUtils.getResString("infinite"));
 	JTextField loops = new JTextField(5);
+	JLabel loopsLabel = new JLabel(JMeterUtils.getResString("iterator_num"));
 
 	private boolean displayName = true;
 	private static String INFINITE = "infinite";
@@ -132,10 +133,12 @@
 			loops.setText("");
 			model.setLoops(-1);
 			loops.setEnabled(false);
+			loopsLabel.setEnabled(false);
 		}
 		else
 		{
 			loops.setEnabled(true);
+			loopsLabel.setEnabled(true);
 		}
 	}
 
@@ -175,8 +178,6 @@
 			{
 				model.setLoops(-1);
 				loops.setText("");
-				loops.setEnabled(false);
-				infinite.setSelected(true);
 				JOptionPane.showMessageDialog(this, "You must enter a valid number",
 						"Invalid data", JOptionPane.WARNING_MESSAGE);
 			}
@@ -207,7 +208,7 @@
 		loopPanel.add(infinite);
 		JPanel entryPanel = new JPanel();
 		entryPanel.add(Box.createHorizontalStrut(10));
-		entryPanel.add(new JLabel(JMeterUtils.getResString("iterator_num")));
+		entryPanel.add(loopsLabel);
 		loops.setName(LOOPS);
 		loops.addKeyListener(this);
 		setState();
@@ -223,12 +224,14 @@
 			infinite.setSelected(true);
 			loops.setEnabled(false);
 			loops.setText("");
+			loopsLabel.setEnabled(false);
 		}
 		else
 		{
 			infinite.setSelected(false);
 			loops.setEnabled(true);
 			loops.setText(""+model.getLoops());
+			loopsLabel.setEnabled(true);
 		}
 	}
 }

@asfimport
Copy link
Collaborator Author

khammond25 (migrated from Bugzilla):
Created attachment patch2.LoopControlPanel.diff: NEW Patch for LoopControlPanel.java; file contains the diff

patch2.LoopControlPanel.diff
--- \jakarta-jmeter-cvs\jakarta-jmeter\src\org\apache\jmeter\gui\LoopControlPanel.java	Fri Aug 31 00:46:44 2001
+++ \jakarta-jmeter-nightly\2001.09.15\jakarta-jmeter\src\org\apache\jmeter\gui\LoopControlPanel.java	Tue Sep 18 13:36:00 2001
@@ -75,6 +75,7 @@
 	LoopController model;
 	JCheckBox infinite = new JCheckBox(JMeterUtils.getResString("infinite"));
 	JTextField loops = new JTextField(5);
+	JLabel loopsLabel = new JLabel(JMeterUtils.getResString("iterator_num"));
 
 	private boolean displayName = true;
 	private static String INFINITE = "infinite";
@@ -132,10 +133,12 @@
 			loops.setText("");
 			model.setLoops(-1);
 			loops.setEnabled(false);
+			loopsLabel.setEnabled(false);
 		}
 		else
 		{
 			loops.setEnabled(true);
+			loopsLabel.setEnabled(true);
 		}
 	}
 
@@ -173,12 +176,14 @@
 		{
 			if(loops.getText().length() > 0)
 			{
-				model.setLoops(-1);
-				loops.setText("");
-				loops.setEnabled(false);
-				infinite.setSelected(true);
+				// We need a standard warning/error dialog. The problem with
+				// having it here is that the dialog is centered over this
+				// LoopControlPanel instead of begin centered in the entire
+				// JMeter GUI window.
 				JOptionPane.showMessageDialog(this, "You must enter a valid number",
 						"Invalid data", JOptionPane.WARNING_MESSAGE);
+				model.setLoops(-1);
+				loops.setText("");
 			}
 			else
 			{
@@ -207,7 +212,7 @@
 		loopPanel.add(infinite);
 		JPanel entryPanel = new JPanel();
 		entryPanel.add(Box.createHorizontalStrut(10));
-		entryPanel.add(new JLabel(JMeterUtils.getResString("iterator_num")));
+		entryPanel.add(loopsLabel);
 		loops.setName(LOOPS);
 		loops.addKeyListener(this);
 		setState();
@@ -223,12 +228,14 @@
 			infinite.setSelected(true);
 			loops.setEnabled(false);
 			loops.setText("");
+			loopsLabel.setEnabled(false);
 		}
 		else
 		{
 			infinite.setSelected(false);
 			loops.setEnabled(true);
 			loops.setText(""+model.getLoops());
+			loopsLabel.setEnabled(true);
 		}
 	}
 }

@asfimport
Copy link
Collaborator Author

khammond25 (migrated from Bugzilla):
Disregard the first patch and look at latest one (9/18/01 06:38). I changed
the order that we report the error. Now the flow is: 1) display the error
dialog, 2) clear the text field.

This way, when the user gets the dialog, they can see that "oh yeah, I did have
a typo". Previously, I coded it so that the text field was cleared before
displaying the window. This wasn't very user friendly.

I have also updated ThreadGroup and ThreadGroupGui to have the same behavior.
Look for a patch soon!

@asfimport
Copy link
Collaborator Author

khammond25 (migrated from Bugzilla):
Fixed 2001.09.27.

@asfimport
Copy link
Collaborator Author

Jordi Salvat i Alabart (migrated from Bugzilla):
Marking all bugs RESOLVED before JMeter 1.8's release date as VERIFIED.
Yes, it's pretty poor QA procedure, but there's bugs here lingering since JMeter
1.6, and we need to clean up a little.

@asfimport
Copy link
Collaborator Author

Jordi Salvat i Alabart (migrated from Bugzilla):
Bulk-closing all bugs RESOLVED before JMeter 1.8 release date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant