Search in sources :

Example 21 with TextArea

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

the class BindPlaceholderAspectDefinitionTest method testPlaceholderType_Static.

@Test
void testPlaceholderType_Static() {
    TextArea area = new TextArea();
    callPlaceholderAspectDefinition(area, "A nice static Placeholder", PlaceholderType.STATIC);
    String placeholderResult = area.getPlaceholder();
    assertThat(placeholderResult).isEqualTo("A nice static Placeholder");
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 22 with TextArea

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

the class ComponentFactory method newTextArea.

public static TextArea newTextArea() {
    TextArea textArea = new TextArea();
    LinkkiComponentUtil.preventEnterKeyPropagation(textArea);
    return textArea;
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea)

Example 23 with TextArea

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

the class ComponentFactory method newTextArea.

/**
 * Returns a new {@link TextArea} with the given max length, width and number of rows.
 * <p>
 * If the given maxLength is less than or equal to 0, the maximal character count is unlimited.
 * <p>
 * If the given width is an empty String and maxLength is greater than 0, the width of the field is
 * inferred by maxLength.
 * <p>
 * The height is only set if the given String is not {@link StringUtils#isEmpty(CharSequence)
 * empty}.
 */
public static TextArea newTextArea(int maxLength, String width, String height) {
    TextArea textArea = newTextArea();
    if (maxLength > 0) {
        textArea.setMaxLength(maxLength);
    }
    textArea.setWidth(width);
    if (!StringUtils.isEmpty(height)) {
        textArea.setHeight(height);
    }
    return textArea;
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea)

Example 24 with TextArea

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

the class DefaultErrorDialog method createStackTraceTextArea.

private static TextArea createStackTraceTextArea(@CheckForNull Throwable t) {
    TextArea textArea = new TextArea(NlsText.getString("DefaultErrorHandler.errorDialogDetails"));
    textArea.setValue(ExceptionUtils.getStackTrace(t));
    formatText(textArea);
    ComponentStyles.setOverflowAuto(textArea);
    return textArea;
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea)

Example 25 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project Akros-Marketplace by AkrosAG.

the class CategoryView method createEditorFormComponents.

private Component createEditorFormComponents() {
    Div div = new Div();
    FormLayout formLayout = new FormLayout();
    formLayout.setResponsiveSteps(new ResponsiveStep("0", 1, LabelsPosition.TOP));
    txtCategoryId = new NumberField("categoryId (Column: CATEGORY_ID)");
    txtCategoryId.setReadOnly(true);
    ValueChangeListener<ValueChangeEvent<?>> listener = getUpdateSaveButtonValueChangeListener();
    txtDescription = new TextArea("description (Column: DESCRIPTION)");
    txtDescription.setId(TEXT_CONTROL_DESCRIPTION);
    txtDescription.setClassName("full-width");
    txtDescription.setRequired(true);
    txtDescription.setHeightFull();
    txtDescription.setValueChangeMode(ValueChangeMode.LAZY);
    txtDescription.addValueChangeListener(listener);
    txtShortDescription = new TextField("shortDescription (Column: SHORT_DESCRIPTON)");
    txtShortDescription.setClassName("full-width");
    txtShortDescription.setRequired(true);
    txtShortDescription.setValueChangeMode(ValueChangeMode.LAZY);
    txtShortDescription.addValueChangeListener(listener);
    formLayout.add(txtCategoryId, txtDescription, txtShortDescription);
    div.add(formLayout);
    return div;
}
Also used : Div(com.vaadin.flow.component.html.Div) FormLayout(com.vaadin.flow.component.formlayout.FormLayout) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent) TextArea(com.vaadin.flow.component.textfield.TextArea) TextField(com.vaadin.flow.component.textfield.TextField) NumberField(com.vaadin.flow.component.textfield.NumberField) ResponsiveStep(com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep)

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