]> source.dussan.org Git - vaadin-framework.git/commitdiff
Applied proper formatting
authorJohn Ahlroos <john@vaadin.com>
Wed, 5 Sep 2012 15:04:37 +0000 (18:04 +0300)
committerJohn Ahlroos <john@vaadin.com>
Wed, 5 Sep 2012 15:04:37 +0000 (18:04 +0300)
client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java

index 8807fcfbc0cd4de0105cc6703df8d86e4d39a4bd..d7b05207849d34384f345d607705dde3aea41784 100644 (file)
@@ -239,45 +239,44 @@ public abstract class AbstractOrderedLayoutConnector extends
         String iconUrlString = iconUrl != null ? iconUrl.toString() : null;
         List<String> styles = child.getState().styles;
         String error = child.getState().errorMessage;
-                boolean showError = error != null;
-                if (child.getState() instanceof AbstractFieldState) {
-                    AbstractFieldState abstractFieldState = (AbstractFieldState) child
-                            .getState();
+        boolean showError = error != null;
+        if (child.getState() instanceof AbstractFieldState) {
+            AbstractFieldState abstractFieldState = (AbstractFieldState) child
+                    .getState();
             showError = showError && !abstractFieldState.hideErrors;
-                }
-                boolean required = false;
-                if (child instanceof AbstractFieldConnector) {
-                    required = ((AbstractFieldConnector) child).isRequired();
-                }
+        }
+        boolean required = false;
+        if (child instanceof AbstractFieldConnector) {
+            required = ((AbstractFieldConnector) child).isRequired();
+        }
         boolean enabled = child.getState().enabled;
 
         slot.setCaption(caption, iconUrlString, styles, error, showError,
-                required,
-                        enabled);
+                required, enabled);
 
-                slot.setRelativeWidth(child.isRelativeWidth());
-                slot.setRelativeHeight(child.isRelativeHeight());
+        slot.setRelativeWidth(child.isRelativeWidth());
+        slot.setRelativeHeight(child.isRelativeHeight());
 
-                if (slot.hasCaption()) {
-                    CaptionPosition pos = slot.getCaptionPosition();
-                    getLayoutManager().addElementResizeListener(
-                            slot.getCaptionElement(), slotCaptionResizeListener);
-                    if (child.isRelativeHeight()
-                            && (pos == CaptionPosition.TOP || pos == CaptionPosition.BOTTOM)) {
-                        getWidget().updateCaptionOffset(slot.getCaptionElement());
-                    } else if (child.isRelativeWidth()
-                            && (pos == CaptionPosition.LEFT || pos == CaptionPosition.RIGHT)) {
-                        getWidget().updateCaptionOffset(slot.getCaptionElement());
-                    }
-                } else {
-                    childCaptionElementHeight.remove(child.getWidget().getElement());
-                }
+        if (slot.hasCaption()) {
+            CaptionPosition pos = slot.getCaptionPosition();
+            getLayoutManager().addElementResizeListener(
+                    slot.getCaptionElement(), slotCaptionResizeListener);
+            if (child.isRelativeHeight()
+                    && (pos == CaptionPosition.TOP || pos == CaptionPosition.BOTTOM)) {
+                getWidget().updateCaptionOffset(slot.getCaptionElement());
+            } else if (child.isRelativeWidth()
+                    && (pos == CaptionPosition.LEFT || pos == CaptionPosition.RIGHT)) {
+                getWidget().updateCaptionOffset(slot.getCaptionElement());
+            }
+        } else {
+            childCaptionElementHeight.remove(child.getWidget().getElement());
+        }
 
-                updateLayoutHeight();
+        updateLayoutHeight();
 
-                if (needsExpand()) {
+        if (needsExpand()) {
             getWidget().updateExpand();
-                }
+        }
     }
 
     /*
@@ -317,9 +316,9 @@ public abstract class AbstractOrderedLayoutConnector extends
                         childComponentResizeListener);
                 if (slot.hasCaption()) {
                     getLayoutManager()
-                    .removeElementResizeListener(
-                            slot.getCaptionElement(),
-                            slotCaptionResizeListener);
+                            .removeElementResizeListener(
+                                    slot.getCaptionElement(),
+                                    slotCaptionResizeListener);
                 }
                 if (slot.getSpacingElement() != null) {
                     getLayoutManager().removeElementResizeListener(
@@ -401,7 +400,6 @@ public abstract class AbstractOrderedLayoutConnector extends
         updateLayoutHeight();
     }
 
-
     /**
      * Does the layout need a fixed height?
      */
@@ -442,32 +440,40 @@ public abstract class AbstractOrderedLayoutConnector extends
         Slot slot = getWidget().getSlot(child.getWidget());
 
         // Clear all possible listeners first
