@Test public void selectRadioButtonSelected() { RadioButton radioButton = (RadioButton) getPrimaryStage().getScene().getRoot().lookup(".radio-button"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { RFXToggleButton rfxToggleButton = new RFXToggleButton(radioButton, null, null, lr); radioButton.setSelected(true); rfxToggleButton.mouseClicked(null); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording select = recordings.get(0); AssertJUnit.assertEquals("recordSelect", select.getCall()); AssertJUnit.assertEquals("true", select.getParameters()[0]); }
@Override protected void mouseClicked(MouseEvent me) { boolean selected = ((ToggleButton) node).isSelected(); if (prevSelection == null || selected != prevSelection.booleanValue()) { recorder.recordSelect(this, Boolean.toString(selected)); } prevSelection = selected; }
RFXToggleButton extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { boolean selected = ((ToggleButton) node).isSelected(); if (prevSelection == null || selected != prevSelection.booleanValue()) { recorder.recordSelect(this, Boolean.toString(selected)); } prevSelection = selected; } }
RFXToggleButton extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { boolean selected = ((ToggleButton) node).isSelected(); if (prevSelection == null || selected != prevSelection.booleanValue()) { recorder.recordSelect(this, Boolean.toString(selected)); } prevSelection = selected; } RFXToggleButton(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXToggleButton extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { boolean selected = ((ToggleButton) node).isSelected(); if (prevSelection == null || selected != prevSelection.booleanValue()) { recorder.recordSelect(this, Boolean.toString(selected)); } prevSelection = selected; } RFXToggleButton(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); }
RFXToggleButton extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { boolean selected = ((ToggleButton) node).isSelected(); if (prevSelection == null || selected != prevSelection.booleanValue()) { recorder.recordSelect(this, Boolean.toString(selected)); } prevSelection = selected; } RFXToggleButton(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); static final Logger LOGGER; }