diff options
author | John Ahlroos <john@vaadin.com> | 2012-09-27 14:39:38 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-09-27 14:39:38 +0300 |
commit | c886d0d45c45aae2bac026ca7fac9f33b7075832 (patch) | |
tree | f10740a8cf029f0990f9c38181ed4dc50371d352 /client | |
parent | 93d0f638a144d7fb62fe7cc1f5943bff98b3c49c (diff) | |
download | vaadin-framework-c886d0d45c45aae2bac026ca7fac9f33b7075832.tar.gz vaadin-framework-c886d0d45c45aae2bac026ca7fac9f33b7075832.zip |
Fixed layout primary stylenames #9724
Diffstat (limited to 'client')
7 files changed, 22 insertions, 37 deletions
diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java index 26133204e2..6ff51b3766 100644 --- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java @@ -275,7 +275,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * We overwrite the widgets primary stylename if state defines a * primary stylename. Clears all previous stylenames. */ - getWidget().setStyleName(state.primaryStyleName); + getWidget().setStylePrimaryName(state.primaryStyleName); } // Set the core 'v' style name for the widget diff --git a/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java b/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java index 229ef7b676..1f5b58bef3 100644 --- a/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java +++ b/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java @@ -45,8 +45,8 @@ public class VAbsoluteLayout extends ComplexPanel { public VAbsoluteLayout() { setElement(Document.get().createDivElement()); - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); marginElement = Document.get().createDivElement(); canvas.getStyle().setProperty("position", "relative"); canvas.getStyle().setProperty("overflow", "hidden"); diff --git a/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java b/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java index 17666cce13..212a6307be 100644 --- a/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java +++ b/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java @@ -33,8 +33,8 @@ public class VCssLayout extends FlowPanel { */ public VCssLayout() { super(); - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); } /** diff --git a/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java b/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java index 1664a6568f..770499e9b5 100644 --- a/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java +++ b/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java @@ -71,8 +71,8 @@ public class VGridLayout extends ComplexPanel { spacingStyle.setPosition(Position.ABSOLUTE); getElement().appendChild(spacingMeasureElement); - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); } private GridLayoutConnector getConnector() { diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java index 7f8ba2be80..bfcaa89301 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java @@ -15,6 +15,8 @@ */ package com.vaadin.client.ui.orderedlayout; +import com.vaadin.client.StyleConstants; + /** * Represents a layout where the children is ordered vertically */ @@ -26,7 +28,8 @@ public class VHorizontalLayout extends VOrderedLayout { * Default constructor */ public VHorizontalLayout() { - setVertical(false); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); + addStyleName("v-vertical"); } } diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java index a9397b39c2..177af7c350 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java @@ -56,32 +56,6 @@ public class VOrderedLayout extends FlowPanel { private LayoutManager layoutManager; - /** - * Constructor - */ - public VOrderedLayout() { - setStyleName(StyleConstants.UI_LAYOUT); - setVertical(true); - } - - /** - * Does the layout order its children horizontally or vertically - * - * @param vertical - * true to order the childer vertically, false to order them - * horizontally - * - */ - protected void setVertical(boolean vertical) { - this.vertical = vertical; - if (vertical) { - addStyleName("v-vertical"); - removeStyleName("v-horizontal"); - } else { - addStyleName("v-horizontal"); - removeStyleName("v-vertical"); - } - } /** * Add or move a slot to another index diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java index 1ebf47efdd..7b89bb0269 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java @@ -15,6 +15,8 @@ */ package com.vaadin.client.ui.orderedlayout; +import com.vaadin.client.StyleConstants; + /** * Represents a layout where the children is ordered vertically */ @@ -26,7 +28,13 @@ public class VVerticalLayout extends VOrderedLayout { * Default constructor */ public VVerticalLayout() { - setVertical(true); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + } + + @Override + public void setStyleName(String style) { + super.setStyleName(style); + addStyleName(StyleConstants.UI_LAYOUT); + addStyleName("v-vertical"); } } |