blob: 7c616521fcab5d701d7b2c00c10a678b1a6b0c7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package com.vaadin.tests.components;
import java.util.ArrayList;
import java.util.List;
import com.vaadin.server.CompositeErrorMessage;
import com.vaadin.server.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.TextField;
public class ErrorMessages extends TestBase {
@Override
protected void setup() {
Button bb = new Button("Button with CompositeError");
List<UserError> errors = new ArrayList<>();
errors.add(new UserError("Error 1"));
errors.add(new UserError("Error 2"));
bb.setComponentError(new CompositeErrorMessage(errors));
addComponent(bb);
TextField tf = new TextField("", "Textfield with UserError");
tf.setComponentError(new UserError("This is a failure"));
addComponent(tf);
ComboBox<String> cb = new ComboBox<>(
"ComboBox with description and UserError");
cb.setDescription("This is a combobox");
cb.setComponentError(new UserError("This is a failure"));
addComponent(cb);
}
@Override
protected String getDescription() {
return "The components all have error messages that should appear when hovering them";
}
@Override
protected Integer getTicketNumber() {
return 3712;
}
}
|