--- title: TextArea order: 10 layout: page --- [[components.textarea]] = [classname]#TextArea# ifdef::web[] [.sampler] image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/text-input/text-area"] endif::web[] [classname]#TextArea# is a multi-line version of the [classname]#TextField# component described in <>. The following example creates a simple text area: [source, java] ---- // Create the area TextArea area = new TextArea("Big Area"); // Put some content in it area.setValue("A row\n"+ "Another row\n"+ "Yet another row"); ---- The result is shown in <>. [[figure.components.textarea]] .[classname]#TextArea# Example image::img/textarea-basic.png[width=40%, scaledwidth=50%] You can set the number of visible rows with [methodname]#setRows()# or use the regular [methodname]#setHeight()# to define the height in other units. If the actual number of rows exceeds the number, a vertical scrollbar will appear. Setting the height with [methodname]#setRows()# leaves space for a horizontal scrollbar, so the actual number of visible rows may be one higher if the scrollbar is not visible. You can set the width with the regular [methodname]#setWidth()# method. Setting the size with the __em__ unit, which is relative to the used font size, is recommended. [[components.textarea.wordwrap]] == Word Wrap The [methodname]#setWordwrap()# sets whether long lines are wrapped ( [literal]#++true++# - default) when the line length reaches the width of the writing area. If the word wrap is disabled ( [literal]#++false++#), a vertical scrollbar will appear instead. The word wrap is only a visual feature and wrapping a long line does not insert line break characters in the field value; shortening a wrapped line will undo the wrapping. [source, java] ---- TextArea area1 = new TextArea("Wrapping"); area1.setWordWrap(true); // The default area1.setValue("A quick brown fox jumps over the lazy dog"); TextArea area2 = new TextArea("Nonwrapping"); area2.setWordWrap(false); area2.setValue("Victor jagt zwölf Boxkämpfer quer "+ "über den Sylter Deich"); ---- The result is shown in <>. [[figure.components.textarea.wordwrap]] .Word Wrap in [classname]#TextArea# image::img/textarea-wordwrap.png[width=60%, scaledwidth=100%] [[components.textarea.css]] == CSS Style Rules [source, css] ---- .v-textarea { } ---- The HTML structure of [classname]#TextArea# is extremely simple, consisting only of an element with [literal]#++v-textarea++# style. Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
blob: 582f51beea3348b7ca35f6782c8362c6c6bf348f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

declare(strict_types=1);
/**
 * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

namespace OCP\Collaboration\Reference;

use JsonSerializable;

/**
 * @since 26.0.0
 */
abstract class ADiscoverableReferenceProvider implements IDiscoverableReferenceProvider, JsonSerializable {
	/**
	 * @since 26.0.0
	 */
	public function jsonSerialize(): array {
		$json = [
			'id' => $this->getId(),
			'title' => $this->getTitle(),
			'icon_url' => $this->getIconUrl(),
			'order' => $this->getOrder(),
		];
		if ($this instanceof ISearchableReferenceProvider) {
			$json['search_providers_ids'] = $this->getSupportedSearchProviderIds();
		}
		return $json;
	}
}