Search in sources :

Example 1 with SelectionImpl

use of org.fxmisc.richtext.SelectionImpl in project RichTextFX by FXMisc.

the class MultipleCaretSelectionTests method attempting_to_add_selection_associated_with_different_area_fails.

@Test
public void attempting_to_add_selection_associated_with_different_area_fails() {
    InlineCssTextArea area2 = new InlineCssTextArea();
    Selection<String, String, String> selection = new SelectionImpl<>("test selection", area2);
    interact(() -> {
        try {
            area.addSelection(selection);
            fail();
        } catch (IllegalArgumentException e) {
        // cannot add a selection associated with a different area
        }
    });
}
Also used : SelectionImpl(org.fxmisc.richtext.SelectionImpl) InlineCssTextArea(org.fxmisc.richtext.InlineCssTextArea) InlineCssTextAreaAppTest(org.fxmisc.richtext.InlineCssTextAreaAppTest) Test(org.junit.Test)

Aggregations

InlineCssTextArea (org.fxmisc.richtext.InlineCssTextArea)1 InlineCssTextAreaAppTest (org.fxmisc.richtext.InlineCssTextAreaAppTest)1 SelectionImpl (org.fxmisc.richtext.SelectionImpl)1 Test (org.junit.Test)1