@Test public void select() { HTMLEditor editor = (HTMLEditor) getPrimaryStage().getScene().getRoot().lookup(".html-editor"); LoggingRecorder lr = new LoggingRecorder(); String text = "This is a test text"; final String htmlText = "<html><font color=\"RED\"><h1><This is also content>" + text + "</h1></html>"; Platform.runLater(() -> { RFXHTMLEditor rfxhtmlEditor = new RFXHTMLEditor(editor, null, null, lr); editor.setHtmlText(htmlText); rfxhtmlEditor.focusLost(null); }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording recording = recordings.get(0); AssertJUnit.assertEquals("recordSelect", recording.getCall()); AssertJUnit.assertEquals(htmlText, recording.getParameters()[0]); }
@Override public void focusLost(RFXComponent next) { String currentText = getHTMLEditorText((HTMLEditor) node); if (currentText != null && !currentText.equals(prevText)) { recorder.recordSelect(this, currentText); } }
RFXHTMLEditor extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentText = getHTMLEditorText((HTMLEditor) node); if (currentText != null && !currentText.equals(prevText)) { recorder.recordSelect(this, currentText); } } }
RFXHTMLEditor extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentText = getHTMLEditorText((HTMLEditor) node); if (currentText != null && !currentText.equals(prevText)) { recorder.recordSelect(this, currentText); } } RFXHTMLEditor(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXHTMLEditor extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentText = getHTMLEditorText((HTMLEditor) node); if (currentText != null && !currentText.equals(prevText)) { recorder.recordSelect(this, currentText); } } RFXHTMLEditor(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String _getText(); @Override String getTagName(); }
RFXHTMLEditor extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentText = getHTMLEditorText((HTMLEditor) node); if (currentText != null && !currentText.equals(prevText)) { recorder.recordSelect(this, currentText); } } RFXHTMLEditor(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String _getText(); @Override String getTagName(); static final Logger LOGGER; }