]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merged code changes from 6.2
authorHenri Sara <henri.sara@itmill.com>
Mon, 1 Feb 2010 08:52:51 +0000 (08:52 +0000)
committerHenri Sara <henri.sara@itmill.com>
Mon, 1 Feb 2010 08:52:51 +0000 (08:52 +0000)
svn changeset:11069/svn branch:6.3

12 files changed:
WebContent/VAADIN/themes/base/button/button.css
WebContent/VAADIN/themes/base/styles.css
WebContent/VAADIN/themes/reindeer/button/button-link-style.css
WebContent/VAADIN/themes/reindeer/styles.css
WebContent/VAADIN/themes/runo/styles.css
src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java
src/com/vaadin/ui/Select.java
tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java [new file with mode: 0644]
tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java [new file with mode: 0644]

index aacc05bbb700232c22e6a7655ea106ab949f587e..9d4bec0fe42d7a98237e85f7205d1249b3233ec1 100644 (file)
        -moz-box-sizing: border-box;\r
        -ms-box-sizing: border-box;\r
        box-sizing: border-box;\r
-       }\r
+}\r
+\r
+.v-button.v-disabled {\r
+       cursor: default;\r
+}\r
 \r
 .v-ie6 .v-button {\r
        display: inline;\r
index f1840c6bf2f7b3f0c3175a745a89eda41b21face..28d412536e66acc45572e480b9df472ad7ac8b4b 100644 (file)
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
-       }
+}
+
+.v-button.v-disabled {
+       cursor: default;
+}
 
 .v-ie6 .v-button {
        display: inline;
index 14530c8dff1505ca7c2d9c488cf32356d5c5c8ac..f4ba80b3cdc354660f3360e1c445f81dcca74186 100644 (file)
        cursor: pointer;
        line-height: inherit;
        }
