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");
}
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;
}
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;
}
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;
}
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;
}
Aggregations