RFR: 8264127: ListCell editing status is true, when index changes while editing
Jeanette Winzenburg
fastegal at openjdk.java.net
Tue Apr 6 13:33:11 UTC 2021
On Sat, 3 Apr 2021 15:20:33 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:
> @kleopatra
> I've added another test for the case, when index changes in such a way, that the cell should no longer be in the editing state,
> and the test seems to work. Do I miss something?
hmm .. that's weird: your test (cell 1 -> listEdit 0 -> cell 0) indeed passes, doing it the other way round (cell 0 -> listEdit 1 -> cell 1) fails
@Test
public void testChangeCellIndex0ToListEditingIndex1() {
assertChangeIndexToEditing(0, 1);
}
@Test
public void testChangeCellIndex1ToListEditingIndex0() {
assertChangeIndexToEditing(1, 0);
}
private void assertChangeIndexToEditing(int initialCellIndex, int listEditingIndex) {
list.setEditable(true);
cell.updateListView(list);
cell.updateIndex(initialCellIndex);
list.edit(listEditingIndex);
assertEquals("sanity: list editingIndex ", listEditingIndex, list.getEditingIndex());
assertFalse("sanity: cell must not be editing", cell.isEditing());
cell.updateIndex(listEditingIndex);
assertEquals("sanity: index updated ", listEditingIndex, cell.getIndex());
assertEquals("list editingIndex unchanged by cell", listEditingIndex, list.getEditingIndex());
assertTrue(cell.isEditing());
}
Something obvious that I missed or a bummer in the test setup or what else? Any ideas?
-------------
PR: https://git.openjdk.java.net/jfx/pull/441
More information about the openjfx-dev
mailing list