com.dlsc.gemsfx.TextView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gemsfx Show documentation
Show all versions of gemsfx Show documentation
A collection of JavaFX controls and utils.
package com.dlsc.gemsfx;
import com.dlsc.gemsfx.skins.TextViewSkin;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyStringProperty;
import javafx.beans.property.ReadOnlyStringWrapper;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.MapChangeListener;
import javafx.css.CssMetaData;
import javafx.css.Styleable;
import javafx.css.StyleableObjectProperty;
import javafx.css.StyleableProperty;
import javafx.css.converter.PaintConverter;
import javafx.geometry.Orientation;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Control;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Skin;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* A text view that allows you to display multiline text and supports the selection of
* text, which can then be copied to the clipboard. The user can copy the selected text
* via the OS-specific shortcut for copying content (for example, CTRL-C on Windows or
* Command-C on Mac). Additionally, a context menu is available for copying.
*
* The user can select text by pressing and dragging the mouse, or by double clicking
* on a word. A triple click selects an entire paragraph.
*
*/
public class TextView extends Control {
/**
* Constructs a new text view.
*/
public TextView() {
getStyleClass().add("text-view");
setFocusTraversable(false);
getProperties().addListener((MapChangeListener