summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-04-18 14:10:21 +0300
committerLeif Åstrand <leif@vaadin.com>2012-04-18 14:10:21 +0300
commit29895fe37cba6f804eb94f4710951075c8c7cebb (patch)
tree9bab54845645e2e34198151e83c8e73b95f39a97
parent3c4912c245ae5f2721b755d6f92ee04c2c8f54f6 (diff)
parent290f6b3a2b6b3eeadf3c9904fbaae0fa2f016595 (diff)
downloadvaadin-framework-29895fe37cba6f804eb94f4710951075c8c7cebb.tar.gz
vaadin-framework-29895fe37cba6f804eb94f4710951075c8c7cebb.zip
Merge branch 'master' into layoutgraph
-rw-r--r--WebContent/VAADIN/themes/reindeer/tree/tree.css4
-rw-r--r--WebContent/VAADIN/themes/runo/tree/tree.css4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConnection.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/gridlayout/VGridLayout.java24
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/layout/VLayoutSlot.java28
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/orderedlayout/VMeasuringOrderedLayout.java8
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java57
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java9
-rw-r--r--src/com/vaadin/ui/TabSheet.java28
-rw-r--r--src/com/vaadin/ui/Table.java11
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java37
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html62
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java55
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeShiftMultiSelectNodes.html75
16 files changed, 212 insertions, 203 deletions
diff --git a/WebContent/VAADIN/themes/reindeer/tree/tree.css b/WebContent/VAADIN/themes/reindeer/tree/tree.css
index 9f4083d42e..f72f61c545 100644
--- a/WebContent/VAADIN/themes/reindeer/tree/tree.css
+++ b/WebContent/VAADIN/themes/reindeer/tree/tree.css
@@ -26,7 +26,9 @@
padding-left: 16px;
}
.v-tree-node-caption.v-tree-node-focused span{
- padding: 0 1px; /* Make room for border */
+ padding-left: 1px;
+ padding-top: 0px;
+ padding-bottom: 0px;
}
.v-tree-node-focused span{
border: 1px dotted black;
diff --git a/WebContent/VAADIN/themes/runo/tree/tree.css b/WebContent/VAADIN/themes/runo/tree/tree.css
index e897236587..14061b8afb 100644
--- a/WebContent/VAADIN/themes/runo/tree/tree.css
+++ b/WebContent/VAADIN/themes/runo/tree/tree.css
@@ -34,7 +34,9 @@
outline:none;
}
.v-tree-node-caption.v-tree-node-focused span{
- padding: 0;
+ padding-left: 1px;
+ padding-top: 0px;
+ padding-bottom: 0px;
}
.v-tree-node-focused span{
border: 1px dotted black;
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 5f5ef71c36..2d9398320e 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -766,8 +766,7 @@ public class ApplicationConnection {
protected void startRequest() {
if (hasActiveRequest) {
- throw new IllegalStateException(
- "Trying to start a new request while another is active");
+ VConsole.error("Trying to start a new request while another is active");
}
hasActiveRequest = true;
requestStartTime = new Date();
@@ -794,7 +793,7 @@ public class ApplicationConnection {
protected void endRequest() {
if (!hasActiveRequest) {
- throw new IllegalStateException("No active request");
+ VConsole.error("No active request");
}
// After checkForPendingVariableBursts() there may be a new active
// request, so we must set hasActiveRequest to false before, not after,
diff --git a/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java b/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java
index bcee1ff413..7fccdafd2a 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java
@@ -1,3 +1,6 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
package com.vaadin.terminal.gwt.client.ui;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
diff --git a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/VGridLayout.java b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/VGridLayout.java
index 151705b1af..7629e09cac 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/VGridLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/VGridLayout.java
@@ -201,15 +201,15 @@ public class VGridLayout extends ComplexPanel {
for (int j = 0; j < cells[i].length; j++) {
Cell cell = cells[i][j];
if (cell != null) {
- int effectivePadding;
+ int reservedMargin;
if (cell.rowspan + j >= cells[i].length) {
// Make room for layout padding for cells reaching the
// bottom of the layout
- effectivePadding = paddingBottom;
+ reservedMargin = paddingBottom;
} else {
- effectivePadding = 0;
+ reservedMargin = 0;
}
- cell.layoutVertically(y, effectivePadding);
+ cell.layoutVertically(y, reservedMargin);
}
y += rowHeights[j] + verticalSpacing;
}
@@ -235,15 +235,15 @@ public class VGridLayout extends ComplexPanel {
for (int j = 0; j < cells[i].length; j++) {
Cell cell = cells[i][j];
if (cell != null) {
- int effectivePadding;
+ int reservedMargin;
// Make room for layout padding for cells reaching the
// right edge of the layout
if (i + cell.colspan >= cells.length) {
- effectivePadding = paddingRight;
+ reservedMargin = paddingRight;
} else {
- effectivePadding = 0;
+ reservedMargin = 0;
}
- cell.layoutHorizontally(x, effectivePadding);
+ cell.layoutHorizontally(x, reservedMargin);
}
}
x += columnWidths[i] + horizontalSpacing;
@@ -507,15 +507,15 @@ public class VGridLayout extends ComplexPanel {
return height;
}
- public void layoutHorizontally(int x, int paddingRight) {
+ public void layoutHorizontally(int x, int marginRight) {
if (slot != null) {
- slot.positionHorizontally(x, getAvailableWidth(), paddingRight);
+ slot.positionHorizontally(x, getAvailableWidth(), marginRight);
}
}
- public void layoutVertically(int y, int paddingBottom) {
+ public void layoutVertically(int y, int marginBottom) {
if (slot != null) {
- slot.positionVertically(y, getAvailableHeight(), paddingBottom);
+ slot.positionVertically(y, getAvailableHeight(), marginBottom);
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/layout/VLayoutSlot.java b/src/com/vaadin/terminal/gwt/client/ui/layout/VLayoutSlot.java
index f44d662e97..034fe35649 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/layout/VLayoutSlot.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/layout/VLayoutSlot.java
@@ -60,7 +60,7 @@ public abstract class VLayoutSlot {
}
public void positionHorizontally(double currentLocation,
- double allocatedSpace, double paddingRight) {
+ double allocatedSpace, double marginRight) {
Style style = wrapper.getStyle();
double availableWidth = allocatedSpace;
@@ -73,23 +73,25 @@ public abstract class VLayoutSlot {
boolean captionAboveCompnent;
if (caption == null) {
captionAboveCompnent = false;
+ style.clearPaddingRight();
} else {
captionAboveCompnent = !caption.shouldBePlacedAfterComponent();
if (!captionAboveCompnent) {
availableWidth -= captionWidth;
captionStyle.clearLeft();
- captionStyle.setRight(paddingRight, Unit.PX);
- paddingRight += captionWidth;
+ captionStyle.setRight(0, Unit.PX);
+ style.setPaddingRight(captionWidth, Unit.PX);
} else {
captionStyle.setLeft(0, Unit.PX);
captionStyle.clearRight();
+ style.clearPaddingRight();
}
}
- if (paddingRight > 0) {
- style.setPaddingRight(paddingRight, Unit.PX);
+ if (marginRight > 0) {
+ style.setMarginRight(marginRight, Unit.PX);
} else {
- style.clearPaddingRight();
+ style.clearMarginRight();
}
if (isRelativeWidth()) {
@@ -142,7 +144,7 @@ public abstract class VLayoutSlot {
}
public void positionVertically(double currentLocation,
- double allocatedSpace, double paddingBottom) {
+ double allocatedSpace, double marginBottom) {
Style style = wrapper.getStyle();
double contentHeight = allocatedSpace;
@@ -161,10 +163,10 @@ public abstract class VLayoutSlot {
style.setPaddingTop(captionHeight, Unit.PX);
}
- if (paddingBottom > 0) {
- style.setPaddingBottom(paddingBottom, Unit.PX);
+ if (marginBottom > 0) {
+ style.setMarginBottom(marginBottom, Unit.PX);
} else {
- style.clearPaddingBottom();
+ style.clearMarginBottom();
}
if (isRelativeHeight()) {
@@ -209,11 +211,11 @@ public abstract class VLayoutSlot {
}
public void positionInDirection(double currentLocation,
- double allocatedSpace, double endingPadding, boolean isVertical) {
+ double allocatedSpace, double endingMargin, boolean isVertical) {
if (isVertical) {
- positionVertically(currentLocation, allocatedSpace, endingPadding);
+ positionVertically(currentLocation, allocatedSpace, endingMargin);
} else {
- positionHorizontally(currentLocation, allocatedSpace, endingPadding);
+ positionHorizontally(currentLocation, allocatedSpace, endingMargin);
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/VMeasuringOrderedLayout.java b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/VMeasuringOrderedLayout.java
index 41c48883ec..de55ca98e6 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/VMeasuringOrderedLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/VMeasuringOrderedLayout.java
@@ -191,15 +191,15 @@ public class VMeasuringOrderedLayout extends ComplexPanel {
double roundedSpace = Math.round(endLocation) - roundedLocation;
// Reserve room for the padding if we're at the end
- double slotEndPadding;
+ double slotEndMargin;
if (i == children.size() - 1) {
- slotEndPadding = endPadding;
+ slotEndMargin = endPadding;
} else {
- slotEndPadding = 0;
+ slotEndMargin = 0;
}
slot.positionInDirection(roundedLocation, roundedSpace,
- slotEndPadding, isVertical);
+ slotEndMargin, isVertical);
currentLocation = endLocation + spacingSize;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java
index 32cf9cfb2e..a8512762f1 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java
@@ -185,11 +185,12 @@ public class PanelConnector extends AbstractComponentContainerConnector
VPanel panel = getWidget();
LayoutManager layoutManager = getLayoutManager();
- int top = layoutManager.getInnerHeight(panel.captionNode);
+ int top = layoutManager.getOuterHeight(panel.captionNode);
int bottom = layoutManager.getInnerHeight(panel.bottomDecoration);
Style style = panel.getElement().getStyle();
- panel.captionNode.getStyle().setMarginTop(-top, Unit.PX);
+ panel.captionNode.getParentElement().getStyle()
+ .setMarginTop(-top, Unit.PX);
panel.bottomDecoration.getStyle().setMarginBottom(-bottom, Unit.PX);
style.setPaddingTop(top, Unit.PX);
style.setPaddingBottom(bottom, Unit.PX);
diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java
index cf6209e312..563ca04abe 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java
@@ -1846,9 +1846,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
isNewBody = false;
if (firstvisible > 0) {
- scrollBodyPanel
- .setScrollPosition(measureRowHeightOffset(firstvisible));
- firstRowInViewPort = firstvisible;
+ // FIXME #7607
+ // Originally deferred due to Firefox oddities which should not
+ // occur any more. Currently deferring breaks Webkit scrolling with
+ // relative-height tables, but not deferring instead breaks tables
+ // with explicit page length.
+ Scheduler.get().scheduleDeferred(new Command() {
+ public void execute() {
+ scrollBodyPanel
+ .setScrollPosition(measureRowHeightOffset(firstvisible));
+ firstRowInViewPort = firstvisible;
+ }
+ });
}
if (enabled) {
@@ -4968,21 +4977,33 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
public void run() {
TouchScrollDelegate activeScrollDelegate = TouchScrollDelegate
.getActiveScrollDelegate();
- if (activeScrollDelegate != null
- && !activeScrollDelegate.isMoved()) {
- /*
- * scrolling hasn't started. Cancel
- * scrolling and let row handle this as
- * drag start or context menu.
- */
- activeScrollDelegate.stopScrolling();
- } else {
- /*
- * Scrolled or scrolling, clear touch
- * start to indicate that row shouldn't
- * handle touch move/end events.
- */
- touchStart = null;
+ /*
+ * If there's a scroll delegate, check if
+ * we're actually scrolling and handle it.
+ * If no delegate, do nothing here and let
+ * the row handle potential drag'n'drop or
+ * context menu.
+ */
+ if (activeScrollDelegate != null) {
+ if (activeScrollDelegate.isMoved()) {
+ /*
+ * Prevent the row from handling
+ * touch move/end events (the
+ * delegate handles those) and from
+ * doing drag'n'drop or opening a
+ * context menu.
+ */
+ touchStart = null;
+ } else {
+ /*
+ * Scrolling hasn't started, so
+ * cancel delegate and let the row
+ * handle potential drag'n'drop or
+ * context menu.
+ */
+ activeScrollDelegate
+ .stopScrolling();
+ }
}
}
}.schedule(TOUCHSCROLL_TIMEOUT);
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index d67ad36838..bb6e726166 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -1553,6 +1553,15 @@ public abstract class AbstractCommunicationManager implements Serializable {
Connector c = app.getConnector(invocation.getConnectorId());
if (c instanceof RpcTarget) {
ServerRpcManager.applyInvocation((RpcTarget) c, invocation);
+ } else if (c == null) {
+ logger.log(
+ Level.WARNING,
+ "RPC call " + invocation.getInterfaceName() + "."
+ + invocation.getMethodName()
+ + " received for connector id "
+ + invocation.getConnectorId()
+ + " but no such connector could be found");
+
} else {
logger.log(Level.WARNING, "RPC call received for connector "
+ c.getClass().getName() + " (" + c.getConnectorId()
diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java
index 64e069dcfe..23dee15359 100644
--- a/src/com/vaadin/ui/TabSheet.java
+++ b/src/com/vaadin/ui/TabSheet.java
@@ -538,7 +538,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
*
* @param c
* the component
- * @return
+ * @return The tab instance associated with the given component, or null if
+ * the tabsheet does not contain the component.
*/
public Tab getTab(Component c) {
return tabs.get(c);
@@ -550,14 +551,15 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
*
* @param position
* the position of the tab
- * @return
+ * @return The tab in the given position, or null if the position is out of
+ * bounds.
*/
public Tab getTab(int position) {
- Component c = components.get(position);
- if (c != null) {
- return tabs.get(c);
+ if (position >= 0 && position < getComponentCount()) {
+ return getTab(components.get(position));
+ } else {
+ return null;
}
- return null;
}
/**
@@ -608,17 +610,19 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
* @param tab
*/
public void setSelectedTab(Tab tab) {
- setSelectedTab(tab.getComponent());
+ if (tab != null) {
+ setSelectedTab(tab.getComponent());
+ }
}
/**
- * Sets the selected tab, identified by its position. Does nothing if
- * <code>index &lt; 0 || index &gt; {@link #getComponentCount()}</code>.
+ * Sets the selected tab, identified by its position. Does nothing if the
+ * position is out of bounds.
*
- * @param index
+ * @param position
*/
- public void setSelectedTab(int index) {
- setSelectedTab(getTab(index));
+ public void setSelectedTab(int position) {
+ setSelectedTab(getTab(position));
}
/**
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index 0658c4e6a5..2fffedd9d6 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -1370,11 +1370,14 @@ public class Table extends AbstractSelect implements Action.Container,
maxIndex = 0;
}
- // Assume that we want to scroll to the very bottom (so that the bottom
- // row is completely visible even if (table height) / (row height) is
- // not an integer.)
+ /*
+ * FIXME #7607 Take somehow into account the case where we want to
+ * scroll to the bottom so that the last row is completely visible even
+ * if (table height) / (row height) is not an integer. Reverted the
+ * original fix because of #8662 regression.
+ */
if (newIndex > maxIndex) {
- newIndex = maxIndex + 1;
+ newIndex = maxIndex;
}
// Refresh first item id
diff --git a/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java b/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java
index 85c88e29bb..40d0ffd17d 100644
--- a/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java
+++ b/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java
@@ -119,6 +119,43 @@ public class TestTabSheet {
assertEquals(tab1, tabSheet.getTab(0));
assertEquals(tab2, tabSheet.getTab(1));
assertEquals(tab3, tabSheet.getTab(2));
+
+ assertEquals(null, tabSheet.getTab(3));
}
+ @Test
+ public void selectTab() {
+ TabSheet tabSheet = new TabSheet();
+ Tab tab1 = tabSheet.addTab(new Label("aaa"));
+ Tab tab2 = tabSheet.addTab(new Label("bbb"));
+ Tab tab3 = tabSheet.addTab(new Label("ccc"));
+ Label componentNotInSheet = new Label("ddd");
+ Tab tabNotInSheet = new TabSheet().addTab(new Label("eee"));
+
+ assertEquals(tab1.getComponent(), tabSheet.getSelectedTab());
+
+ // Select tab by component...
+ tabSheet.setSelectedTab(tab2.getComponent());
+ assertEquals(tab2.getComponent(), tabSheet.getSelectedTab());
+
+ // by tab instance
+ tabSheet.setSelectedTab(tab3);
+ assertEquals(tab3.getComponent(), tabSheet.getSelectedTab());
+
+ // by index
+ tabSheet.setSelectedTab(0);
+ assertEquals(tab1.getComponent(), tabSheet.getSelectedTab());
+
+ // Should be no-op...
+ tabSheet.setSelectedTab(componentNotInSheet);
+ assertEquals(tab1.getComponent(), tabSheet.getSelectedTab());
+
+ // this as well
+ tabSheet.setSelectedTab(tabNotInSheet);
+ assertEquals(tab1.getComponent(), tabSheet.getSelectedTab());
+
+ // and this
+ tabSheet.setSelectedTab(123);
+ assertEquals(tab1.getComponent(), tabSheet.getSelectedTab());
+ }
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html
deleted file mode 100644
index 8881c0d2f5..0000000000
--- a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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>SetCurrentPageFirstItemId</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">SetCurrentPageFirstItemId</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/SetCurrentPageFirstItemId?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[24]/domChild[0]/domChild[0]</td>
- <td>24</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>scrolled-to-bottom</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java
new file mode 100644
index 0000000000..16323e5024
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.event.Action;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Table;
+
+public class TableContextMenu extends TestBase {
+
+ private static final Action ACTION_MYACTION = new Action("Action!!");
+
+ @Override
+ protected void setup() {
+ Table table = new Table();
+ table.setSelectable(true);
+ table.setMultiSelect(true);
+
+ table.addActionHandler(new Action.Handler() {
+ public void handleAction(Action action, Object sender, Object target) {
+ getLayout().getRoot().showNotification("Done that :-)");
+ }
+
+ public Action[] getActions(Object target, Object sender) {
+ return new Action[] { ACTION_MYACTION };
+ }
+ });
+
+ // TODO should work with all combinations
+ table.setImmediate(true);
+ table.setSelectable(true);
+ table.setMultiSelect(true);
+
+ table.addContainerProperty("Foo", String.class, "BAR1");
+ table.addContainerProperty("Bar", String.class, "FOO2");
+
+ // FIXME works with lots of rows (more than pagelength), don't work with
+ // none
+ for (int i = 0; i < 3; i++) {
+ table.addItem();
+ }
+
+ addComponent(table);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Right clicking on an item without a context menu should bring"
+ + "up the Tables context menu. With touch devices context menu must popup with long touch.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8639;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeShiftMultiSelectNodes.html b/tests/testbench/com/vaadin/tests/components/tree/TreeShiftMultiSelectNodes.html
index 75ad4b5ff5..53709b2a64 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeShiftMultiSelectNodes.html
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeShiftMultiSelectNodes.html
@@ -3,13 +3,13 @@
<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:8888/" />
-<title>Trees</title>
+<link rel="selenium.base" href="http://localhost:8067" />
+<title>TreeShiftMultiSelectNodes</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
-<tr><td rowspan="1" colspan="3">Trees</td></tr>
+<tr><td rowspan="1" colspan="3">TreeShiftMultiSelectNodes</td></tr>
</thead><tbody>
<tr>
<td>open</td>
@@ -32,76 +32,9 @@
<td>23,8</td>
</tr>
<tr>
- <td>shiftKeyDown</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentstreeTrees::PID_StestComponent#n[1]/n[2]/n[1]</td>
- <td>28,8</td>
-</tr>
-<tr>
- <td>shiftKeyUp</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>all-items-inside-selection-are-selected</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
-<?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:8888/" />
-<title>Trees</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">Trees</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.tree.Trees/?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreeTrees::PID_StestComponent#n[1]/expand</td>
- <td>9,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreeTrees::PID_StestComponent#n[1]/n[2]/expand</td>
- <td>9,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreeTrees::PID_StestComponent#n[1]/n[0]</td>
- <td>23,8</td>
-</tr>
-<tr>
- <td>shiftKeyDown</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstreeTrees::PID_StestComponent#n[1]/n[2]/n[1]</td>
- <td>28,8</td>
-</tr>
-<tr>
- <td>shiftKeyUp</td>
- <td></td>
- <td></td>
+ <td>28,8:shift</td>
</tr>
<tr>
<td>screenCapture</td>