The XdevTextArea is a multi-row input field. The XdevTextArea is a form component and can be persisted via the XdevFieldGroup
Wordwrap - Automatically performs a word wrap. Without word wrap, a horizontal scrollbar is displayed.
Misc
Allocate content - Allocates a text as string to the XdevTextArea. This may trigger a textChange or valueChange event.
This is the simplest type of allocation. However, it is 100% functional only with strings. When this method is used, diverse converters deliver an unsatisfactory output.
textArea.setValue("Hello 123 !!!"); |
Allocate content - Allocates a specific value to the XdevTextArea. As an example, a BigDecimal data type for currencies or Double for specific formatting with decimal places, etc.
When this type of allocation is employed, the delivered converter functions optimally.
Property<BigDecimal> betrag = new ObjectProperty<BigDecimal>(new BigDecimal(100), BigDecimal.class); textArea.setPropertyDataSource(betrag); |
or
Property<Double> betrag = new ObjectProperty<Double>(new Double(100), Double.class); textArea.setPropertyDataSource(betrag); |
Change content - If a property is already allocated to the XdevTextArea (refer to example 2), the value can be changed directly in the property in this abbreviated form without setting a new data source.
textArea.setConvertedValue(200); |
Read content
String content = textArea.getValue(); |
Delete content - Deletes the entire content in XdevTextArea. This may trigger a textChange or valueChange event.
textArea.clear(); |
Set cursor - Set the cursor to a specific position. The position is specified as an int value.
textArea.setCursorPosition(10); |
Set focus: Allocates the focus to the XdevTextArea. This can trigger a focus event, if necessary.
textArea.focus(); |
Select content
textArea.selectAll(); |
Convert string to integer: If the content of the XdevTextArea is an integer, with which you want to calculate further, you must convert the string with the Integer.parseInt(String s) method into an integer. The method accepts only a string with characters. Only the characters + and - at the start of the value are permitted.
String content = textArea.getValue(); Integer value = Integer.parseInt(content); |
Convert integer to string: When you want to assign an integer to an XdevTextArea, you must first convert it into a string.
Integer value = 100; String content = Integer.toString(value); textArea.setValue(content); |