diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-03-02 14:24:56 +0200 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-03-02 14:24:56 +0200 |
commit | 7ae5f809f7421d3d78aa71cfae4103af79051c2e (patch) | |
tree | b4923f1e7ba05beb3afe26bc660111bd17191ec4 | |
parent | c7ffbcb9cca8c299e9b7d300cc1e30213cb61d00 (diff) | |
parent | d80e178af577697f7af3aa899251367c50f4533c (diff) | |
download | vaadin-framework-7ae5f809f7421d3d78aa71cfae4103af79051c2e.tar.gz vaadin-framework-7ae5f809f7421d3d78aa71cfae4103af79051c2e.zip |
Merge remote-tracking branch 'origin/6.8'
Conflicts:
src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
src/com/vaadin/ui/TabSheet.java
13 files changed, 515 insertions, 28 deletions
diff --git a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css index 892b2958a4..d369cd99f0 100644 --- a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css +++ b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css @@ -13,6 +13,9 @@ width: 100%; overflow:hidden; } +.v-tabsheet-tabitemcell:focus { + outline: none; +} .v-tabsheet-tabitemcell, .v-tabsheet-spacertd { margin: 0; diff --git a/WebContent/VAADIN/themes/chameleon/components/table/table.css b/WebContent/VAADIN/themes/chameleon/components/table/table.css index ea56b14f98..2bc52bc844 100644 --- a/WebContent/VAADIN/themes/chameleon/components/table/table.css +++ b/WebContent/VAADIN/themes/chameleon/components/table/table.css @@ -43,7 +43,7 @@ div.v-table-focus-slot-left { } .v-table tr.v-selected { - background-image: url(/vaadin-demo-site/VAADIN/themes/chameleon/img/grad-light-top2.png); + background-image: url(../../img/grad-light-top2.png); background-position: 0 -1px; } diff --git a/WebContent/VAADIN/themes/reindeer/table/table.css b/WebContent/VAADIN/themes/reindeer/table/table.css index bfbed67f93..9b78d86e34 100644 --- a/WebContent/VAADIN/themes/reindeer/table/table.css +++ b/WebContent/VAADIN/themes/reindeer/table/table.css @@ -149,6 +149,7 @@ } .v-table-header-drag { padding-left: 6px; + height: 16px; } .v-table-header-drag img { height: 16px; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index 5e4b76f828..5b14bede1d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -11,8 +11,19 @@ import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.dom.client.TableElement; +import com.google.gwt.event.dom.client.BlurEvent; +import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.FocusEvent; +import com.google.gwt.event.dom.client.FocusHandler; +import com.google.gwt.event.dom.client.HasBlurHandlers; +import com.google.gwt.event.dom.client.HasFocusHandlers; +import com.google.gwt.event.dom.client.HasKeyDownHandlers; +import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyDownHandler; +import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; @@ -20,18 +31,22 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.user.client.ui.impl.FocusImpl; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ComponentConnector; import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.ConnectorMap; +import com.vaadin.terminal.gwt.client.EventId; +import com.vaadin.terminal.gwt.client.Focusable; import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VCaption; import com.vaadin.terminal.gwt.client.ui.label.VLabel; -public class VTabsheet extends VTabsheetBase { +public class VTabsheet extends VTabsheetBase implements Focusable, + FocusHandler, BlurHandler, KeyDownHandler { private static class VCloseEvent { private Tab tab; @@ -54,7 +69,8 @@ public class VTabsheet extends VTabsheetBase { * Representation of a single "tab" shown in the TabBar * */ - private static class Tab extends SimplePanel { + private static class Tab extends SimplePanel implements HasFocusHandlers, + HasBlurHandlers, HasKeyDownHandlers { private static final String TD_CLASSNAME = CLASSNAME + "-tabitemcell"; private static final String TD_FIRST_CLASSNAME = TD_CLASSNAME + "-first"; @@ -86,6 +102,7 @@ public class VTabsheet extends VTabsheetBase { setStyleName(td, TD_CLASSNAME); div = DOM.createDiv(); + focusImpl.setTabIndex(td, -1); setStyleName(div, DIV_CLASSNAME); DOM.appendChild(td, div); @@ -94,6 +111,9 @@ public class VTabsheet extends VTabsheetBase { .getApplicationConnection()); add(tabCaption); + addFocusHandler(getTabsheet()); + addBlurHandler(getTabsheet()); + addKeyDownHandler(getTabsheet()); } public boolean isHiddenOnServer() { @@ -117,6 +137,9 @@ public class VTabsheet extends VTabsheetBase { public void setEnabledOnServer(boolean enabled) { enabledOnServer = enabled; setStyleName(td, TD_DISABLED_CLASSNAME, !enabled); + if (!enabled) { + focusImpl.setTabIndex(td, -1); + } } public void addClickHandler(ClickHandler handler) { @@ -136,12 +159,20 @@ public class VTabsheet extends VTabsheetBase { * true if the Tab is the first visible Tab */ public void setStyleNames(boolean selected, boolean first) { + // TODO #5100 doesn't belong here + focusImpl.setTabIndex(td, selected ? getTabsheet().tabulatorIndex + : -1); + setStyleName(td, TD_FIRST_CLASSNAME, first); setStyleName(td, TD_SELECTED_CLASSNAME, selected); setStyleName(td, TD_SELECTED_FIRST_CLASSNAME, selected && first); setStyleName(div, DIV_SELECTED_CLASSNAME, selected); } + public boolean isClosable() { + return tabCaption.isClosable(); + } + public void onClose() { closeHandler.onClose(new VCloseEvent(this)); } @@ -179,6 +210,25 @@ public class VTabsheet extends VTabsheetBase { tabCaption.setWidth(tabCaption.getRequiredWidth() + "px"); } + public HandlerRegistration addFocusHandler(FocusHandler handler) { + return addDomHandler(handler, FocusEvent.getType()); + } + + public HandlerRegistration addBlurHandler(BlurHandler handler) { + return addDomHandler(handler, BlurEvent.getType()); + } + + public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { + return addDomHandler(handler, KeyDownEvent.getType()); + } + + public void focus() { + focusImpl.focus(td); + } + + public void blur() { + focusImpl.blur(td); + } } private static class TabCaption extends VCaption { @@ -268,6 +318,10 @@ public class VTabsheet extends VTabsheetBase { } } + public boolean isClosable() { + return closable; + } + @Override public int getRequiredWidth() { int width = super.getRequiredWidth(); @@ -276,7 +330,6 @@ public class VTabsheet extends VTabsheetBase { } return width; } - } static class TabBar extends ComplexPanel implements ClickHandler, @@ -463,7 +516,6 @@ public class VTabsheet extends VTabsheetBase { currentFirst.recalculateCaptionWidth(); return nextVisible; } - } public static final String CLASSNAME = "v-tabsheet"; @@ -475,6 +527,11 @@ public class VTabsheet extends VTabsheetBase { public static final String TAB_STYLE_NAME = "tabstyle"; final Element tabs; // tabbar and 'scroller' container + Tab focusedTab; + int tabulatorIndex = 0; + + private static final FocusImpl focusImpl = FocusImpl.getFocusImplForPanel(); + private final Element scroller; // tab-scroller element private final Element scrollerNext; // tab-scroller next button element private final Element scrollerPrev; // tab-scroller prev button element @@ -484,7 +541,7 @@ public class VTabsheet extends VTabsheetBase { */ private int scrollerIndex = 0; - private final TabBar tb = new TabBar(this); + final TabBar tb = new TabBar(this); final VTabsheetPanel tp = new VTabsheetPanel(); final Element contentNode; @@ -501,16 +558,24 @@ public class VTabsheet extends VTabsheetBase { private String currentStyle; - private void onTabSelected(final int tabIndex) { + /** + * @return Whether the tab could be selected or not. + */ + private boolean onTabSelected(final int tabIndex) { if (disabled || waitingForResponse) { - return; + return false; } final Object tabKey = tabKeys.get(tabIndex); if (disabledTabKeys.contains(tabKey)) { - return; + return false; } if (client != null && activeTabIndex != tabIndex) { tb.selectTab(tabIndex); + + if (focusedTab != null) { + focusedTab = tb.getTab(tabIndex); + } + addStyleDependentName("loading"); // run updating variables in deferred command to bypass some FF // optimization issues @@ -525,7 +590,10 @@ public class VTabsheet extends VTabsheetBase { } }); waitingForResponse = true; + + return true; } + return false; } public ApplicationConnection getApplicationConnection() { @@ -560,6 +628,9 @@ public class VTabsheet extends VTabsheetBase { public VTabsheet() { super(CLASSNAME); + addHandler(this, FocusEvent.getType()); + addHandler(this, BlurEvent.getType()); + // Tab scrolling DOM.setStyleAttribute(getElement(), "overflow", "hidden"); tabs = DOM.createDiv(); @@ -1034,4 +1105,92 @@ public class VTabsheet extends VTabsheetBase { tp.remove(index); } } + + public void onBlur(BlurEvent event) { + if (focusedTab != null && event.getSource() instanceof Tab) { + focusedTab = null; + if (client.hasEventListeners(this, EventId.BLUR)) { + client.updateVariable(id, EventId.BLUR, "", true); + } + } + } + + public void onFocus(FocusEvent event) { + if (focusedTab == null && event.getSource() instanceof Tab) { + focusedTab = (Tab) event.getSource(); + if (client.hasEventListeners(this, EventId.FOCUS)) { + client.updateVariable(id, EventId.FOCUS, "", true); + } + } + } + + public void focus() { + tb.getTab(activeTabIndex).focus(); + } + + public void blur() { + tb.getTab(activeTabIndex).blur(); + } + + public void onKeyDown(KeyDownEvent event) { + if (event.getSource() instanceof Tab) { + int keycode = event.getNativeEvent().getKeyCode(); + + if (keycode == getPreviousTabKey()) { + int newTabIndex = activeTabIndex; + // Find the previous non-disabled tab with wraparound. + do { + newTabIndex = (newTabIndex != 0) ? newTabIndex - 1 : tb + .getTabCount() - 1; + } while (newTabIndex != activeTabIndex + && !onTabSelected(newTabIndex)); + activeTabIndex = newTabIndex; + + // Tab scrolling + if (isScrolledTabs()) { + int newFirstIndex = tb.scrollLeft(scrollerIndex); + if (newFirstIndex != -1) { + scrollerIndex = newFirstIndex; + updateTabScroller(); + } + } + + } else if (keycode == getNextTabKey()) { + int newTabIndex = activeTabIndex; + // Find the next non-disabled tab with wraparound. + do { + newTabIndex = (newTabIndex + 1) % tb.getTabCount(); + } while (newTabIndex != activeTabIndex + && !onTabSelected(newTabIndex)); + activeTabIndex = newTabIndex; + + if (isClippedTabs()) { + int newFirstIndex = tb.scrollRight(scrollerIndex); + if (newFirstIndex != -1) { + scrollerIndex = newFirstIndex; + updateTabScroller(); + } + } + + } else if (keycode == getCloseTabKey()) { + Tab tab = tb.getTab(activeTabIndex); + if (tab.isClosable()) { + tab.onClose(); + removeTab(activeTabIndex); + } + } + } + } + + protected int getPreviousTabKey() { + return KeyCodes.KEY_LEFT; + } + + protected int getNextTabKey() { + return KeyCodes.KEY_RIGHT; + } + + protected int getCloseTabKey() { + return KeyCodes.KEY_DELETE; + } } diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index a651f05cc3..01f808099a 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -14,6 +14,12 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; +import com.vaadin.event.FieldEvents.BlurEvent; +import com.vaadin.event.FieldEvents.BlurListener; +import com.vaadin.event.FieldEvents.BlurNotifier; +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.event.FieldEvents.FocusNotifier; import com.vaadin.terminal.ErrorMessage; import com.vaadin.terminal.KeyMapper; import com.vaadin.terminal.PaintException; @@ -24,6 +30,7 @@ import com.vaadin.terminal.gwt.client.ui.TabsheetBaseConnector; import com.vaadin.terminal.gwt.client.ui.TabsheetConnector; import com.vaadin.terminal.gwt.client.ui.VTabsheet; import com.vaadin.terminal.gwt.server.CommunicationManager; +import com.vaadin.ui.Component.Focusable; import com.vaadin.ui.themes.Reindeer; import com.vaadin.ui.themes.Runo; @@ -57,7 +64,8 @@ import com.vaadin.ui.themes.Runo; * @since 3.0 */ @ClientWidget(TabsheetConnector.class) -public class TabSheet extends AbstractComponentContainer { +public class TabSheet extends AbstractComponentContainer implements Focusable, + FocusNotifier, BlurNotifier { /** * List of component tabs (tab contents). In addition to being on this list, @@ -97,6 +105,8 @@ public class TabSheet extends AbstractComponentContainer { */ private CloseHandler closeHandler; + private int tabIndex; + /** * Constructs a new Tabsheet. Tabsheet is immediate by default, and the * default close handler removes the tab being closed. @@ -365,6 +375,10 @@ public class TabSheet extends AbstractComponentContainer { target.addAttribute("hidetabs", true); } + if (tabIndex != 0) { + target.addAttribute("tabindex", tabIndex); + } + target.startTag("tabs"); Collection<Component> orphaned = new HashSet<Component>(paintedTabs); @@ -660,6 +674,12 @@ public class TabSheet extends AbstractComponentContainer { closeHandler.onTabClose(this, tab); } } + if (variables.containsKey(FocusEvent.EVENT_ID)) { + fireEvent(new FocusEvent(this)); + } + if (variables.containsKey(BlurEvent.EVENT_ID)) { + fireEvent(new BlurEvent(this)); + } } /** @@ -1235,4 +1255,36 @@ public class TabSheet extends AbstractComponentContainer { return components.indexOf(tab.getComponent()); } + @Override + public void focus() { + super.focus(); + } + + public int getTabIndex() { + return tabIndex; + } + + public void setTabIndex(int tabIndex) { + this.tabIndex = tabIndex; + requestRepaint(); + } + + public void addListener(BlurListener listener) { + addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, + BlurListener.blurMethod); + } + + public void removeListener(BlurListener listener) { + removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); + } + + public void addListener(FocusListener listener) { + addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, + FocusListener.focusMethod); + } + + public void removeListener(FocusListener listener) { + removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); + + } } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 1190bb3df3..c9d4ca63a3 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -3967,22 +3967,10 @@ public class Table extends AbstractSelect implements Action.Container, @Override public void containerItemSetChange(Container.ItemSetChangeEvent event) { super.containerItemSetChange(event); - if (event instanceof IndexedContainer.ItemSetChangeEvent) { - IndexedContainer.ItemSetChangeEvent evt = (IndexedContainer.ItemSetChangeEvent) event; - // if the event is not a global one and the added item is outside - // the visible/buffered area, no need to do anything - if (evt.getAddedItemIndex() != -1 - && (firstToBeRenderedInClient >= 0) - && (lastToBeRenderedInClient >= 0) - && (firstToBeRenderedInClient > evt.getAddedItemIndex() || lastToBeRenderedInClient < evt - .getAddedItemIndex())) { - return; - } - } + // ensure that page still has first item in page, ignore buffer refresh // (forced in this method) setCurrentPageFirstItemIndex(getCurrentPageFirstItemIndex(), false); - refreshRowCache(); } diff --git a/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java b/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java index b3a7af42b9..05658e74b1 100644 --- a/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -13,14 +13,14 @@ import java.net.Socket; import java.util.HashMap; import java.util.Map; +import com.vaadin.launcher.util.BrowserLauncher; + import org.mortbay.jetty.Connector; import org.mortbay.jetty.Server; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.security.SslSocketConnector; import org.mortbay.jetty.webapp.WebAppContext; -import com.vaadin.launcher.util.BrowserLauncher; - /** * Class for running Jetty servlet container within Eclipse project. * @@ -105,7 +105,7 @@ public class DevelopmentServerLauncher { + mode + ".\n" + "Running in http://localhost:" - + serverPort + + port + "\n-------------------------------------------------\n"); final Server server = new Server(); diff --git a/tests/testbench/com/vaadin/tests/VerifyBrowserVersion.java b/tests/testbench/com/vaadin/tests/VerifyBrowserVersion.java index aa30a32e19..63deb79f66 100644 --- a/tests/testbench/com/vaadin/tests/VerifyBrowserVersion.java +++ b/tests/testbench/com/vaadin/tests/VerifyBrowserVersion.java @@ -1,6 +1,7 @@ package com.vaadin.tests; import com.vaadin.terminal.gwt.server.WebApplicationContext; +import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Label; @@ -9,7 +10,10 @@ public class VerifyBrowserVersion extends TestBase { @Override protected void setup() { WebApplicationContext context = (WebApplicationContext) getContext(); - addComponent(new Label(context.getBrowser().getBrowserApplication())); + WebBrowser browser = context.getBrowser(); + addComponent(new Label(browser.getBrowserApplication())); + addComponent(new Label("Touch device? " + + (browser.isTouchDevice() ? "YES" : "No"))); } @Override diff --git a/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.html b/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.html new file mode 100644 index 0000000000..ba1e177235 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.html @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8067/" /> +<title>AddNonRenderedRow</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">AddNonRenderedRow</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.table.AddNonRenderedRow?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableAddNonRenderedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableAddNonRenderedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableAddNonRenderedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>scroll</td> + <td>vaadin=runcomvaadintestscomponentstableAddNonRenderedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>40</td> +</tr> +<tr> + <td>pause</td> + <td>300</td> + <td></td> +</tr> +<tr> + <td>assertTextPresent</td> + <td>7</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show-item-7</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/table/TableGeneratedRows-chameleon.html b/tests/testbench/com/vaadin/tests/components/table/TableGeneratedRows-chameleon.html new file mode 100644 index 0000000000..8a83f27701 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableGeneratedRows-chameleon.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.table.Tables?restartApplication&theme=chameleon</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>46,13</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> + <td>42,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item6</td> + <td>82,3</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item1</td> + <td>56,4</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>spanned</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>29,3</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>30,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>27,4</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> + <td>47,13</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item6</td> + <td>80,2</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item2</td> + <td>80,8</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>nospan</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>36,12</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> + <td>47,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item6</td> + <td>95,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item3</td> + <td>67,12</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>html</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple-chameleon.html b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple-chameleon.html new file mode 100644 index 0000000000..f13bd22e84 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple-chameleon.html @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.table.TableMultiSelectSimple?restartApplication&theme=chameleon</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>28,17</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>48,11</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]</td> + <td>48,9</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>0-2-4Selected</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]</td> + <td>38,18</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>32,13</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>35,13</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>NoSelection</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java new file mode 100644 index 0000000000..43f3380e16 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java @@ -0,0 +1,54 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.Layout; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class TabKeyboardNavigation extends TestBase { + + int index = 1; + TabSheet ts = new TabSheet(); + + @Override + protected void setup() { + ts.setWidth("500px"); + ts.setHeight("500px"); + for (int i = 0; i < 4; ++i) { + addTab(); + } + Button b = new Button("Add a tab", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + addTab(); + } + }); + addComponent(b); + addComponent(new TextField()); + addComponent(ts); + addComponent(new TextField()); + } + + @Override + protected String getDescription() { + return "The tab bar should be focusable and arrow keys should switch tabs"; + } + + @Override + protected Integer getTicketNumber() { + return 5100; + } + + private Tab addTab() { + Layout content = new VerticalLayout(); + content.addComponent(new Label("Tab " + index)); + content.addComponent(new TextField()); + Tab tab = ts.addTab(content, "Tab " + index++, null); + tab.setClosable(true); + return tab; + } +} diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java index 0c4d1f2f03..467705a103 100644 --- a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java +++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java @@ -68,7 +68,7 @@ public class GridLayoutTests extends AbstractLayoutTests { glo.replaceComponent(row3, row3 = new DateField()); ((DateField) row1).setResolution(DateField.RESOLUTION_SEC); ((DateField) row2).setResolution(DateField.RESOLUTION_SEC); - ((DateField) row2).setResolution(DateField.RESOLUTION_SEC); + ((DateField) row3).setResolution(DateField.RESOLUTION_SEC); glo.setComponentAlignment(col2, alignments[6]); glo.setComponentAlignment(col3, alignments[7]); glo.setComponentAlignment(col1, alignments[8]); |