]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] fixes #8505
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 13 Mar 2012 09:18:53 +0000 (09:18 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Tue, 13 Mar 2012 09:18:53 +0000 (09:18 +0000)
svn changeset:23227/svn branch:6.8

build/build.xml
scripts/merge.sh
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java [new file with mode: 0644]

index 1fdcc0ee25f932281b4e50c163e2fead0e27502f..aee3dc7bed70d3b4bf2344d4cc73c1d01cc4dc46 100644 (file)
     <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter">
         <fail unless="widgetset" message="No widgetset parameter set"/>
         <property name="widgetset-style" value="OBF" />
-       <property name="widgetset-localWorkers" value="4" />
+       <property name="widgetset-localWorkers" value="1" />
        <property name="widgetset-extraParams" value="" />
         <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
         <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m">
index a8c356ad30bb21f9dc3e2ae981a17583e7e9d826..9125a505b7cb545356d572f826b16cb2e6327551 100755 (executable)
@@ -13,14 +13,14 @@ localchanges=`svn stat|wc -l`
 if [ "$localchanges" != "0" ]
 then
        echo "You must have a clean working space copy"
-       exit 2
+       #exit 2
 fi
 
 if [ "$SVN_PASS_FILE" != "" ]
 then
        SVN_PASS=`cat "$SVN_PASS_FILE"`
 fi
-       
+
 svn up
 
 currentrepowithoutversion=`svn info|grep URL|sed "s/URL: //"|sed "s/\/[^\/]*$//"`
index e34cd0fb8cd940cd3351ed2b0b954c0807bcae89..f3444f1313162cbc65cb991039d1ebb08f8ba567 100644 (file)
@@ -140,7 +140,7 @@ public class ApplicationConnection {
 
     protected boolean applicationRunning = false;
 
-    private int activeRequests = 0;
+    private boolean hasActiveRequest = false;
 
     /** Parameters for this application connection loaded from the web-page */
     private ApplicationConfiguration configuration;
@@ -358,12 +358,12 @@ public class ApplicationConnection {
 
     /**
      * Indicates whether or not there are currently active UIDL requests. Used
-     * internally to squence requests properly, seldom needed in Widgets.
+     * internally to sequence requests properly, seldom needed in Widgets.
      * 
      * @return true if there are active requests
      */
     public boolean hasActiveRequest() {
-        return (activeRequests > 0);
+        return hasActiveRequest;
     }
 
     private String getRepaintAllParameters() {
@@ -521,7 +521,9 @@ public class ApplicationConnection {
                         (new Timer() {
                             @Override
                             public void run() {
-                                activeRequests--;
+                                // TODO why? Here used to be "activeRequests--;"
+                                // but can't see why exactly
+                                hasActiveRequest = false;
                                 doUidlRequest(uri, payload, synchronous);
                             }
                         }).schedule(delay);
@@ -735,7 +737,7 @@ public class ApplicationConnection {
     }
 
     protected void startRequest() {
-        activeRequests++;
+        hasActiveRequest = true;
         requestStartTime = new Date();
         // show initial throbber
         if (loadTimer == null) {
@@ -763,11 +765,11 @@ public class ApplicationConnection {
             checkForPendingVariableBursts();
             runPostRequestHooks(configuration.getRootPanelId());
         }
-        activeRequests--;
+        hasActiveRequest = false;
         // deferring to avoid flickering
         Scheduler.get().scheduleDeferred(new Command() {
             public void execute() {
-                if (activeRequests == 0) {
+                if (!hasActiveRequest()) {
                     hideLoadingIndicator();
                 }
             }
@@ -1404,10 +1406,6 @@ public class ApplicationConnection {
         makeUidlRequest(req.toString(), "", forceSync);
     }
 
-    private void makeUidlRequest(String string) {
-        makeUidlRequest(string, "", false);
-    }
-
     /**
      * Sends a new value for the given paintables given variable to the server.
      * <p>
index cae0b65a5afda71c8689521cf1180f63ea0a1d79..c8a2be3576c964a5c920e2182cba134f1843d9b7 100644 (file)
@@ -2300,6 +2300,12 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                 // Leave room for the sort indicator
                 captionContainerWidth -= sortIndicator.getOffsetWidth();
             }
+
+            if (captionContainerWidth < 0) {
+                rightSpacing += captionContainerWidth;
+                captionContainerWidth = 0;
+            }
+
             captionContainer.getStyle().setPropertyPx("width",
                     captionContainerWidth);
 
diff --git a/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.html b/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.html
new file mode 100644 (file)
index 0000000..441142e
--- /dev/null
@@ -0,0 +1,47 @@
+<?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>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.LastColumnNegative?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentstableLastColumnNegative::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentstableLastColumnNegative::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentstableLastColumnNegative::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentstableLastColumnNegative::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/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/table/LastColumnNegative.java b/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java
new file mode 100644 (file)
index 0000000..2100d38
--- /dev/null
@@ -0,0 +1,77 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class LastColumnNegative extends TestBase {
+    Table table = setupTable();
+    VerticalLayout wrapper = new VerticalLayout();
+
+    @Override
+    public void setup() {
+        Button addButton = new Button("Add a table",
+                new Button.ClickListener() {
+
+                    public void buttonClick(ClickEvent event) {
+                        wrapper.addComponent(table);
+                    }
+
+                });
+        Button removeButton = new Button("Remove a table",
+                new Button.ClickListener() {
+
+                    public void buttonClick(ClickEvent event) {
+                        wrapper.removeComponent(table);
+                    }
+                });
+        Button shrinkWrapper = new Button("Shrink wrapper",
+                new Button.ClickListener() {
+
+                    public void buttonClick(ClickEvent event) {
+                        wrapper.setWidth("400px");
+                    }
+                });
+
+        addComponent(addButton);
+        addComponent(removeButton);
+        addComponent(shrinkWrapper);
+        addComponent(wrapper);
+    }
+
+    private Table setupTable() {
+        IndexedContainer container = new IndexedContainer();
+
+        container
+                .addContainerProperty(
+                        "fileName",
+                        String.class,
+                        "Long enough string to cause a scrollbar when the window is set to a dencently small size.");
+        container.addContainerProperty("size", Long.class, 23958l);
+        container.addItem();
+        container.addItem();
+        container.addItem();
+
+        Table table = new Table();
+        table.setContainerDataSource(container);
+        table.setWidth("100%");
+        table.setColumnCollapsingAllowed(true);
+        table.setColumnExpandRatio("size", 1);
+        return table;
+    }
+
+    @Override
+    protected String getDescription() {
+
+        return "Table rendering should not fail when view becomes smaller than the table width.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+
+        return 8411;
+    }
+}
\ No newline at end of file