Search in sources :

Example 11 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project flow-components by vaadin.

the class TextAreaTest method autoselectPropertyValue.

@Test
public void autoselectPropertyValue() {
    TextArea textArea = new TextArea();
    assertAutoselectPropertyValueEquals(textArea, true);
    assertAutoselectPropertyValueEquals(textArea, false);
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.Test)

Example 12 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project flow-components by vaadin.

the class TextAreaTest method initialValuePropertyValue.

@Test
public void initialValuePropertyValue() {
    TextArea textArea = new TextArea();
    assertEquals(textArea.getEmptyValue(), textArea.getElement().getProperty("value"));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.Test)

Example 13 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project microstream by microstream-one.

the class InternalErrorView method beforeEnter.

@Override
public void beforeEnter(final BeforeEnterEvent event) {
    final H3 header = new H3(getTranslation("INTERNAL_ERROR_TITLE"));
    header.addClassName(ClassNames.ERROR);
    this.add(header);
    final VaadinSession session = event.getUI().getSession();
    final SessionData sessionData = session.getAttribute(SessionData.class);
    if (sessionData != null) {
        this.add(new Label(getTranslation("INTERNAL_ERROR_HINT", sessionData.baseUrl())));
    }
    final Throwable t = (Throwable) session.getAttribute(ApplicationErrorHandler.THROWABLE_ATTRIBUTE);
    if (t != null) {
        this.add(new Hr());
        final StringWriter stringWriter = new StringWriter();
        try (final PrintWriter writer = new PrintWriter(stringWriter)) {
            t.printStackTrace(writer);
        }
        final TextArea stackTrace = new TextArea();
        stackTrace.setValue(stringWriter.toString());
        stackTrace.setReadOnly(true);
        stackTrace.setWidth("100%");
        final Details details = new Details(getTranslation("DETAILS"), stackTrace);
        details.setOpened(false);
        this.add(details);
        this.setHorizontalComponentAlignment(Alignment.STRETCH, details);
        this.setFlexGrow(1, details);
    }
}
Also used : Details(com.vaadin.flow.component.details.Details) VaadinSession(com.vaadin.flow.server.VaadinSession) StringWriter(java.io.StringWriter) TextArea(com.vaadin.flow.component.textfield.TextArea) Label(com.vaadin.flow.component.html.Label) Hr(com.vaadin.flow.component.html.Hr) H3(com.vaadin.flow.component.html.H3) SessionData(one.microstream.storage.restclient.app.types.SessionData) PrintWriter(java.io.PrintWriter)

Example 14 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class BindSuffixAspectDefinitionTest method testSuffixType_Static.

@Test
public void testSuffixType_Static() {
    TextArea area = new TextArea();
    callSuffixAspectDefinition(area, "€", SuffixType.STATIC);
    String suffixResult = area.getSuffixComponent().getElement().getText();
    assertThat(suffixResult, is("€"));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 15 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class BindSuffixAspectDefinitionTest method testSuffixType_AutoFilledSuffix.

@Test
public void testSuffixType_AutoFilledSuffix() {
    TextArea area = new TextArea();
    callSuffixAspectDefinition(area, "€", SuffixType.AUTO);
    String suffixResult = area.getSuffixComponent().getElement().getText();
    assertThat(suffixResult, is("€"));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Aggregations

TextArea (com.vaadin.flow.component.textfield.TextArea)52 TextField (com.vaadin.flow.component.textfield.TextField)14 Test (org.junit.jupiter.api.Test)13 Div (com.vaadin.flow.component.html.Div)8 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)6 Test (org.junit.Test)6 Button (com.vaadin.flow.component.button.Button)5 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)5 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)4 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)4 H3 (com.vaadin.flow.component.html.H3)3 EmailField (com.vaadin.flow.component.textfield.EmailField)3 NumberField (com.vaadin.flow.component.textfield.NumberField)3 ValueChangeEvent (com.vaadin.flow.component.HasValue.ValueChangeEvent)2 ResponsiveStep (com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep)2 H2 (com.vaadin.flow.component.html.H2)2 NativeButton (com.vaadin.flow.component.html.NativeButton)2 StringLengthValidator (com.vaadin.flow.data.validator.StringLengthValidator)2 Route (com.vaadin.flow.router.Route)2 EFieldTypeDefinition (ch.akros.marketplace.administration.constants.EFieldTypeDefinition)1