]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed GridLayout caption rendering
authorArtur Signell <artur@vaadin.com>
Thu, 5 Apr 2012 07:40:23 +0000 (10:40 +0300)
committerArtur Signell <artur@vaadin.com>
Thu, 5 Apr 2012 07:42:19 +0000 (10:42 +0300)
Components that do not delegate caption handling to parent should not
get a caption

12 files changed:
src/com/vaadin/terminal/gwt/client/ComponentConnector.java
src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java
src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java
src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java
src/com/vaadin/terminal/gwt/client/ui/FormConnector.java
src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java
src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java
src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java
src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java
src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java
src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java
src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java

index 48d988be765a37cf5ed2196710d413775ecf9c56..34f3f13f031e14115855aa27d7e9e46d886185cf 100644 (file)
@@ -104,4 +104,19 @@ public interface ComponentConnector extends ServerConnector {
 
     public boolean hasEventListener(String eventIdentifier);
 
+    /**
+     * Return true if parent handles caption, false if the paintable handles the
+     * caption itself.
+     * 
+     * <p>
+     * This should always return true and all components should let the parent
+     * handle the caption and use other attributes for internal texts in the
+     * component
+     * </p>
+     * 
+     * @return true if caption handling is delegated to the parent, false if
+     *         parent should not be allowed to render caption
+     */
+    public boolean delegateCaptionHandling();
+
 }
index 023023293d57e49520527e1f375d34f398ba65e9..9ea03381c4b878b1695d8028d99ca0154ee49d70 100644 (file)
@@ -219,18 +219,14 @@ public abstract class AbstractComponentConnector extends AbstractConnector
         }
     }
 
-    /**
-     * Return true if parent handles caption, false if the paintable handles the
-     * caption itself.
-     * 
+    /*
+     * (non-Javadoc)
      * 
-     * @deprecated This should always return true and all components should let
-     *             the parent handle the caption and use other attributes for
-     *             internal texts in the component
-     * @return
+     * @see
+     * com.vaadin.terminal.gwt.client.ComponentConnector#delegateCaptionHandling
+     * ()
      */
-    @Deprecated
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return true;
     }
 
index b905af3d443c762b1fa6f4f48d030338637dc9d1..ddc9b5943096917f8ab7a9cf6c437c7de746c669 100644 (file)
@@ -43,7 +43,7 @@ public class ButtonConnector extends AbstractComponentConnector implements
     }
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 2c7f43fede4319befa31e93c66768012b9a8fd51..5c9193f08bd8120222438d9e8c3bd089535979f7 100644 (file)
@@ -19,7 +19,7 @@ public class CheckBoxConnector extends AbstractFieldConnector implements
         Paintable {
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 0ac6f0cb699618a431eae9231bf5091667dbef82..8e05522eb51adb85434d40e4afbedecf4b860b93 100644 (file)
@@ -49,7 +49,7 @@ public class FormConnector extends AbstractComponentContainerConnector
     }
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index b3bcc3e58d56702a839736c74be3a83387cba260..1aad705109ce9c68d5ac8d9dccd22f1787b6e4f1 100644 (file)
@@ -168,7 +168,9 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector
             needCaptionUpdate = false;
 
             for (ComponentConnector child : getChildren()) {
-                updateCaption(child);
+                if (child.delegateCaptionHandling()) {
+                    updateCaption(child);
+                }
             }
         }
         getLayoutManager().setNeedsUpdate(this);
index 12fbefa80cb64bd4985589f557e088dbd6db003f..715e902b244b340596e19a125b9ed79c0cce9087 100644 (file)
@@ -17,7 +17,7 @@ public class LinkConnector extends AbstractComponentConnector implements
         Paintable {
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 991a184e57ba354e152753a844bbb78acf458316..bf1299ed271c9d4642c83eadd925cb75b022788a 100644 (file)
@@ -27,7 +27,7 @@ public class NativeButtonConnector extends AbstractComponentConnector implements
     }
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 19470da73a317f8742abbbd49937c04ddbf5b115..529353f9902e3968013e1eb13afbf3c977c27138 100644 (file)
@@ -86,7 +86,7 @@ public class PanelConnector extends AbstractComponentContainerConnector
     }
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 5da77c7e56654372889ecb2161071c051aaae1e4..a409b3e5a53352dd2f83194c15cd78a5fcf73a79 100644 (file)
@@ -20,7 +20,7 @@ public class PopupViewConnector extends AbstractComponentContainerConnector
     private boolean centerAfterLayout = false;
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 42b6bbaf5099dbc9ca630e14176cd5a9af25196f..54e6043f1bc72adc0656865d73a54fcefeb9acfa 100644 (file)
@@ -15,7 +15,7 @@ public class UnknownComponentConnector extends AbstractComponentConnector
         implements Paintable {
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     }
 
index 7c50b0f34f9529ce33fe121bc277270eb6d95427..34a3f9a94f373caa808ca3c76f291e483f16a905 100644 (file)
@@ -112,7 +112,7 @@ public class WindowConnector extends AbstractComponentContainerConnector
     private WindowServerRPC rpc;
 
     @Override
-    protected boolean delegateCaptionHandling() {
+    public boolean delegateCaptionHandling() {
         return false;
     };