From 7f4ff9d20fde6f1f6526fa46f95dc5a40c309a22 Mon Sep 17 00:00:00 2001 From: Jonatan Kronqvist Date: Wed, 7 Sep 2011 06:40:10 +0000 Subject: Fix for #7230 svn changeset:20895/svn branch:6.7 --- .../components/tree/TreeKeyboardNavigationScroll | 87 ++++++++++++++++++++++ .../tree/TreeKeyboardNavigationScrolls.java | 54 ++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll create mode 100644 tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java (limited to 'tests/src') diff --git a/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll b/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll new file mode 100644 index 0000000000..8d03e3aaf3 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScroll @@ -0,0 +1,87 @@ + + + + + + +TreeKeyboardNavigationScroll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.tree.TreeKeyboardNavigationScrolls?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]4,3
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]right
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
pressSpecialKeyvaadin=runcomvaadintestscomponentstreeTreeKeyboardNavigationScrolls::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTree[0]/domChild[1]down
screenCapturenoscroll
+ + diff --git a/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java new file mode 100644 index 0000000000..5bbc5423ab --- /dev/null +++ b/tests/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java @@ -0,0 +1,54 @@ +/* +@ITMillApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.components.tree; + +import com.vaadin.data.Container; +import com.vaadin.data.util.HierarchicalContainer; +import com.vaadin.data.validator.AbstractValidator; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Tree; + +public class TreeKeyboardNavigationScrolls extends TestBase { + + @Override + protected void setup() { + Tree tree = new Tree(); + tree.setContainerDataSource(generateHierarchicalContainer()); + tree.setImmediate(true); + tree.addValidator(new AbstractValidator("failed") { + public boolean isValid(Object value) { + return false; + } + + }); + addComponent(tree); + } + + private Container generateHierarchicalContainer() { + HierarchicalContainer cont = new HierarchicalContainer(); + for (int i = 1; i < 6; i++) { + cont.addItem(i); + for (int j = 1; j < 3; j++) { + String id = i + + " foo bar baz make this node really wide so that we don't have to fiddle with resizing the browser window -> what would you do if you had one of your legs on backwards? it's legs time! everybody get your legs! " + + j; + cont.addItem(id); + cont.setChildrenAllowed(id, false); + cont.setParent(id, i); + } + } + return cont; + } + + @Override + protected String getDescription() { + return "The tree scrolls right if the focused node is too wide when navigating with the keyboard"; + } + + @Override + protected Integer getTicketNumber() { + return 7230; + } + +} -- cgit v1.2.3