RichTextArea: add insertStyles property

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • jfx26
    • Component/s: javafx
    • None
    • source
    • minimal
    • Java API
    • JDK

      Summary

      Add a new property to the RichTextArea class:

      ObjectProperty<StyleAttributeMap> insertStylesProperty
      

      which allows the control to override the styles used for text typed by the user.

      Problem

      Using the existing APIs it is currently rather difficult to control the styling of the text typed by the user (a custom model is needed). For example, in MS Word, pressing ctrl-B toggles the bold typeface which affects the text typed aftewards.

      Solution

      One solution is to introduce a separate property which will be used by the behavior to control the styling of the text typed by the user. When the property value is null, the styling is determined by the model as before.

      Specification

      --- a/modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/RichTextArea.java
      +++ b/modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/RichTextArea.java
      @@ -594,6 +595,32 @@ public class RichTextArea extends Control {
      +    /**
      +     * Specifies the styles to be in effect for the characters to be inserted via user input.
      +     * The value can be null.
      +     *
      +     * @return the insert styles property
      +     * @defaultValue null
      +     * @since 26
      +     */
      +    public final ObjectProperty<StyleAttributeMap> insertStylesProperty() {
      +
      +    public final StyleAttributeMap getInsertStyles() {
      +
      +    public final void setInsertStyles(StyleAttributeMap v) {
      
      

            Assignee:
            Andy Goryachev
            Reporter:
            Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: