summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-08-09 11:27:14 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-09 11:27:14 +0300
commit69fb1c9895298da6f45cc00763515944aeb9c22d (patch)
treeb2f6e25aaf411d50dc1d1f02ca9f7cebd53f668d /client
parent40547e6914cd62ba6a718c00a2117451bf25c36d (diff)
downloadvaadin-framework-69fb1c9895298da6f45cc00763515944aeb9c22d.tar.gz
vaadin-framework-69fb1c9895298da6f45cc00763515944aeb9c22d.zip
Implement SimpleManagedLayout for CompositeConnector (#9791)
Fixes #9788
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/composite/CompositeConnector.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/composite/CompositeConnector.java b/client/src/main/java/com/vaadin/client/ui/composite/CompositeConnector.java
index 916363cf23..3322063d51 100644
--- a/client/src/main/java/com/vaadin/client/ui/composite/CompositeConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/composite/CompositeConnector.java
@@ -20,8 +20,10 @@ import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
+import com.vaadin.client.DirectionalManagedLayout;
import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.ui.AbstractHasComponentsConnector;
+import com.vaadin.client.ui.SimpleManagedLayout;
import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
@@ -35,7 +37,8 @@ import com.vaadin.ui.Composite;
* @since 8.1
*/
@Connect(value = Composite.class, loadStyle = LoadStyle.EAGER)
-public class CompositeConnector extends AbstractHasComponentsConnector {
+public class CompositeConnector extends AbstractHasComponentsConnector
+ implements SimpleManagedLayout {
private ComponentConnector childConnector;
@@ -97,8 +100,20 @@ public class CompositeConnector extends AbstractHasComponentsConnector {
}
@Override
- protected void sendContextClickEvent(MouseEventDetails details, EventTarget eventTarget) {
- //Do nothing, because Composite is not an actual component, and the event
- //must be handled in inner components.
+ protected void sendContextClickEvent(MouseEventDetails details,
+ EventTarget eventTarget) {
+ // Do nothing, because Composite is not an actual component, and the
+ // event must be handled in inner components.
+ }
+
+ @Override
+ public void layout() {
+ // Pass on the layout to the appropriate method in child connector
+ if (childConnector instanceof SimpleManagedLayout) {
+ ((SimpleManagedLayout) childConnector).layout();
+ } else if (childConnector instanceof DirectionalManagedLayout) {
+ ((DirectionalManagedLayout) childConnector).layoutHorizontally();
+ ((DirectionalManagedLayout) childConnector).layoutVertically();
+ }
}
}