summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/GridLayout.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-03-25 23:31:19 +0200
committerArtur Signell <artur@vaadin.com>2013-04-02 13:34:22 +0300
commitfb30fffdcb4c1e1e07e4ec8c1dc68f8104c911ee (patch)
tree70978f5238df68b9cf036bd323a74d2d10922337 /server/src/com/vaadin/ui/GridLayout.java
parentdd157ae121433673c85c3c10b013af404fe2204b (diff)
downloadvaadin-framework-fb30fffdcb4c1e1e07e4ec8c1dc68f8104c911ee.tar.gz
vaadin-framework-fb30fffdcb4c1e1e07e4ec8c1dc68f8104c911ee.zip
Enable setting default alignment for VerticalLayout, HorizontalLayout, GridLayout (#11421)
Change-Id: I56b14a6a027dc700748f2bd7219b47e1134bb56a
Diffstat (limited to 'server/src/com/vaadin/ui/GridLayout.java')
-rw-r--r--server/src/com/vaadin/ui/GridLayout.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java
index e60d9c676a..60664c8937 100644
--- a/server/src/com/vaadin/ui/GridLayout.java
+++ b/server/src/com/vaadin/ui/GridLayout.java
@@ -92,6 +92,7 @@ public class GridLayout extends AbstractLayout implements
private Map<Integer, Float> columnExpandRatio = new HashMap<Integer, Float>();
private Map<Integer, Float> rowExpandRatio = new HashMap<Integer, Float>();
+ private Alignment defaultComponentAlignment = Alignment.TOP_LEFT;
/**
* Constructor for a grid of given size (number of columns and rows).
@@ -573,6 +574,7 @@ public class GridLayout extends AbstractLayout implements
int row2) {
this.component = component;
childData = new ChildComponentData();
+ childData.alignment = getDefaultComponentAlignment().getBitMask();
childData.column1 = column1;
childData.row1 = row1;
childData.column2 = column2;
@@ -1226,4 +1228,25 @@ public class GridLayout extends AbstractLayout implements
return new MarginInfo(getState().marginsBitmask);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.Layout.AlignmentHandler#getDefaultComponentAlignment()
+ */
+ @Override
+ public Alignment getDefaultComponentAlignment() {
+ return defaultComponentAlignment;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.ui.Layout.AlignmentHandler#setDefaultComponentAlignment(com
+ * .vaadin.ui.Alignment)
+ */
+ public void setDefaultComponentAlignment(Alignment defaultAlignment) {
+ defaultComponentAlignment = defaultAlignment;
+ }
+
}