aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-04-05 09:08:17 +0300
committerArtur Signell <artur@vaadin.com>2012-04-05 09:08:17 +0300
commit7cc29fd08fe1da7c6c924f4211ba80b48b960d69 (patch)
treef8c7f7bb4b1e45e0a6292bed14e64bd55402a1e4
parent9b5453c7f909eb162aa458de4ccd998dbe4b4477 (diff)
downloadvaadin-framework-7cc29fd08fe1da7c6c924f4211ba80b48b960d69.tar.gz
vaadin-framework-7cc29fd08fe1da7c6c924f4211ba80b48b960d69.zip
Fixed spacing that was only partly moved to shared state
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java2
-rw-r--r--src/com/vaadin/ui/AbstractOrderedLayout.java32
-rw-r--r--src/com/vaadin/ui/Form.java1
-rw-r--r--src/com/vaadin/ui/GridLayout.java22
-rw-r--r--src/com/vaadin/ui/Layout.java9
5 files changed, 8 insertions, 58 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java
index 188b66e10f..c9faf83e7d 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java
@@ -26,7 +26,7 @@ public abstract class AbstractOrderedLayoutConnector extends
AbstractLayoutConnector implements Paintable, DirectionalManagedLayout {
public static class AbstractOrderedLayoutState extends AbstractLayoutState {
- private boolean spacing = true;
+ private boolean spacing = false;
public boolean isSpacing() {
return spacing;
diff --git a/src/com/vaadin/ui/AbstractOrderedLayout.java b/src/com/vaadin/ui/AbstractOrderedLayout.java
index d911579216..97929dcf25 100644
--- a/src/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/src/com/vaadin/ui/AbstractOrderedLayout.java
@@ -50,11 +50,6 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
private final Map<Component, Float> componentToExpandRatio = new HashMap<Component, Float>();
- /**
- * Is spacing between contained components enabled. Defaults to false.
- */
- private boolean spacing = false;
-
public AbstractOrderedLayout() {
registerRpc(rpc);
}
@@ -184,17 +179,6 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
- // Add spacing attribute (omitted if false)
- if (spacing) {
- target.addAttribute("spacing", spacing);
- }
-
- // Adds all items in all the locations
- for (Component c : components) {
- // Paint child component UIDL
- c.paint(target);
- }
-
// Add child component alignment info to layout tag
target.addAttribute("alignments", componentToAlignment);
target.addAttribute("expandRatios", componentToExpandRatio);
@@ -295,8 +279,8 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
*
* @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean)
*/
- public void setSpacing(boolean enabled) {
- spacing = enabled;
+ public void setSpacing(boolean spacing) {
+ getState().setSpacing(spacing);
requestRepaint();
}
@@ -305,18 +289,8 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
*
* @see com.vaadin.ui.Layout.SpacingHandler#isSpacing()
*/
- @Deprecated
- public boolean isSpacingEnabled() {
- return spacing;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing()
- */
public boolean isSpacing() {
- return spacing;
+ return getState().isSpacing();
}
/**
diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java
index be8c64d5e8..fa0e1d1e31 100644
--- a/src/com/vaadin/ui/Form.java
+++ b/src/com/vaadin/ui/Form.java
@@ -180,6 +180,7 @@ public class Form extends AbstractField<Object> implements Item.Editor,
public Form(Layout formLayout, FormFieldFactory fieldFactory) {
super();
setLayout(formLayout);
+ setFooter(null);
setFormFieldFactory(fieldFactory);
setValidationVisible(false);
setWidth(100, UNITS_PERCENTAGE);
diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java
index 8e7caedc59..c076c8a273 100644
--- a/src/com/vaadin/ui/GridLayout.java
+++ b/src/com/vaadin/ui/GridLayout.java
@@ -19,7 +19,6 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.GridLayoutConnector;
import com.vaadin.terminal.gwt.client.ui.GridLayoutConnector.GridLayoutServerRPC;
import com.vaadin.terminal.gwt.client.ui.GridLayoutConnector.GridLayoutState;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
@@ -91,11 +90,6 @@ public class GridLayout extends AbstractLayout implements
*/
private Map<Component, Alignment> componentToAlignment = new HashMap<Component, Alignment>();
- /**
- * Is spacing between contained components enabled. Defaults to false.
- */
- private boolean spacing = false;
-
private static final Alignment ALIGNMENT_DEFAULT = Alignment.TOP_LEFT;
/**
@@ -1164,8 +1158,8 @@ public class GridLayout extends AbstractLayout implements
*
* @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean)
*/
- public void setSpacing(boolean enabled) {
- spacing = enabled;
+ public void setSpacing(boolean spacing) {
+ getState().setSpacing(spacing);
requestRepaint();
}
@@ -1174,18 +1168,8 @@ public class GridLayout extends AbstractLayout implements
*
* @see com.vaadin.ui.Layout.SpacingHandler#isSpacing()
*/
- @Deprecated
- public boolean isSpacingEnabled() {
- return spacing;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing()
- */
public boolean isSpacing() {
- return spacing;
+ return getState().isSpacing();
}
/**
diff --git a/src/com/vaadin/ui/Layout.java b/src/com/vaadin/ui/Layout.java
index a7cd0abdb4..67bfaa75ff 100644
--- a/src/com/vaadin/ui/Layout.java
+++ b/src/com/vaadin/ui/Layout.java
@@ -178,15 +178,6 @@ public interface Layout extends ComponentContainer, Serializable {
*
* @return true if spacing between child components within this layout
* is enabled, false otherwise
- * @deprecated Use {@link #isSpacing()} instead.
- */
- @Deprecated
- public boolean isSpacingEnabled();
-
- /**
- *
- * @return true if spacing between child components within this layout
- * is enabled, false otherwise
*/
public boolean isSpacing();
}