aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2014-03-18 16:36:10 +0200
committerLeif Åstrand <leif@vaadin.com>2014-03-19 09:48:46 +0000
commit9b510d35a7ec6b1a9504343b2620110b77d4e5c3 (patch)
tree9d14304ee02cebf2db72d21432fd67c0161a7591 /shared
parentead73d97e402eea6a78c6f0a7e5cacf0bd9a0982 (diff)
downloadvaadin-framework-9b510d35a7ec6b1a9504343b2620110b77d4e5c3.tar.gz
vaadin-framework-9b510d35a7ec6b1a9504343b2620110b77d4e5c3.zip
Adds setHeightByRow support to Grid (#13297)
Change-Id: I67f1bfb476a8af28c0ea1a03758684ca42d1ba48
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridState.java24
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/HeightMode.java42
2 files changed, 66 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java
index 93e602a539..8fdd8c8ec5 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java
@@ -28,6 +28,14 @@ import com.vaadin.shared.AbstractComponentState;
* @author Vaadin Ltd
*/
public class GridState extends AbstractComponentState {
+
+ /**
+ * The default value for height-by-rows for both GWT widgets
+ * {@link com.vaadin.ui.components.grid Grid} and
+ * {@link com.vaadin.client.ui.grid.Escalator Escalator}
+ */
+ public static final double DEFAULT_HEIGHT_BY_ROWS = 10.0d;
+
{
// FIXME Grid currently does not support undefined size
width = "400px";
@@ -61,4 +69,20 @@ public class GridState extends AbstractComponentState {
*/
public String lastFrozenColumnId = null;
+ /** The height of the Grid in terms of body rows. */
+ // @DelegateToWidget
+ /*
+ * Annotation doesn't work because of http://dev.vaadin.com/ticket/12900.
+ * Remove manual code from Connector once fixed
+ */
+ public double heightByRows = DEFAULT_HEIGHT_BY_ROWS;
+
+ /** The mode by which Grid defines its height. */
+ // @DelegateToWidget
+ /*
+ * Annotation doesn't work because of http://dev.vaadin.com/ticket/12900.
+ * Remove manual code from Connector once fixed
+ */
+ public HeightMode heightMode = HeightMode.CSS;
+
}
diff --git a/shared/src/com/vaadin/shared/ui/grid/HeightMode.java b/shared/src/com/vaadin/shared/ui/grid/HeightMode.java
new file mode 100644
index 0000000000..0146e53e73
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/HeightMode.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.grid;
+
+/**
+ * The modes for height calculation that are supported by Grid (
+ * {@link com.vaadin.client.ui.grid.Grid client} and
+ * {@link com.vaadin.ui.components.grid.Grid server}) /
+ * {@link com.vaadin.client.ui.grid.Escalator Escalator}.
+ *
+ * @since 7.2
+ * @author Vaadin Ltd
+ * @see com.vaadin.client.ui.grid.Grid#setHeightMode(HeightMode)
+ * @see com.vaadin.ui.components.grid.Grid#setHeightMode(HeightMode)
+ * @see com.vaadin.client.ui.grid.Escalator#setHeightMode(HeightMode)
+ */
+public enum HeightMode {
+ /**
+ * The height of the Component or Widget is defined by a CSS-like value.
+ * (e.g. "100px", "50em" or "25%")
+ */
+ CSS,
+
+ /**
+ * The height of the Component or Widget in question is defined by a number
+ * of rows.
+ */
+ ROW;
+}