+
+.v-button.v-button-link.v-disabled,
+.v-button.v-button-link.v-disabled .v-button-wrap {
+       cursor: default;
+       }
        
 .v-button-link .v-button-caption,
 .v-nativebutton-link .v-nativebutton-caption {
index afb15e49a8cfce15d92f66744218e79e3409d563..c4d29c78cede31977f411f7daca6102232ebf8b7 100644 (file)
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_2_0_dev-20091229";}
-.v-theme-version-6_2_0_dev-20091229 {display: none;}
+.v-theme-version:after {content:"9_9_9_INTERNAL-DEBUG-BUILD";}
+.v-theme-version-9_9_9_INTERNAL-DEBUG-BUILD {display: none;}
 /* Automatically compiled css file from subdirectories. */
 
 .v-absolutelayout-wrapper {
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
-       }
+}
+
+.v-button.v-disabled {
+       cursor: default;
+}
 
 .v-ie6 .v-button {
        display: inline;
@@ -2177,6 +2181,11 @@ div.v-window-header {
        cursor: pointer;
        line-height: inherit;
        }
+
+.v-button.v-button-link.v-disabled,
+.v-button.v-button-link.v-disabled .v-button-wrap {
+       cursor: default;
+       }
        
 .v-button-link .v-button-caption,
 .v-nativebutton-link .v-nativebutton-caption {
index 06bce5dfa9b391c25f36d9d257ca440d74074a82..7e14ce6d40c5de6a86f0e1d7058ba679d463126c 100644 (file)
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
-       }
+}
+
+.v-button.v-disabled {
+       cursor: default;
+}
 
 .v-ie6 .v-button {
        display: inline;
index d7cf1ca4d0965c1cd1fc61cd01f9ff626ea714f2..8918b4b5e788c544c507553c5ae4615345415ab3 100644 (file)
                <when-property-is name="user.agent" value="ie6"/>
        </replace-with>
 
+       <!-- Opera needs a different implementation due to GWT issue 3956 (#4099) -->
+       <replace-with class="com.google.gwt.user.client.impl.HistoryImplTimer">
+               <when-type-is class="com.google.gwt.user.client.impl.HistoryImpl" />
+               <when-property-is name="user.agent" value="opera" />
+       </replace-with>
+
        <generate-with class="com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator">
                <when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap"/>
        </generate-with>
index 1c2fcf5b6ffb0c022a4ca93568a82f317212bf1e..416455c1620dba8c9e4824840c0e7b65c4c281a7 100644 (file)
@@ -191,6 +191,7 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
         renderRemainingComponents(pendingCells);
 
         for (Cell cell : relativeHeighted) {
+            // rendering done above so cell.cc should not be null
             Widget widget2 = cell.cc.getWidget();
             client.handleComponentRelativeSize(widget2);
             cell.cc.updateWidgetSize();
@@ -685,19 +686,20 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
             Cell cell = paintableToCell.get(paintable);
             if (!cell.hasRelativeHeight() || !cell.hasRelativeWidth()) {
                 // cell sizes will only stay still if only relatively
-                // sized
-                // components
+                // sized components
                 // check if changed child affects min col widths
-                cell.cc.setWidth("");
-                cell.cc.setHeight("");
+                if (cell.cc != null) {
+                    cell.cc.setWidth("");
+                    cell.cc.setHeight("");
 
-                cell.cc.updateWidgetSize();
+                    cell.cc.updateWidgetSize();
 
-                /*
-                 * If this is the result of an caption icon onload event the
-                 * caption size may have changed
-                 */
-                cell.cc.updateCaptionSize();
+                    /*
+                     * If this is the result of an caption icon onload event the
+                     * caption size may have changed
+                     */
+                    cell.cc.updateCaptionSize();
+                }
 
                 int width = cell.getWidth();
                 int allocated = columnWidths[cell.col];
@@ -853,9 +855,16 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
         }
 
         public RenderSpace getAllocatedSpace() {
-            return new RenderSpace(getAvailableWidth()
-                    - cc.getCaptionWidthAfterComponent(), getAvailableHeight()
-                    - cc.getCaptionHeightAboveComponent());
+            if (cc != null) {
+                return new RenderSpace(getAvailableWidth()
+                        - cc.getCaptionWidthAfterComponent(),
+                        getAvailableHeight()
+                                - cc.getCaptionHeightAboveComponent());
+            } else {
+                // this should not happen normally
+                return new RenderSpace(getAvailableWidth(),
+                        getAvailableHeight());
+            }
         }
 
         public boolean hasContent() {
@@ -965,6 +974,8 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
         int rowspan = 1;
         UIDL childUidl;
         int alignment;
+        // may be null after setUidl() if content has vanished or changed, set
+        // in render()
         ChildComponentContainer cc;
 
         public void setUidl(UIDL c) {
@@ -986,21 +997,21 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
             if (childUidl != null) {
                 if (c == null) {
                     // content has vanished, old content will be removed from
-                    // canvas
-                    // later durin render phase
+                    // canvas later during the render phase
                     cc = null;
                 } else if (cc != null
                         && cc.getWidget() != client.getPaintable(c)) {
                     // content has changed
-                    cc = null;
-                    if (widgetToComponentContainer.containsKey(client
-                            .getPaintable(c))) {
-                        // cc exist for this component (moved) use that for this
-                        // cell
-                        cc = widgetToComponentContainer.get(client
-                                .getPaintable(c));
+                    Paintable newPaintable = client.getPaintable(c);
+                    if (widgetToComponentContainer.containsKey(newPaintable)) {
+                        // if a key in the map, newPaintable must be a widget
+                        replaceChildComponent(cc.getWidget(),
+                                (Widget) newPaintable);
+                        cc = widgetToComponentContainer.get(newPaintable);
                         cc.setWidth("");
                         cc.setHeight("");
+                    } else {
+                        cc = null;
                     }
                 }
             }
index 8d83e8b2b54745afea345b9d3c3691c8ef1dcaad..9b504bc5f3f96348852c0c7615b8179d283c4cd6 100644 (file)
@@ -52,7 +52,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
         boolean lastReadOnlyState = readonly;\r
         super.updateFromUIDL(uidl, client);\r
-        addStyleName(CLASSNAME + "-popupcalendar");\r
         popup.setStyleName(VDateField.CLASSNAME + "-popup "\r
                 + VDateField.CLASSNAME + "-"\r
                 + resolutionToString(currentResolution));\r
@@ -67,6 +66,12 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
 \r
     }\r
 \r
+    @Override\r
+    public void setStyleName(String style) {\r
+        // make sure the style is there before size calculation\r
+        super.setStyleName(style + " " + CLASSNAME + "-popupcalendar");\r
+    }\r
+\r
     public void onClick(ClickEvent event) {\r
         if (event.getSource() == calendarToggle && !open && !readonly) {\r
             open = true;\r
index 912cfa37a387d7d7f68bfcd51f63dbf0ca4be670..c18fc73b082886cdd9876c2dae1061c25f00dfa9 100644 (file)
@@ -19,7 +19,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -164,7 +163,9 @@ public class ClassPathExplorer {
                         for (int i = 0; i < widgetsetNames.length; i++) {
                             String widgetsetname = widgetsetNames[i].trim()
                                     .intern();
-                            widgetsets.put(widgetsetname, location);
+                            if (!widgetsetname.equals("")) {
+                                widgetsets.put(widgetsetname, location);
+                            }
                         }
                     }
                 }
@@ -423,8 +424,15 @@ public class ClassPathExplorer {
      * @return URL
      */
     public static URL getDefaultSourceDirectory() {
-        logger.fine("classpathLocations keys:  "
-                + new TreeSet<URL>(classpathLocations.keySet()));
+        if (logger.isLoggable(Level.FINE)) {
+            logger.fine("classpathLocations keys:");
+            ArrayList<URL> locations = new ArrayList<URL>(classpathLocations
+                    .keySet());
+            for (URL location : locations) {
+                logger.fine(location.toString());
+            }
+        }
+
         Iterator<String> it = rawClasspathEntries.iterator();
         while (it.hasNext()) {
             String entry = it.next();
index e8e0dfebaab94a7220fb4a9143b404d6cf75ef1d..4174001d8739112c08c39a27c30494550ead1731 100644 (file)
@@ -234,6 +234,12 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
         currentPage = -1; // current page is always set by client
 
         optionRequest = true;
+
+        // Hide the error indicator if needed
+        if (isRequired() && isEmpty() && getComponentError() == null
+                && getErrorMessage() != null) {
+            target.addAttribute("hideErrors", true);
+        }
     }
 
     /**
diff --git a/tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java b/tests/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java
new file mode 100644 (file)
index 0000000..026465a
--- /dev/null
@@ -0,0 +1,52 @@
+package com.vaadin.tests.components.progressindicator;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.ProgressIndicator;\r
+import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+\r
+public class ProgressIndicatorInvisible extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        final VerticalLayout lo = new VerticalLayout();\r
+\r
+        addComponent(lo);\r
+\r
+        final ProgressIndicator pi = new ProgressIndicator();\r
+        pi.setPollingInterval(400);\r
+        lo.addComponent(pi);\r
+\r
+        final Button b = new Button("Hide container of progress indicator");\r
+        addComponent(b);\r
+\r
+        b.addListener(new Button.ClickListener() {\r
+            public void buttonClick(ClickEvent event) {\r
+                // If we skip hiding the layout, hiding the ProgressIndicator\r
+                // will stop the polling\r
+                lo.setVisible(!lo.isVisible());\r
+                // Not even this works\r
+                pi.setVisible(!lo.isVisible());\r
+                if (!lo.isVisible()) {\r
+                    b.setCaption("Still polling");\r
+                } else {\r
+                    b.setCaption("Hide container of progress indicator");\r
+                }\r
+\r
+            }\r
+\r
+        });\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Progress indicator does not stop polling when its parent layout is made invisible";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 4014;\r
+    }\r
+\r
+}\r
diff --git a/tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java b/tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java
new file mode 100644 (file)
index 0000000..5f67aa1
--- /dev/null
@@ -0,0 +1,72 @@
+package com.vaadin.tests.layouts;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.GridLayout;\r
+import com.vaadin.ui.Label;\r
+import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+\r
+public class GridLayoutNPE extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        final VerticalLayout lo = new VerticalLayout();\r
+\r
+        final GridLayout gl = new GridLayout(2, 1);\r
+        gl.setSpacing(true);\r
+\r
+        final Label toRemove = new Label("First");\r
+        gl.addComponent(toRemove);\r
+        final Label toEdit = new Label("Second");\r
+        gl.addComponent(toEdit);\r
+\r
+        final Button b = new Button("remove 'First'");\r
+        final Button b2 = new Button("edit 'Second'");\r
+        b2.setVisible(false);\r
+\r
+        lo.addComponent(gl);\r
+        lo.addComponent(b);\r
+        lo.addComponent(b2);\r
+\r
+        b.addListener(new Button.ClickListener() {\r
+\r
+            public void buttonClick(Button.ClickEvent event) {\r
+                gl.removeComponent(toRemove);\r
+\r
+                // move another component to where the first was removed\r
+                // before rendering to the client\r
+                gl.removeComponent(toEdit);\r
+                // this could also be the result of removeAllComponents()\r
+                // followed by a loop of addComponent(c)\r
+                gl.addComponent(toEdit, 0, 0);\r
+\r
+                b.setVisible(false);\r
+                b2.setVisible(true);\r
+\r
+            }\r
+\r
+        });\r
+\r
+        b2.addListener(new Button.ClickListener() {\r
+\r
+            public void buttonClick(ClickEvent event) {\r
+                toEdit.setValue("Second (edited)");\r
+            }\r
+\r
+        });\r
+\r
+        addComponent(lo);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "VGridLayout throws an NPE, causing client side to crash";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 4019;\r
+    }\r
+\r
+}\r