Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Struckmann2014-03-28 08:26:48 -0400
committerSebastian Struckmann2014-03-28 08:26:48 -0400
commitcbbdd20171fc741e5d84b98429670bba1d72e75e (patch)
treec5c81d0ccab38e00896c66bcb980dbb7d5539e27
parent1d9199f36733d88bab3a044e3d03493c3661becf (diff)
downloadorg.eclipse.jubula.core-cbbdd20171fc741e5d84b98429670bba1d72e75e.tar.gz
org.eclipse.jubula.core-cbbdd20171fc741e5d84b98429670bba1d72e75e.tar.xz
org.eclipse.jubula.core-cbbdd20171fc741e5d84b98429670bba1d72e75e.zip
Sprint task - Support for recursive scrolling in JavaFX toolkit.
-rw-r--r--org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/driver/RobotJavaFXImpl.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/driver/RobotJavaFXImpl.java b/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/driver/RobotJavaFXImpl.java
index 680561e64..55ed5c686 100644
--- a/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/driver/RobotJavaFXImpl.java
+++ b/org.eclipse.jubula.rc.javafx/src/org/eclipse/jubula/rc/javafx/driver/RobotJavaFXImpl.java
@@ -19,7 +19,8 @@ import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
-import java.util.Stack;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.Callable;
import javafx.event.Event;
@@ -136,19 +137,19 @@ public class RobotJavaFXImpl implements IRobot {
*/
private void scrollObjectToVisible(final Node component) {
// scroll all parent scroll panes
- Stack<ScrollPane> panes2Scroll = new Stack<ScrollPane>();
+ List<ScrollPane> panes2Scroll = new ArrayList<ScrollPane>();
Parent p = component.getParent();
while (p != null) {
if (p instanceof ScrollPane) {
- panes2Scroll.push((ScrollPane) p);
+ panes2Scroll.add((ScrollPane) p);
}
p = p.getParent();
}
- // scroll outer panes before inner
- for (int i = 0; i < panes2Scroll.size() - 1; i++) {
- ScrollPane nextPane = panes2Scroll.pop();
- scrollToNode(nextPane, panes2Scroll.peek());
+ // scroll inner panes before outer
+ for (int i = 0; i < panes2Scroll.size(); i++) {
+ ScrollPane nextPane = panes2Scroll.get(i);
+ scrollToNode(nextPane, component);
}
Parent parent = component.getParent();

Back to the top