summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 12:04:10 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 12:04:10 +0000
commit02daee926e0bb40bcd8a321a2a27570da5c9c928 (patch)
tree0e95ae3e0845bc0532a9e17fdd6536a5a156de58
parentb046062c939ff96753cc84360767e2444784f1f4 (diff)
downloadvaadin-framework-02daee926e0bb40bcd8a321a2a27570da5c9c928.tar.gz
vaadin-framework-02daee926e0bb40bcd8a321a2a27570da5c9c928.zip
Merged changes from 6.8
svn changeset:22469/svn branch:6.8
-rw-r--r--WebContent/VAADIN/themes/chameleon/components/button/button.css2
-rw-r--r--WebContent/release-notes.html12
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java12
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java18
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VWindow.java18
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java8
-rw-r--r--src/com/vaadin/ui/Window.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java31
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java65
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java32
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html42
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java46
12 files changed, 262 insertions, 28 deletions
diff --git a/WebContent/VAADIN/themes/chameleon/components/button/button.css b/WebContent/VAADIN/themes/chameleon/components/button/button.css
index 13fa53cc3f..0a9544b5ae 100644
--- a/WebContent/VAADIN/themes/chameleon/components/button/button.css
+++ b/WebContent/VAADIN/themes/chameleon/components/button/button.css
@@ -182,7 +182,7 @@ body.v-ie .v-pressed.v-button-borderless {
font-weight: normal;
text-shadow: none;
border: none;
- padding: 1px;
+ margin: 1px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html
index 6c26efd791..2fe8083556 100644
--- a/WebContent/release-notes.html
+++ b/WebContent/release-notes.html
@@ -469,6 +469,8 @@
<li>Liferay Portal 5.2-6.0</li>
<li>GateIn Portal 3.1</li>
<li>eXo Platform 3</li>
+ <li>Oracle WebLogic&reg; Portal 10gR3</li>
+ <li>WebSphere Portal 6.1-7.0</li>
</ul>
<p>
Vaadin also supports <b>Google App Engine</b>.
@@ -485,6 +487,16 @@
<li>Google Chrome 13-15</li>
</ul>
+ <p>
+ Vaadin supports the built-in browsers in the following <b>mobile operating
+ systems</b>:
+ </p>
+
+ <ul>
+ <li>iOS 4-5</li>
+ <li>Android 2-3</li>
+ </ul>
+
<h2 id="vaadinontheweb">Vaadin on the Web</h2>
<p>
<ul>
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
index fce5b4206c..a60fb808a1 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
@@ -361,7 +361,7 @@ public class ApplicationConfiguration implements EntryPoint {
cmd.execute();
}
callbacks.clear();
- } else if(widgetsLoading == 0 && deferredWidgetLoader != null) {
+ } else if (widgetsLoading == 0 && deferredWidgetLoader != null) {
deferredWidgetLoader.trigger();
}
@@ -377,17 +377,17 @@ public class ApplicationConfiguration implements EntryPoint {
int communicationFree = 0;
int nextWidgetIndex = 0;
private boolean pending;
-
+
public DeferredWidgetLoader() {
schedule(5000);
}
public void trigger() {
- if(!pending) {
+ if (!pending) {
schedule(FREE_CHECK_TIMEOUT);
}
}
-
+
@Override
public void schedule(int delayMillis) {
super.schedule(delayMillis);
@@ -438,9 +438,9 @@ public class ApplicationConfiguration implements EntryPoint {
return communicationFree < FREE_LIMIT;
}
}
-
+
private static DeferredWidgetLoader deferredWidgetLoader;
-
+
public void onModuleLoad() {
// Enable IE6 Background image caching
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index d9bd2ebff5..3120aa3cdb 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -4056,7 +4056,20 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (reactLastRow >= totalRows) {
reactLastRow = totalRows - 1;
}
- if (lastRendered < reactLastRow) {
+ if (lastRendered < reactFirstRow || firstRendered > reactLastRow) {
+ /*
+ * #8040 - scroll position is completely changed since the
+ * latest request, so request a new set of rows.
+ *
+ * TODO: We should probably check whether the fetched rows match
+ * the current scroll position right when they arrive, so as to
+ * not waste time rendering a set of rows that will never be
+ * visible...
+ */
+ rowRequestHandler.setReqFirstRow(reactFirstRow);
+ rowRequestHandler.setReqRows(reactLastRow - reactFirstRow + 1);
+ rowRequestHandler.deferRowFetch(1);
+ } else if (lastRendered < reactLastRow) {
// get some cache rows below visible area
rowRequestHandler.setReqFirstRow(lastRendered + 1);
rowRequestHandler.setReqRows(reactLastRow - lastRendered);
@@ -6657,8 +6670,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (BrowserInfo.get().isIE()) {
// IE sometimes moves focus to a clicked table cell...
Element focusedElement = Util.getIEFocusedElement();
- if (getElement().isOrHasChild(focusedElement)) {
+ if (Util.getPaintableForElement(client, getParent(), focusedElement) == this) {
// ..in that case, steal the focus back to the focus handler
+ // but not if focus is in a child component instead (#7965)
focus();
return;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
index 9302be29df..54a151c7e7 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
@@ -1099,9 +1099,9 @@ public class VWindow extends VOverlay implements Container,
* the browser to compute it based on the window contents.
*/
public void setHeight(String height) {
- if (!isAttached() || (height == null
- ? this.height == null
- : height.equals(this.height))) {
+ if (!isAttached()
+ || (height == null ? this.height == null : height
+ .equals(this.height))) {
return;
}
if (height == null || "".equals(height)) {
@@ -1113,17 +1113,17 @@ public class VWindow extends VOverlay implements Container,
renderSpace.setHeight(MIN_CONTENT_AREA_HEIGHT);
} else {
getElement().getStyle().setProperty("height", height);
- int contentHeight =
- getElement().getOffsetHeight() - getExtraHeight();
+ int contentHeight = getElement().getOffsetHeight()
+ - getExtraHeight();
if (contentHeight < MIN_CONTENT_AREA_HEIGHT) {
contentHeight = MIN_CONTENT_AREA_HEIGHT;
int rootHeight = contentHeight + getExtraHeight();
- getElement().getStyle().setProperty(
- "height", rootHeight + "px");
+ getElement().getStyle()
+ .setProperty("height", rootHeight + "px");
}
renderSpace.setHeight(contentHeight);
- contentPanel.getElement().getStyle().setProperty(
- "height", contentHeight + "px");
+ contentPanel.getElement().getStyle()
+ .setProperty("height", contentHeight + "px");
}
this.height = height;
updateShadowSizeAndPosition();
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 93f130bb3b..e96f2d2b56 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -962,7 +962,13 @@ public abstract class AbstractCommunicationManager implements
Component p = (Component) it.next();
if (p.getApplication() == null) {
unregisterPaintable(p);
- idPaintableMap.remove(paintableIdMap.get(p));
+ // Take into account that some other component may have
+ // reused p's ID by now (this can happen when manually
+ // assigning IDs with setDebugId().) See #8090.
+ String pid = paintableIdMap.get(p);
+ if (idPaintableMap.get(pid) == p) {
+ idPaintableMap.remove(pid);
+ }
it.remove();
dirtyPaintables.remove(p);
}
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java
index 566d16313c..1e0172d60f 100644
--- a/src/com/vaadin/ui/Window.java
+++ b/src/com/vaadin/ui/Window.java
@@ -1305,7 +1305,9 @@ public class Window extends Panel implements URIHandler, ParameterHandler,
*
* For a browser level window the CloseListener is fired when the browser
* level window is closed. Note that closing a browser level window does not
- * mean it will be destroyed.
+ * mean it will be destroyed. Also note that Opera does not send events like
+ * all other browsers and therefore the close listener might not be called
+ * if Opera is used.
*
* <p>
* Since Vaadin 6.5, removing windows using {@link #removeWindow(Window)}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
index 83eff1bdea..cca76ce418 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
@@ -5,6 +5,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.BaseTheme;
public class ButtonsInHorizontalLayout extends AbstractTestCase {
@@ -12,16 +13,30 @@ public class ButtonsInHorizontalLayout extends AbstractTestCase {
public void init() {
VerticalLayout content = new VerticalLayout();
content.setMargin(true);
+ content.setSpacing(true);
+
+ content.addComponent(createButtonLayout(null));
+ content.addComponent(createButtonLayout(BaseTheme.BUTTON_LINK));
+
+ setMainWindow(new Window("", content));
+ }
+
+ private HorizontalLayout createButtonLayout(String style) {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(true);
- layout.addComponent(new Button(
- "Look at me in IE7 or IE8 in compatibility mode"));
- layout.addComponent(new Button(
- "Look at me in IE7 or IE8 in compatibility mode"));
- layout.addComponent(new Button(
- "Look at me in IE7 or IE8 in compatibility mode"));
- content.addComponent(layout);
- setMainWindow(new Window("", content));
+ layout.addComponent(createButton(style));
+ layout.addComponent(createButton(style));
+ layout.addComponent(createButton(style));
+ return layout;
+ }
+
+ private Button createButton(String style) {
+ Button button = new Button(
+ "Look at me in IE7 or IE8 in compatibility mode");
+ if (style != null && style.length() != 0) {
+ button.setStyleName(style);
+ }
+ return button;
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
new file mode 100644
index 0000000000..d88b36abb1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
@@ -0,0 +1,65 @@
+package com.vaadin.tests.components.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Window;
+
+public class ScrollCausesRequestLoop extends TestBase {
+
+ @Override
+ protected void setup() {
+ setMainWindow(new Window("", new TestView()));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Scrolling a table causes an infinite loop of UIDL requests in some cases";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8040;
+ }
+
+ private static class TestView extends HorizontalLayout {
+
+ TestView() {
+ Table table = new Table();
+ List<Person> data = createData();
+ BeanItemContainer<Person> container = new BeanItemContainer<Person>(
+ Person.class, data) {
+
+ @Override
+ public Person getIdByIndex(int index) {
+ try {
+ // Simulate some loading delay with some exaggeration
+ // to make easier to reproduce
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException(e);
+ }
+ return super.getIdByIndex(index);
+ }
+ };
+ table.setContainerDataSource(container);
+ addComponent(table);
+ }
+ }
+
+ private static List<Person> createData() {
+ int count = 500;
+ List<Person> data = new ArrayList<Person>(count);
+ for (int i = 0; i < count; i++) {
+ data.add(new Person("Person", "" + i, "Email", "Phone", "Street",
+ 12345, "City"));
+ }
+ return data;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
new file mode 100644
index 0000000000..90a9191036
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
@@ -0,0 +1,32 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Window;
+
+public class TableHeaderZoom extends TestBase {
+
+ @Override
+ protected void setup() {
+ Table table = new Table();
+ table.setHeight("100px");
+ table.setWidth("200px");
+ table.setEnabled(false);
+ table.addContainerProperty("Column 1", String.class, "");
+
+ Window main = getMainWindow();
+ main.setContent(new CssLayout());
+ main.addComponent(table);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Table header text/icon disappears when zooming out";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6870;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
new file mode 100644
index 0000000000..1b2e91617d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
@@ -0,0 +1,42 @@
+<?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>ReplacingComponentsInHandleParameters</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">ReplacingComponentsInHandleParameters</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
new file mode 100644
index 0000000000..d6fe10601f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.components.window;
+
+import java.util.Map;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Window;
+
+public class ReplacingComponentsInHandleParameters extends TestBase {
+
+ @Override
+ protected String getDescription() {
+ return "Reusing debug IDs when replacing components in handleParameters() causes out of sync";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8090;
+ }
+
+ @Override
+ protected void setup() {
+ final ClickListener clickListener = new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ event.getButton().setCaption("Clicked!");
+ }
+ };
+ final Window main = new Window() {
+ @Override
+ public void handleParameters(Map<String, String[]> parameters) {
+ super.handleParameters(parameters);
+ removeAllComponents();
+ addComponent(new Label(
+ "Reload window (without ?restartApplication), then click the button twice."));
+
+ Button btn = new Button("Click me", clickListener);
+ btn.setDebugId("TestId");
+ addComponent(btn);
+ }
+ };
+ setMainWindow(main);
+ }
+}