use of com.vaadin.flow.component.textfield.TextField in project flow-components by vaadin.
the class ValueChangeModePage method initView.
private void initView() {
message = new Div();
message.setId("message");
add(message);
Stream.of(new TextField(), new TextArea(), new PasswordField(), new NumberField(), new EmailField(), new IntegerField(), new BigDecimalField()).forEach(this::setupTestComponent);
}
use of com.vaadin.flow.component.textfield.TextField in project flow-components by vaadin.
the class HasLabelTest method textField.
@Test
public void textField() {
TextField c = new TextField();
Assert.assertTrue(c instanceof HasLabel);
}
use of com.vaadin.flow.component.textfield.TextField in project flow-components by vaadin.
the class PrefixSuffixTest method setSuffix_replacesSuffix.
@Test
public void setSuffix_replacesSuffix() {
TextField field = new TextField();
Assert.assertNull("There should be no suffix component by default", field.getSuffixComponent());
setAndAssertSuffix(field, new Span());
setAndAssertSuffix(field, new H1());
}
use of com.vaadin.flow.component.textfield.TextField in project flow-components by vaadin.
the class PrefixSuffixTest method setPrefix_replacesPrefix.
@Test
public void setPrefix_replacesPrefix() {
TextField field = new TextField();
Assert.assertNull("There should be no prefix component by default", field.getPrefixComponent());
setAndAssertPrefix(field, new Span());
setAndAssertPrefix(field, new H1());
}
use of com.vaadin.flow.component.textfield.TextField in project flow-components by vaadin.
the class PrefixSuffixTest method setSuffix_setSuffixNull_suffixRemoved.
@Test
public void setSuffix_setSuffixNull_suffixRemoved() {
TextField field = new TextField();
field.setSuffixComponent(new Span());
field.setSuffixComponent(null);
Assert.assertNull(field.getSuffixComponent());
Assert.assertEquals("Setting suffix component to null should remove all children in the suffix-slot", 0, getNumOfChildrenInSlot(field, "suffix"));
}
Aggregations