-        rmeoveResizeListener(slot.getWidget().getElement(), childComponentResizeListener);
+        rmeoveResizeListener(slot.getWidget().getElement(),
+                childComponentResizeListener);
         if (slot.hasCaption()) {
-            rmeoveResizeListener(slot.getCaptionElement(), slotCaptionResizeListener);
+            rmeoveResizeListener(slot.getCaptionElement(),
+                    slotCaptionResizeListener);
         }
         if (slot.hasSpacing()) {
-            rmeoveResizeListener(slot.getSpacingElement(), spacingResizeListener);
+            rmeoveResizeListener(slot.getSpacingElement(),
+                    spacingResizeListener);
         }
 
         // Add all necessary listeners
         if (needsFixedHeight()) {
-            addResizeListener(slot.getWidget().getElement(), childComponentResizeListener);
+            addResizeListener(slot.getWidget().getElement(),
+                    childComponentResizeListener);
             if (slot.hasCaption()) {
-                addResizeListener(slot.getCaptionElement(), slotCaptionResizeListener);
+                addResizeListener(slot.getCaptionElement(),
+                        slotCaptionResizeListener);
             }
         } else if ((child.isRelativeHeight() || child.isRelativeWidth())
                 && slot.hasCaption()) {
             // If the slot has caption, we need to listen for it's size changes
             // in order to update the padding/margin offset for relative sized
             // components
-            addResizeListener(slot.getCaptionElement(), slotCaptionResizeListener);
+            addResizeListener(slot.getCaptionElement(),
+                    slotCaptionResizeListener);
         }
 
         if (needsExpand()) {
-            addResizeListener(slot.getWidget().getElement(), childComponentResizeListener);
+            addResizeListener(slot.getWidget().getElement(),
+                    childComponentResizeListener);
             if (slot.hasSpacing()) {
-                addResizeListener(slot.getSpacingElement(), spacingResizeListener);
+                addResizeListener(slot.getSpacingElement(),
+                        spacingResizeListener);
             }
         }
 
@@ -548,11 +554,13 @@ public abstract class AbstractOrderedLayoutConnector extends
         for (ComponentConnector child : getChildComponents()) {
             Slot slot = getWidget().getSlot(child.getWidget());
             if (slot.hasCaption()) {
-                rmeoveResizeListener(slot.getCaptionElement(), slotCaptionResizeListener);
+                rmeoveResizeListener(slot.getCaptionElement(),
+                        slotCaptionResizeListener);
             }
 
             if (slot.getSpacingElement() != null) {
-                rmeoveResizeListener(slot.getSpacingElement(), spacingResizeListener);
+                rmeoveResizeListener(slot.getSpacingElement(),
+                        spacingResizeListener);
             }
 
             rmeoveResizeListener(slot.getWidget().getElement(),
index 9c45680d92b4dd59db5c593a60eece72fa445ea5..7dc816f2877928133b0360c7a31c8d8552a0cf87 100644 (file)
@@ -504,6 +504,7 @@ public class VOrderedLayout extends FlowPanel {
          *            static width
          */
         private boolean relativeWidth = false;
+
         protected void setRelativeWidth(boolean relativeWidth) {
             this.relativeWidth = relativeWidth;
             updateRelativeSize(relativeWidth, "width");
@@ -517,6 +518,7 @@ public class VOrderedLayout extends FlowPanel {
          *            has a static height
          */
         private boolean relativeHeight = false;
+
         protected void setRelativeHeight(boolean relativeHeight) {
             this.relativeHeight = relativeHeight;
             updateRelativeSize(relativeHeight, "height");
@@ -535,7 +537,7 @@ public class VOrderedLayout extends FlowPanel {
                 captionWrap.getStyle().setProperty(
                         direction,
                         getWidget().getElement().getStyle()
-                        .getProperty(direction));
+                                .getProperty(direction));
                 captionWrap.addClassName("v-has-" + direction);
             } else if (hasCaption()) {
                 if (direction.equals("height")) {
@@ -665,7 +667,7 @@ public class VOrderedLayout extends FlowPanel {
     public void setLayoutManager(LayoutManager manager) {
         layoutManager = manager;
     }
-    
+
     /**
      * Get the layout manager used by this layout
      * 
@@ -935,11 +937,11 @@ public class VOrderedLayout extends FlowPanel {
             if (vertical) {
                 expandWrapper.getStyle().setPaddingTop(totalSize, Unit.PX);
                 expandWrapper.getFirstChildElement().getStyle()
-                .setMarginTop(-totalSize, Unit.PX);
+                        .setMarginTop(-totalSize, Unit.PX);
             } else {
                 expandWrapper.getStyle().setPaddingLeft(totalSize, Unit.PX);
                 expandWrapper.getFirstChildElement().getStyle()
-                .setMarginLeft(-totalSize, Unit.PX);
+                        .setMarginLeft(-totalSize, Unit.PX);
             }
 
             recalculateExpands();
@@ -980,7 +982,7 @@ public class VOrderedLayout extends FlowPanel {
                 newHeight = getElement().getOffsetHeight();
             }
             VOrderedLayout.this.getElement().getStyle()
-            .setHeight(newHeight, Unit.PX);
+                    .setHeight(newHeight, Unit.PX);
         }
     }