@Test public void selectMultipleItemSelection() { ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { MultipleSelectionModel<?> selectionModel = listView.getSelectionModel(); selectionModel.setSelectionMode(SelectionMode.MULTIPLE); selectionModel.selectIndices(2, 6); RFXListView rfxListView = new RFXListView(listView, null, null, lr); rfxListView.focusLost(new RFXListView(null, null, null, lr)); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording recording = recordings.get(0); AssertJUnit.assertEquals("recordSelect", recording.getCall()); AssertJUnit.assertEquals("[\"Long Row 3\",\"Row 7\"]", recording.getParameters()[0]); }
@Override public void focusLost(RFXComponent next) { ListView<?> listView = (ListView<?>) node; String currentCellValue = getListCellValue(listView, index); if (currentCellValue != null && !currentCellValue.equals(cellValue)) { recorder.recordSelect2(this, currentCellValue, true); } if ((next == null || getComponent() != next.getComponent()) && listView.getSelectionModel().getSelectedIndices().size() > 1) { String currListText = getListSelectionText(listView); if (!currListText.equals(listSelectionText)) { recorder.recordSelect(this, currListText); } } }
RFXListView extends RFXComponent { @Override public void focusLost(RFXComponent next) { ListView<?> listView = (ListView<?>) node; String currentCellValue = getListCellValue(listView, index); if (currentCellValue != null && !currentCellValue.equals(cellValue)) { recorder.recordSelect2(this, currentCellValue, true); } if ((next == null || getComponent() != next.getComponent()) && listView.getSelectionModel().getSelectedIndices().size() > 1) { String currListText = getListSelectionText(listView); if (!currListText.equals(listSelectionText)) { recorder.recordSelect(this, currListText); } } } }
RFXListView extends RFXComponent { @Override public void focusLost(RFXComponent next) { ListView<?> listView = (ListView<?>) node; String currentCellValue = getListCellValue(listView, index); if (currentCellValue != null && !currentCellValue.equals(cellValue)) { recorder.recordSelect2(this, currentCellValue, true); } if ((next == null || getComponent() != next.getComponent()) && listView.getSelectionModel().getSelectedIndices().size() > 1) { String currListText = getListSelectionText(listView); if (!currListText.equals(listSelectionText)) { recorder.recordSelect(this, currListText); } } } RFXListView(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXListView extends RFXComponent { @Override public void focusLost(RFXComponent next) { ListView<?> listView = (ListView<?>) node; String currentCellValue = getListCellValue(listView, index); if (currentCellValue != null && !currentCellValue.equals(cellValue)) { recorder.recordSelect2(this, currentCellValue, true); } if ((next == null || getComponent() != next.getComponent()) && listView.getSelectionModel().getSelectedIndices().size() > 1) { String currListText = getListSelectionText(listView); if (!currListText.equals(listSelectionText)) { recorder.recordSelect(this, currListText); } } } RFXListView(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String getCellInfo(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String _getText(); }
RFXListView extends RFXComponent { @Override public void focusLost(RFXComponent next) { ListView<?> listView = (ListView<?>) node; String currentCellValue = getListCellValue(listView, index); if (currentCellValue != null && !currentCellValue.equals(cellValue)) { recorder.recordSelect2(this, currentCellValue, true); } if ((next == null || getComponent() != next.getComponent()) && listView.getSelectionModel().getSelectedIndices().size() > 1) { String currListText = getListSelectionText(listView); if (!currListText.equals(listSelectionText)) { recorder.recordSelect(this, currListText); } } } RFXListView(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override void focusGained(RFXComponent prev); @Override void focusLost(RFXComponent next); @Override String getCellInfo(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String _getText(); static final Logger LOGGER; }