Skip to content

Commit

Permalink
Moved convenience API from InlineCSSTextArea to EditActions (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Nov 22, 2019
1 parent 323edc7 commit 5a11be7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions richtextfx/src/main/java/org/fxmisc/richtext/EditActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ default void append(StyledDocument<PS, SEG, S> document) {
insert(getLength(), document);
}

/**
* Append text with a style.
*/
default void append(SEG seg, S style) {
insert(getLength(), seg, style);
}

/**
* Inserts the given text at the given position.
*
Expand Down Expand Up @@ -56,6 +63,13 @@ default void insert(int position, StyledDocument<PS, SEG, S> document) {
replace(position, position, document);
}

/**
* Inserts text with a style at the given position.
*/
default void insert(int position, SEG seg, S style) {
replace(position, position, seg, style);
}

/**
* Inserts the given rich-text content at the position returned from
* {@code getAbsolutePosition(paragraphIndex, columnPosition)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,4 @@ public InlineCssTextArea(@NamedArg("text") String text) {
selectRange(0, 0);
}

/**
* Convenient method to append text together with an inline style.
*/
public void append( String text, String style ) {
insert( getLength(), text, style );
}

/**
* Convenient method to insert text together with an inline style.
*/
public void insert( int position, String text, String style ) {
replace( position, position, text, style );
}

}

0 comments on commit 5a11be7

Please sign in to comment.