@Test public void selectColor() { ColorPicker colorPicker = (ColorPicker) getPrimaryStage().getScene().getRoot().lookup(".color-picker"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(() -> { RFXColorPicker rfxColorPicker = new RFXColorPicker(colorPicker, null, null, lr); colorPicker.setValue(Color.rgb(234, 156, 44)); rfxColorPicker.focusLost(null); }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording recording = recordings.get(0); AssertJUnit.assertEquals("recordSelect", recording.getCall()); AssertJUnit.assertEquals("#ea9c2c", recording.getParameters()[0]); }
@Override public void focusLost(RFXComponent next) { String currentColor = getColorCode(((ColorPicker) node).getValue()); if (!currentColor.equals(prevColor)) { recorder.recordSelect(this, currentColor); } }
RFXColorPicker extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentColor = getColorCode(((ColorPicker) node).getValue()); if (!currentColor.equals(prevColor)) { recorder.recordSelect(this, currentColor); } } }
RFXColorPicker extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentColor = getColorCode(((ColorPicker) node).getValue()); if (!currentColor.equals(prevColor)) { recorder.recordSelect(this, currentColor); } } RFXColorPicker(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXColorPicker extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentColor = getColorCode(((ColorPicker) node).getValue()); if (!currentColor.equals(prevColor)) { recorder.recordSelect(this, currentColor); } } RFXColorPicker(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String _getText(); }
RFXColorPicker extends RFXComponent { @Override public void focusLost(RFXComponent next) { String currentColor = getColorCode(((ColorPicker) node).getValue()); if (!currentColor.equals(prevColor)) { recorder.recordSelect(this, currentColor); } } RFXColorPicker(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String _getText(); static final Logger LOGGER; }