constructDocument(SegmentOps, Object, Consumer) or one of its constructors and
build() for easily creating a ReadOnlyStyledDocument from a list
of Paragraphs that is constructed via "addParagraph(s)" methods.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final PS | |
| private final List | |
| private final SegmentOps |
| Access | Constructor and Description |
|---|---|
| public | ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S>
the segmentOps, PS SegmentOps to use for each call to one of the Paragraph's constructors.the default paragraph style to use when one is not specified in the
"addParagraph"-prefixed methods defaultParagraphStyle)Creates a builder |
| public | ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S>
the segmentOps, PS SegmentOps to use for each call to one of the Paragraph's constructors.the default paragraph style to use when one is not specified in the
"addParagraph"-prefixed methods defaultParagraphStyle, int the initial capacity of the underlying initialCapacity)ArrayList.Creates a builder |
| private | ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle, List<Paragraph<PS, SEG, S>> list)
|
| Modifier and Type | Method and Description |
|---|---|
| private ReadOnlyStyledDocumentBuilder | |
| public ReadOnlyStyledDocumentBuilder | addParagraph(List<StyledSegment<SEG, S>> styledSegments)
Adds to the list a paragraph that is constructed using the list of |
| public ReadOnlyStyledDocumentBuilder | addParagraph(List<StyledSegment<SEG, S>> styledSegments, PS paragraphStyle)
Adds to the list a paragraph that is constructed using the list of |
| public ReadOnlyStyledDocumentBuilder | addParagraph(SEG segment, S style)
Adds to the list a paragraph that has only one segment that has the same given style throughout. |
| public ReadOnlyStyledDocumentBuilder | addParagraph(SEG segment, S style, PS paragraphStyle)
Adds to the list a paragraph that has only one segment that has the same given style throughout. |
| public ReadOnlyStyledDocumentBuilder | addParagraph(SEG segment, StyleSpans<S> styles)
Adds to the list a paragraph that has only one segment but a number of different styles throughout that segment |
| public ReadOnlyStyledDocumentBuilder | addParagraph(SEG segment, StyleSpans<S> styles, PS paragraphStyle)
Adds to the list a paragraph that has only one segment but a number of different styles throughout that segment |
| public ReadOnlyStyledDocumentBuilder | addParagraph(List<SEG> segments, StyleSpans<S> styles)
Adds to the list a paragraph that has multiple segments with multiple styles throughout those segments |
| public ReadOnlyStyledDocumentBuilder | addParagraph(List<SEG> segments, StyleSpans<S> styles, PS paragraphStyle)
Adds to the list a paragraph that has multiple segments with multiple styles throughout those segments |
| private <T> ReadOnlyStyledDocumentBuilder | addParagraphList(List<T> paragraphContentList, StyleSpans<S> spansThroughoutDocument, Function<T, PS> getStyle, Function<T, List<SEG>> getSegList)
|
| public ReadOnlyStyledDocumentBuilder | addParagraphs(List<List<SEG>>
each item is the list of segments for a single paragraph listOfSegLists, StyleSpans<S> style spans for the entire document. It's length should be equal to the length
of all the segments' length combined entireDocumentStyleSpans)Adds multiple paragraphs to the list, using the |
| public ReadOnlyStyledDocumentBuilder | addParagraphs0(List<Tuple2<PS, List<SEG>>>
each item is a Tuple2 that represents the paragraph style and segment list
for a single paragraph. If the paragraph style is paragraphArgList, StyleSpans<S> null,
the defaultParagraphStyle will be used instead.style spans for the entire document. It's length should be equal to the length
of all the segments' length combined entireDocumentStyleSpans)Adds multiple paragraphs to the list, allowing one to specify each paragraph's paragraph style. |
| private PS | argumentOrDefault(PS paragraphStyle)
Returns the argument if it is not null; otherwise, returns |
| public ReadOnlyStyledDocument | |
| public static <PS, SEG, S> ReadOnlyStyledDocument | constructDocument(SegmentOps<SEG, S>
the segmentOps, PS SegmentOps object to use for one of the Paragraph's constructorsthe paragraph style object to use when it is not specified in the
"addParagraph" methods defaultParagraphStyle, Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> call the builder's configuration)addParagraph(Object, Object) methods hereConstructs a list of paragraphs |
| public static <PS, SEG, S> ReadOnlyStyledDocument | constructDocument(SegmentOps<SEG, S>
the segmentOps, PS SegmentOps object to use for one of the Paragraph's constructorsthe paragraph style object to use when it is not specified in the
"addParagraph" methods defaultParagraphStyle, int the initial capaicty for the underlying initialCapacity, Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> ArrayListcall the builder's configuration)addParagraph(Object, Object) methods hereConstructs a list of paragraphs |
| private void |
| alreadyCreated | back to summary |
|---|---|
| private boolean alreadyCreated | |
| defaultParagraphStyle | back to summary |
|---|---|
| private final PS defaultParagraphStyle | |
| paragraphList | back to summary |
|---|---|
| private final List<Paragraph<PS, SEG, S>> paragraphList | |
| segmentOps | back to summary |
|---|---|
| private final SegmentOps<SEG, S> segmentOps | |
| ReadOnlyStyledDocumentBuilder | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle) Creates a builder
| |
| ReadOnlyStyledDocumentBuilder | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle, int initialCapacity) Creates a builder
| |
| ReadOnlyStyledDocumentBuilder | back to summary |
|---|---|
| private ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle, List<Paragraph<PS, SEG, S>> list) | |
| addPar | back to summary |
|---|---|
| private ReadOnlyStyledDocumentBuilder | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that is constructed using the list of | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that is constructed using the list of | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has only one segment that has the same given style throughout. | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has only one segment that has the same given style throughout. | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has only one segment but a number of different styles throughout that segment | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has only one segment but a number of different styles throughout that segment | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has multiple segments with multiple styles throughout those segments | |
| addParagraph | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds to the list a paragraph that has multiple segments with multiple styles throughout those segments | |
| addParagraphList | back to summary |
|---|---|
| private <T> ReadOnlyStyledDocumentBuilder | |
| addParagraphs | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds multiple paragraphs to the list, using the
| |
| addParagraphs0 | back to summary |
|---|---|
| public ReadOnlyStyledDocumentBuilder Adds multiple paragraphs to the list, allowing one to specify each paragraph's paragraph style.
| |
| argumentOrDefault | back to summary |
|---|---|
| private PS argumentOrDefault(PS paragraphStyle) Returns the argument if it is not null; otherwise, returns | |
| build | back to summary |
|---|---|
| public ReadOnlyStyledDocument Returns an unmodifiable list of the constructed | |
| constructDocument | back to summary |
|---|---|
| public static <PS, SEG, S> ReadOnlyStyledDocument Constructs a list of paragraphs
| |
| constructDocument | back to summary |
|---|---|
| public static <PS, SEG, S> ReadOnlyStyledDocument Constructs a list of paragraphs
| |
| ensureNotYetCreated | back to summary |
|---|---|
| private void ensureNotYetCreated() | |