Files
Yasuhiro KIMURA 9678929700 Update to 18.1.40
2020-07-24 01:10:28 +09:00

36 lines
814 B
Java

/*-
* Copyright (c) 2001, 2020 Oracle and/or its affiliates. All rights reserved.
*
* See the file LICENSE for license information.
*
* $Id$
*/
package db_guitest;
import java.util.concurrent.Callable;
import javafx.scene.control.ComboBox;
/**
* ComboBoxTask is used to select a value in a combo box, since TestFX has
* issues with that, and it has to be done in the FX thread or else it throws
* an exception.
*/
public class ComboBoxTask implements Callable<Void> {
private final ComboBox comboBox;
private final String item;
public ComboBoxTask(ComboBox comboBox, String item) {
this.comboBox = comboBox;
this.item = item;
}
@Override
public Void call() throws Exception {
comboBox.getSelectionModel().select(item);
return null;
}
}