Skip to content

Commit 9aaa6b9

Browse files
Fix javadoc errors
1 parent 643a83e commit 9aaa6b9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Let's say that a document has the text {@code |(|t|e|x|t||)|} where each {@code |} represents a position
2020
* in-between the characters of the text . If one wants to remove the opening
2121
* and closing parenthesis in two update calls, they would write:
22+
* </p>
2223
* <pre><code>
2324
* // Text: |(|t|e|x|t|)|
2425
* // Position: 0 1 2 3 4 5 6
@@ -29,14 +30,14 @@
2930
* // Position: 0 1 2 3 4 5
3031
* area.deleteText(4, 5); // delete the second parenthesis
3132
* </code></pre>
32-
* </p>
3333
* <p>
3434
* {@code MultiChangeBuilder} can do the same thing in one call and works by applying earlier changes before
3535
* later ones. However, this creates a problem. Later changes' start and end positions must be updated to still
3636
* point to the correct spot in the text. Wouldn't it be easier to be able to define both changes in the original
3737
* coordinate system of the document before any changes were applied? Returning to the previous example,
3838
* wouldn't it be better if one could write:
39-
* <pre><code>
39+
* </p>
40+
* <pre><code>
4041
* // Text: |(|t|e|x|t|)|
4142
* // Position: 0 1 2 3 4 5 6
4243
*
@@ -45,11 +46,11 @@
4546
* area.deleteText(5, 6); // delete the 2nd parenthesis
4647
* // end multi change
4748
* </code></pre>
48-
* </p>
4949
* <p>
5050
* Fortunately, that is already handled for you. Such changes are known as "relative" changes: their
5151
* start and end positions are updated to point to where they should point once all the earlier changes before
5252
* them have been applied. To execute the same code as before, we would write:
53+
* </p>
5354
* <pre><code>
5455
* area.createMultiChange()
5556
* // deletes the 1st parenthesis
@@ -61,18 +62,17 @@
6162
* // executes the call and updates the document
6263
* .commit();
6364
* </code></pre>
64-
* </p>
6565
* <p>
6666
* However, a developer may sometimes want an "absolute" change: their start and end positions
6767
* are exactly what the developer specifies regardless of how changes before them modify the underlying document.
6868
* For example, the following code would still delete both parenthesis:
69+
* </p>
6970
* <pre><code>
7071
* area.createMultiChange()
7172
* .deleteText(0, 1) // deletes the 1st parenthesis
7273
* .deleteTextAbsolutely(4, 5) // deletes the 2nd parenthesis
7374
* .commit();
7475
* </code></pre>
75-
* </p>
7676
* <p>
7777
* Thus, absolute changes (e.g. {@link #replaceAbsolutely(int, int, StyledDocument)}) are all the methods
7878
* which have "absolute" as a suffix and relative changes (e.g. {@link #replace(int, int, StyledDocument)})

0 commit comments

Comments
 (0)