@Test public void selectCheckBoxSelectedTriState() throws Throwable { final LoggingRecorder lr = new LoggingRecorder(); siw(new Runnable() { @Override public void run() { List<Component> comps = ComponentUtils.findComponents(TristateCheckBox.class, frame); TristateCheckBox tcb = (TristateCheckBox) comps.get(0); tcb.setMixed(true); RJideTristateComponent rtcb = new RJideTristateComponent(tcb, null, null, lr); rtcb.mouseClicked(null); } }); Call call = lr.getCall(); AssertJUnit.assertEquals("select", call.getFunction()); AssertJUnit.assertEquals("indeterminate", call.getState()); }
@Override public void mouseClicked(MouseEvent me) { int selected = ((TristateCheckBox) component).getState(); if (selected != prevSelection) { recorder.recordSelect(this, JideTristateCheckBoxElement.states[selected]); } prevSelection = selected; }
RJideTristateComponent extends RComponent { @Override public void mouseClicked(MouseEvent me) { int selected = ((TristateCheckBox) component).getState(); if (selected != prevSelection) { recorder.recordSelect(this, JideTristateCheckBoxElement.states[selected]); } prevSelection = selected; } }
RJideTristateComponent extends RComponent { @Override public void mouseClicked(MouseEvent me) { int selected = ((TristateCheckBox) component).getState(); if (selected != prevSelection) { recorder.recordSelect(this, JideTristateCheckBoxElement.states[selected]); } prevSelection = selected; } RJideTristateComponent(Component source, JSONOMapConfig omapConfig, Point point, IJSONRecorder recorder); }
RJideTristateComponent extends RComponent { @Override public void mouseClicked(MouseEvent me) { int selected = ((TristateCheckBox) component).getState(); if (selected != prevSelection) { recorder.recordSelect(this, JideTristateCheckBoxElement.states[selected]); } prevSelection = selected; } RJideTristateComponent(Component source, JSONOMapConfig omapConfig, Point point, IJSONRecorder recorder); @Override void mouseEntered(MouseEvent me); @Override void mouseClicked(MouseEvent me); }
RJideTristateComponent extends RComponent { @Override public void mouseClicked(MouseEvent me) { int selected = ((TristateCheckBox) component).getState(); if (selected != prevSelection) { recorder.recordSelect(this, JideTristateCheckBoxElement.states[selected]); } prevSelection = selected; } RJideTristateComponent(Component source, JSONOMapConfig omapConfig, Point point, IJSONRecorder recorder); @Override void mouseEntered(MouseEvent me); @Override void mouseClicked(MouseEvent me); static final int STATE_UNSELECTED; static final int STATE_SELECTED; static final int STATE_MIXED; }