@Test public void selectCheckBoxSelectedTriState() throws Throwable { CheckBox checkBox = findCheckbox("Three state checkbox"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { checkBox.setIndeterminate(true); checkBox.setSelected(true); RFXCheckBox rfxCheckBox = new RFXCheckBox(checkBox, null, null, lr); rfxCheckBox.mouseClicked(null); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording select = recordings.get(0); AssertJUnit.assertEquals("recordSelect", select.getCall()); AssertJUnit.assertEquals("indeterminate", select.getParameters()[0]); }
@Override protected void mouseClicked(MouseEvent me) { int selection = getSelection((CheckBox) node); if (prevSelection == null || selection != prevSelection) { recorder.recordSelect(this, JavaFXCheckBoxElement.states[selection]); } prevSelection = selection; }
RFXCheckBox extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { int selection = getSelection((CheckBox) node); if (prevSelection == null || selection != prevSelection) { recorder.recordSelect(this, JavaFXCheckBoxElement.states[selection]); } prevSelection = selection; } }
RFXCheckBox extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { int selection = getSelection((CheckBox) node); if (prevSelection == null || selection != prevSelection) { recorder.recordSelect(this, JavaFXCheckBoxElement.states[selection]); } prevSelection = selection; } RFXCheckBox(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXCheckBox extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { int selection = getSelection((CheckBox) node); if (prevSelection == null || selection != prevSelection) { recorder.recordSelect(this, JavaFXCheckBoxElement.states[selection]); } prevSelection = selection; } RFXCheckBox(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getValue(); @Override String _getText(); }
RFXCheckBox extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { int selection = getSelection((CheckBox) node); if (prevSelection == null || selection != prevSelection) { recorder.recordSelect(this, JavaFXCheckBoxElement.states[selection]); } prevSelection = selection; } RFXCheckBox(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getValue(); @Override String _getText(); static final Logger LOGGER; }