Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2017-11-30 07:04:33 -0500
committerMarvin Mueller2017-11-30 07:04:40 -0500
commit0fb716a6f3a582709706ecbdd7a1d98020420e2f (patch)
treecd3423358e47bf434be96852ade00647bfbb847a
parent2ac9c3e0ad18e24babe9befa5e90d31569a1efec (diff)
downloadorg.eclipse.jubula.core-0fb716a6f3a582709706ecbdd7a1d98020420e2f.tar.gz
org.eclipse.jubula.core-0fb716a6f3a582709706ecbdd7a1d98020420e2f.tar.xz
org.eclipse.jubula.core-0fb716a6f3a582709706ecbdd7a1d98020420e2f.zip
Fix problem with getting the text from a editable ComboBox
-rw-r--r--org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/tester/adapter/ComboBoxAdapter.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/tester/adapter/ComboBoxAdapter.java b/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/tester/adapter/ComboBoxAdapter.java
index ac25c60bd..50daa2454 100644
--- a/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/tester/adapter/ComboBoxAdapter.java
+++ b/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/tester/adapter/ComboBoxAdapter.java
@@ -36,6 +36,7 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.Skin;
+import javafx.scene.control.TextField;
/**
* ComboBox Adapter
@@ -68,13 +69,21 @@ public class ComboBoxAdapter<T extends ComboBox<?>> extends
@Override
public String call() throws Exception {
- ObservableList<Node> children = getRealComponent()
- .getChildrenUnmodifiable();
+ T comboBox = getRealComponent();
+ if (comboBox.isEditable()) {
+ TextField editor = comboBox.getEditor();
+ if (editor != null) {
+ return editor.getText();
+ }
+ }
+ ObservableList<Node> children =
+ comboBox.getChildrenUnmodifiable();
for (Node node : children) {
if (node instanceof ListCell) {
- IComponent adapter = (IComponent)
- AdapterFactoryRegistry.getInstance()
- .getAdapter(IComponent.class, node);
+ IComponent adapter =
+ (IComponent) AdapterFactoryRegistry
+ .getInstance().getAdapter(
+ IComponent.class, node);
if (adapter != null
&& adapter instanceof ITextComponent) {
return ((ITextComponent) adapter).getText();

Back to the top