-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Vaadin 7 UI Design By Example: Beginner's Guide
Implement your runSelectedTest method. This method will be called when the user presses the Time it! button:
public void runSelectedTest() {
Long times = Long.parseLong(textField.getValue());
Collection<String> results = TestSetExecutor.execute(
(TestSet) combo.getValue(), times);
showResults(results);
}Here, we're converting the string stored in the text field to a Long number using Long.parseLong (a potential exception, NumberFormatException, pokes its head).
Once we have the Long value, we execute the results using a helper class in the biz package (TestSetExecutor). This helper class has an execute method that expects the TestSet to execute and the number of iterations to perform for each test in the TestSet. The execute method returns all the results as a collection of strings that we can proudly show to the user. As proudly as Susan when she presented her code.
When...
Change the font size
Change margin width
Change background colour