Interface EditableStyledDocument<PS,​SEG,​S>

    • Method Detail

      • getLength

        int getLength()
        Gets the value of the property length.
        Property description:
      • multiPlainChanges

        default EventStream<List<PlainTextChange>> multiPlainChanges()
        Returns an EventStream that emits a List of PlainTextChanges every time a non-style change is made to this document. A style change would include setting a segment's style, but not changing that segment or setting a paragraph's style. A non-style change would include adding/removing/modifying a segment itself. The emitted list will only have one item in it unless one used replaceMulti(List).
      • isBeingUpdated

        boolean isBeingUpdated()
      • replaceMulti

        void replaceMulti​(List<Replacement<PS,​SEG,​S>> replacements)
        Replaces multiple portions of this document in one update.
      • replace

        void replace​(int start,
                     int end,
                     StyledDocument<PS,​SEG,​S> replacement)
        Replaces the portion of this document "from..to" with the given replacement.
        Parameters:
        start - the absolute position in the document that starts the portion to replace
        end - the absolute position in the document that ends the portion to replace
        replacement - the document that replaces the removed portion of this document
      • setStyle

        void setStyle​(int from,
                      int to,
                      S style)
        Sets the style of all segments in the given "from..to" range to the given style.
        Parameters:
        from - the absolute position in the document that starts the range to re-style
        to - the absolute position in the document that ends the range to re-style
      • setStyle

        void setStyle​(int paragraphIndex,
                      S style)
        Sets all segments in the given paragraph to the given style
      • setStyle

        void setStyle​(int paragraphIndex,
                      int fromCol,
                      int toCol,
                      S style)
        Sets the given range "fromCol..toCol" in the given paragraph to the given style
      • setStyleSpans

        void setStyleSpans​(int from,
                           StyleSpans<? extends S> styleSpens)
        Replaces the style spans for the given range "from..(from + styleSpans.length())" with the given style spans
      • setStyleSpans

        void setStyleSpans​(int paragraphIndex,
                           int from,
                           StyleSpans<? extends S> styleSpens)
        Replaces the style spans for the given range "from..(from + styleSpans.length())" in the given paragraph with the given style spans
      • setParagraphStyle

        void setParagraphStyle​(int paragraphIndex,
                               PS style)
        Sets the given paragraph to the given paragraph style