Top Description Fields Constructors Methods
com.dlsc.gemsfx

public Class ResizableTextArea

extends TextArea
Class Inheritance
Known Direct Subclasses
com.dlsc.gemsfx.LimitedTextArea
Imports
com.dlsc.gemsfx.skins.ResizableTextAreaSkin, javafx.beans.property.BooleanProperty, .SimpleBooleanProperty, javafx.scene.control.Skin, .TextArea, java.util.Objects

A text area with the additional ability to be resizable. The resizing behaviour can be configured to support resizing in vertical and horizontal direction or only in one of them. Resizing can also be turned off completely. When resizable the text area will display a resize icon in the lower right corner.

Field Summary

Modifier and TypeField and Description
private static final boolean
private static final boolean
private BooleanProperty
private BooleanProperty
Inherited from javafx.scene.control.TextArea:
DEFAULT_PREF_COLUMN_COUNTDEFAULT_PREF_ROW_COUNT

Constructor Summary

AccessConstructor and Description
public
ResizableTextArea()

Constructs a new resizable text area.

public
ResizableTextArea(String text)

Constructs a new resizable text area with the given text.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.TextArea.createDefaultSkin.

Create a new instance of the default skin for this control.

public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final boolean
public final boolean
public final BooleanProperty

Returns:

a BooleanProperty representing the horizontal resize capability.
resizeHorizontalProperty
()

Defines whether the ResizableTextArea supports horizontal resizing.

public final BooleanProperty

Returns:

a BooleanProperty representing the vertical resize capability.
resizeVerticalProperty
()

Defines whether the ResizableTextArea supports vertical resizing.

public final void
setResizeHorizontal(boolean resizeHorizontal)

public final void
setResizeVertical(boolean resizeVertical)

Inherited from javafx.scene.control.TextArea:
getClassCssMetaDatagetControlCssMetaDatagetParagraphsgetPrefColumnCountgetPrefRowCountgetScrollLeftgetScrollTopisWrapTextprefColumnCountPropertyprefRowCountPropertyscrollLeftPropertyscrollTopPropertysetPrefColumnCountsetPrefRowCountsetScrollLeftsetScrollTopsetWrapTextwrapTextProperty

Field Detail

DEFAULT_RESIZE_HORIZONTALback to summary
private static final boolean DEFAULT_RESIZE_HORIZONTAL
DEFAULT_RESIZE_VERTICALback to summary
private static final boolean DEFAULT_RESIZE_VERTICAL
resizeHorizontalback to summary
private BooleanProperty resizeHorizontal
resizeVerticalback to summary
private BooleanProperty resizeVertical

Constructor Detail

ResizableTextAreaback to summary
public ResizableTextArea()

Constructs a new resizable text area.

ResizableTextAreaback to summary
public ResizableTextArea(String text)

Constructs a new resizable text area with the given text.

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.TextArea.createDefaultSkin.

Doc from javafx.scene.control.TextArea.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
isResizeHorizontalback to summary
public final boolean isResizeHorizontal()
isResizeVerticalback to summary
public final boolean isResizeVertical()
resizeHorizontalPropertyback to summary
public final BooleanProperty resizeHorizontalProperty()

Defines whether the ResizableTextArea supports horizontal resizing. If true, users can adjust the width of the ResizableTextArea. If false, the width is fixed.

The default setting is false.

Returns:BooleanProperty

a BooleanProperty representing the horizontal resize capability.

resizeVerticalPropertyback to summary
public final BooleanProperty resizeVerticalProperty()

Defines whether the ResizableTextArea supports vertical resizing. If true, users can adjust the height of the ResizableTextArea. If false, the height is fixed.

The default setting is true.

Returns:BooleanProperty

a BooleanProperty representing the vertical resize capability.

setResizeHorizontalback to summary
public final void setResizeHorizontal(boolean resizeHorizontal)
setResizeVerticalback to summary
public final void setResizeVertical(boolean resizeVertical)