diff options
author | Heikki Ohinmaa <heikki@vaadin.com> | 2014-08-07 13:27:14 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-08-07 13:31:08 +0000 |
commit | 7a243926ca0b744f62078b78706ee6e71421ba33 (patch) | |
tree | 5cff3d695ccef4bb62fc8d42fe8f2be9742208b1 | |
parent | ff47bdd97b03a42dfc812b4dc9ad71fa45ce3827 (diff) | |
download | vaadin-framework-7a243926ca0b744f62078b78706ee6e71421ba33.tar.gz vaadin-framework-7a243926ca0b744f62078b78706ee6e71421ba33.zip |
Context menu is not shown in Table body on mobile browsers (#13694)
Includes updated tests.
Change-Id: I928b888302a2cd22b7c94600fd4f8b7608ba0ca8
12 files changed, 382 insertions, 76 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 6a1e8664ed..c1e83ef08b 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -47,8 +47,6 @@ import com.google.gwt.dom.client.TableSectionElement; import com.google.gwt.dom.client.Touch; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; -import com.google.gwt.event.dom.client.ContextMenuEvent; -import com.google.gwt.event.dom.client.ContextMenuHandler; import com.google.gwt.event.dom.client.FocusEvent; import com.google.gwt.event.dom.client.FocusHandler; import com.google.gwt.event.dom.client.KeyCodes; @@ -129,6 +127,137 @@ public class VScrollTable extends FlowPanel implements HasWidgets, ScrollHandler, VHasDropHandler, FocusHandler, BlurHandler, Focusable, ActionOwner, SubPartAware, DeferredWorker { + /** + * Simple interface for parts of the table capable of owning a context menu. + * + * @since 7.2 + * @author Vaadin Ltd + */ + private interface ContextMenuOwner { + public void showContextMenu(Event event); + } + + /** + * Handles showing context menu on "long press" from a touch screen. + * + * @since 7.2 + * @author Vaadin Ltd + */ + private class TouchContextProvider { + private static final int TOUCH_CONTEXT_MENU_TIMEOUT = 500; + private Timer contextTouchTimeout; + + private Event touchStart; + private int touchStartY; + private int touchStartX; + + private ContextMenuOwner target; + + /** + * Initializes a handler for a certain context menu owner. + * + * @param target + * the owner of the context menu + */ + public TouchContextProvider(ContextMenuOwner target) { + this.target = target; + } + + /** + * Cancels the current context touch timeout. + */ + public void cancel() { + if (contextTouchTimeout != null) { + contextTouchTimeout.cancel(); + contextTouchTimeout = null; + } + touchStart = null; + } + + /** + * A function to handle touch context events in a table. + * + * @param event + * browser event to handle + */ + public void handleTouchEvent(final Event event) { + int type = event.getTypeInt(); + + switch (type) { + case Event.ONCONTEXTMENU: + target.showContextMenu(event); + break; + case Event.ONTOUCHSTART: + // save position to fields, touches in events are same + // instance during the operation. + touchStart = event; + + Touch touch = event.getChangedTouches().get(0); + touchStartX = touch.getClientX(); + touchStartY = touch.getClientY(); + + if (contextTouchTimeout == null) { + contextTouchTimeout = new Timer() { + + @Override + public void run() { + if (touchStart != null) { + // Open the context menu if finger + // is held in place long enough. + target.showContextMenu(touchStart); + event.preventDefault(); + touchStart = null; + } + } + }; + } + contextTouchTimeout.schedule(TOUCH_CONTEXT_MENU_TIMEOUT); + break; + case Event.ONTOUCHCANCEL: + case Event.ONTOUCHEND: + cancel(); + break; + case Event.ONTOUCHMOVE: + if (isSignificantMove(event)) { + // Moved finger before the context menu timer + // expired, so let the browser handle the event. + cancel(); + } + } + } + + /** + * Calculates how many pixels away the user's finger has traveled. This + * reduces the chance of small non-intentional movements from canceling + * the long press detection. + * + * @param event + * the Event for which to check the move distance + * @return true if this is considered an intentional move by the user + */ + protected boolean isSignificantMove(Event event) { + if (touchStart == null) { + // no touch start + return false; + } + + // Calculate the distance between touch start and the current touch + // position + Touch touch = event.getChangedTouches().get(0); + int deltaX = touch.getClientX() - touchStartX; + int deltaY = touch.getClientY() - touchStartY; + int delta = deltaX * deltaX + deltaY * deltaY; + + // Compare to the square of the significant move threshold to remove + // the need for a square root + if (delta > TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD + * TouchScrollDelegate.SIGNIFICANT_MOVE_THRESHOLD) { + return true; + } + return false; + } + } + public static final String STYLENAME = "v-table"; public enum SelectMode { @@ -372,8 +501,49 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public final TableFooter tFoot = new TableFooter(); + /** Handles context menu for table body */ + private ContextMenuOwner contextMenuOwner = new ContextMenuOwner() { + + @Override + public void showContextMenu(Event event) { + int left = Util.getTouchOrMouseClientX(event); + int top = Util.getTouchOrMouseClientY(event); + boolean menuShown = handleBodyContextMenu(left, top); + if (menuShown) { + event.stopPropagation(); + event.preventDefault(); + } + } + }; + + /** Handles touch events to display a context menu for table body */ + private TouchContextProvider touchContextProvider = new TouchContextProvider( + contextMenuOwner); + + /** + * For internal use only. May be removed or replaced in the future. + * + * Overwrites onBrowserEvent function on FocusableScrollPanel to give event + * access to touchContextProvider. Has to be public to give TableConnector + * access to the scrollBodyPanel field. + * + * @since 7.2 + * @author Vaadin Ltd + */ + public class FocusableScrollContextPanel extends FocusableScrollPanel { + @Override + public void onBrowserEvent(Event event) { + super.onBrowserEvent(event); + touchContextProvider.handleTouchEvent(event); + }; + + public FocusableScrollContextPanel(boolean useFakeFocusElement) { + super(useFakeFocusElement); + } + } + /** For internal use only. May be removed or replaced in the future. */ - public final FocusableScrollPanel scrollBodyPanel = new FocusableScrollPanel( + public final FocusableScrollContextPanel scrollBodyPanel = new FocusableScrollContextPanel( true); private KeyPressHandler navKeyPressHandler = new KeyPressHandler() { @@ -613,16 +783,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } scrollBodyPanel.addKeyUpHandler(navKeyUpHandler); - scrollBodyPanel.sinkEvents(Event.TOUCHEVENTS); - - scrollBodyPanel.sinkEvents(Event.ONCONTEXTMENU); - scrollBodyPanel.addDomHandler(new ContextMenuHandler() { - - @Override - public void onContextMenu(ContextMenuEvent event) { - handleBodyContextMenu(event); - } - }, ContextMenuEvent.getType()); + scrollBodyPanel.sinkEvents(Event.TOUCHEVENTS | Event.ONCONTEXTMENU); setStyleName(STYLENAME); @@ -684,19 +845,23 @@ public class VScrollTable extends FlowPanel implements HasWidgets, }); } - private void handleBodyContextMenu(ContextMenuEvent event) { + /** + * Handles a context menu event on table body. + * + * @param left + * left position of the context menu + * @param top + * top position of the context menu + * @return true if a context menu was shown, otherwise false + */ + private boolean handleBodyContextMenu(int left, int top) { if (enabled && bodyActionKeys != null) { - int left = Util.getTouchOrMouseClientX(event.getNativeEvent()); - int top = Util.getTouchOrMouseClientY(event.getNativeEvent()); top += Window.getScrollTop(); left += Window.getScrollLeft(); client.getContextMenu().showAt(this, left, top); - - // Only prevent browser context menu if there are action handlers - // registered - event.stopPropagation(); - event.preventDefault(); + return true; } + return false; } /** @@ -2420,7 +2585,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets, int firstRendered = scrollBody.getFirstRendered(); int lastRendered = scrollBody.getLastRendered(); - if (lastRendered > totalRows) { lastRendered = totalRows - 1; } @@ -5137,7 +5301,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return -1; } - public class VScrollTableRow extends Panel implements ActionOwner { + public class VScrollTableRow extends Panel implements ActionOwner, + ContextMenuOwner { private static final int TOUCHSCROLL_TIMEOUT = 100; private static final int DRAGMODE_MULTIROW = 2; @@ -5155,6 +5320,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private Timer dragTouchTimeout; private int touchStartY; private int touchStartX; + + private TouchContextProvider touchContextProvider = new TouchContextProvider( + this); + private TooltipInfo tooltipInfo = null; private Map<TableCellElement, TooltipInfo> cellToolTips = new HashMap<TableCellElement, TooltipInfo>(); private boolean isDragging = false; @@ -5610,6 +5779,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, boolean touchEventHandled = false; if (enabled && hasNativeTouchScrolling) { + touchContextProvider.handleTouchEvent(event); + final Element targetTdOrTr = getEventTargetTdOrTr(event); final int type = event.getTypeInt(); @@ -5870,9 +6041,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, Util.simulateClickFromTouchEvent(touchStart, this); touchStart = null; } - if (contextTouchTimeout != null) { - contextTouchTimeout.cancel(); - } + touchContextProvider.cancel(); break; case Event.ONTOUCHMOVE: if (isSignificantMove(event)) { @@ -5887,9 +6056,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, .getActiveScrollDelegate() == null)) { startRowDrag(touchStart, type, targetTdOrTr); } - if (contextTouchTimeout != null) { - contextTouchTimeout.cancel(); - } + touchContextProvider.cancel(); /* * Avoid clicks and drags by clearing touch start * flag. @@ -6125,6 +6292,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return getTdOrTr(eventTarget); } + @Override public void showContextMenu(Event event) { if (enabled && actionKeys != null) { // Show context menu if there are registered action handlers @@ -6291,7 +6459,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public Widget getWidgetForPaintable() { return this; } - } protected class VScrollTableGeneratedRow extends VScrollTableRow { diff --git a/uitest/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html b/uitest/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html index 62e3786a44..88ff0c01e7 100644 --- a/uitest/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html +++ b/uitest/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html @@ -55,7 +55,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>32,9</td> </tr> <!-- Moved here to avoid Opera issue #5588 --> @@ -71,7 +71,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VLabel[0]</td> <td>22,6</td> </tr> <tr> @@ -86,7 +86,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[1]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[1]/domChild[0]</td> <td></td> </tr> <tr> @@ -96,7 +96,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VLabel[0]</td> <td>22,6</td> </tr> <tr> @@ -106,7 +106,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VEmbedded[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VEmbedded[0]/domChild[0]</td> <td>19,14</td> </tr> <tr> @@ -116,7 +116,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VEmbedded[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableLabelEmbeddedClickThroughForTable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VEmbedded[0]/domChild[0]</td> <td>16,15</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/PropertyValueChange.html b/uitest/src/com/vaadin/tests/components/table/PropertyValueChange.html index 71d323cdc0..b5904120d6 100644 --- a/uitest/src/com/vaadin/tests/components/table/PropertyValueChange.html +++ b/uitest/src/com/vaadin/tests/components/table/PropertyValueChange.html @@ -28,7 +28,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VFilterSelect[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VFilterSelect[0]/domChild[1]</td> <td></td> </tr> <tr> @@ -48,7 +48,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> <tr> @@ -58,7 +58,7 @@ </tr> <tr> <td>type</td> - <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstablePropertyValueChange::PID_Seditortable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td>9</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/SetDataSourceWithPropertyIds.html b/uitest/src/com/vaadin/tests/components/table/SetDataSourceWithPropertyIds.html index 6975ef84d4..02132e45a7 100644 --- a/uitest/src/com/vaadin/tests/components/table/SetDataSourceWithPropertyIds.html +++ b/uitest/src/com/vaadin/tests/components/table/SetDataSourceWithPropertyIds.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> <tr> @@ -38,7 +38,7 @@ </tr> <tr> <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> <tr> @@ -53,7 +53,7 @@ </tr> <tr> <td>assertElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> <tr> @@ -68,7 +68,7 @@ </tr> <tr> <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> <tr> @@ -83,7 +83,7 @@ </tr> <tr> <td>assertElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSetDataSourceWithPropertyIds::PID_Stable/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td></td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.html b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.html index 51f13af004..21d2d7f3b3 100644 --- a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.html +++ b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>Label 0</td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> <td>Label 14</td> </tr> <tr> @@ -58,22 +58,22 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>Label 0</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td> <td>Label 10</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td> <td>Label 19</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> <td>Label 4</td> </tr> <tr> @@ -98,17 +98,17 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>Label 9</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td> <td>Label 19</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> <td>Label 13</td> </tr> <tr> @@ -133,17 +133,17 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>Label 9</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td> <td>Label 19</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> <td>Label 13</td> </tr> <tr> @@ -168,22 +168,22 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td> <td>Label 0</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td> <td>Label 10</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td> <td>Label 19</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td> <td>Label 4</td> </tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html b/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html index 9c8a12fe15..f2a3a06254 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html +++ b/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertElementWidth</td> - <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td>80</td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>assertElementWidth</td> - <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td>120</td> </tr> <tr> @@ -43,7 +43,7 @@ </tr> <tr> <td>assertElementWidth</td> - <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td>80</td> </tr> <tr> @@ -53,7 +53,7 @@ </tr> <tr> <td>assertElementWidth</td> - <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td> <td>100</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html index e5b1f47f2d..5116fceb49 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html +++ b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html @@ -28,7 +28,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td> <td>This is a test item with long text so that there is something to see Nr. 100. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE</td> </tr> <tr> @@ -43,7 +43,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td> <td>This is a test item with long text so that there is something to see Nr. 200. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE</td> </tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.html b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.html index 96df94148c..c6ccb4df73 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.html +++ b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.html @@ -28,12 +28,12 @@ </tr> <tr> <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentstableTableSqlContainer::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VPopupCalendar[0]#field</td> + <td>vaadin=runcomvaadintestscomponentstableTableSqlContainer::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VPopupCalendar[0]#field</td> <td>5/24/13</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableTableSqlContainer::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VPopupCalendar[0]#popupButton</td> + <td>vaadin=runcomvaadintestscomponentstableTableSqlContainer::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VPopupCalendar[0]#popupButton</td> <td>9,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.html b/uitest/src/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.html index 5364b1cd1e..0fb4648387 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.html +++ b/uitest/src/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.html @@ -23,7 +23,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -58,7 +58,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -83,7 +83,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithContainerRequiringEqualsForItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TabletContextMenu.java b/uitest/src/com/vaadin/tests/components/table/TabletContextMenu.java new file mode 100644 index 0000000000..193cb499a7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TabletContextMenu.java @@ -0,0 +1,139 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.event.Action; +import com.vaadin.event.Action.Handler; +import com.vaadin.event.ShortcutAction; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Table; + +/** + * A test UI for context menus on different parts of a VSCrollTable. + * + * This UI has no attached unit test due to the poor support of touch events on + * Selenium. + * + * @since + * @author Vaadin Ltd + */ +public class TabletContextMenu extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + setSizeFull(); + + HorizontalLayout layout = new HorizontalLayout(); + layout.setSizeFull(); + layout.setSpacing(true); + addComponent(layout); + + Table table1 = createTable("no scrolling, has context menu"); + addActionHandler(table1); + table1.addItem(); + layout.addComponent(table1); + + Table table2 = createTable("should scroll, has context menu"); + for (int i = 0; i < 100; ++i) { + table2.addItem(); + } + addActionHandler(table2); + layout.addComponent(table2); + + Table table3 = createTable("no scrolling, no context menu"); + table3.addItem(); + layout.addComponent(table3); + + Table table4 = createTable("should scroll, no context menu"); + for (int i = 0; i < 100; ++i) { + table4.addItem(); + } + layout.addComponent(table4); + } + + private Table createTable(String caption) { + Table table = new Table(caption); + table.setImmediate(true); + + table.addContainerProperty("column1", String.class, "test"); + table.setSizeFull(); + table.setHeight("500px"); + table.setSelectable(true); + + return table; + } + + private void addActionHandler(Table table) { + table.addActionHandler(new Handler() { + + Action tabNext = new ShortcutAction("Shift", + ShortcutAction.KeyCode.TAB, null); + Action tabPrev = new ShortcutAction("Shift+Tab", + ShortcutAction.KeyCode.TAB, + new int[] { ShortcutAction.ModifierKey.SHIFT }); + Action curDown = new ShortcutAction("Down", + ShortcutAction.KeyCode.ARROW_DOWN, null); + Action curUp = new ShortcutAction("Up", + ShortcutAction.KeyCode.ARROW_UP, null); + Action enter = new ShortcutAction("Enter", + ShortcutAction.KeyCode.ENTER, null); + Action add = new ShortcutAction("Add Below", + ShortcutAction.KeyCode.A, null); + Action delete = new ShortcutAction("Delete", + ShortcutAction.KeyCode.DELETE, null); + + @Override + public void handleAction(Action action, Object sender, Object target) { + System.out.println(action.getCaption()); + } + + @Override + public Action[] getActions(Object target, Object sender) { + return new Action[] { tabNext, tabPrev, curDown, curUp, enter, + add, delete }; + } + }); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Make sure empty table parts have context menu on touch screen devices"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13694; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html index 99f8f5bf9b..6e3d86175a 100644 --- a/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html +++ b/uitest/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html @@ -34,7 +34,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -44,7 +44,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[4]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTextFieldRelativeWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/VScrollTable$FocusableScrollContextPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[4]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableGeneratedColumns.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableGeneratedColumns.html index 09014f3aa0..52d2fd7b3f 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableGeneratedColumns.html +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableGeneratedColumns.html @@ -60,7 +60,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/VScrollTable$FocusableScrollContextPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VLabel[0]</td> <td>Item 1/Generated 1</td> </tr> <!--100px html label--> @@ -86,7 +86,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VLabel[1]</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_StestComponent/VScrollTable$FocusableScrollContextPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VLabel[1]</td> <td>Item 1/Generated 2</td> </tr> <!--plain string--> |