aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-10-29 13:44:49 +0200
committerVaadin Code Review <review@vaadin.com>2013-11-19 11:07:24 +0000
commit1c1506ef0447b1d979a6adb4d812ae9858f00b67 (patch)
tree801cd0118eb73c18527739fee512bac3339f2457 /shared
parenta752fcb10935c73f0a9d9d9c7948bfb29fcbb2e2 (diff)
downloadvaadin-framework-1c1506ef0447b1d979a6adb4d812ae9858f00b67.tar.gz
vaadin-framework-1c1506ef0447b1d979a6adb4d812ae9858f00b67.zip
Base grid component and column API (#12829, #12830)
Change-Id: I6c4eae8a4369e9452dd56e764633cecfe9bf553a
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridColumnState.java61
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridState.java52
2 files changed, 113 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
new file mode 100644
index 0000000000..391eb2a65c
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+/**
+ * Column state DTO for transferring column properties from the server to the
+ * client
+ *
+ * @since 7.2
+ * @author Vaadin Ltd
+ */
+public class GridColumnState implements Serializable {
+
+ /**
+ * Id used by grid connector to map server side column with client side
+ * column
+ */
+ public String id;
+
+ /**
+ * Header caption for the column
+ *
+ * FIXME Only single header currently supported. Should support many
+ * headers.
+ */
+ public String header;
+
+ /**
+ * Footer caption for the column
+ *
+ * FIXME Only single footer currently supported. Should support many
+ * footers.
+ */
+ public String footer;
+
+ /**
+ * Has the column been hidden. By default the column is visible.
+ */
+ public boolean visible = true;
+
+ /**
+ * Column width in pixels. Default column width is 100px.
+ */
+ public int width = 100;
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java
new file mode 100644
index 0000000000..e1e0fff354
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java
@@ -0,0 +1,52 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.shared.AbstractComponentState;
+
+/**
+ * The shared state for the {@link com.vaadin.ui.components.grid.Grid} component
+ *
+ * @since 7.2
+ * @author Vaadin Ltd
+ */
+public class GridState extends AbstractComponentState {
+ {
+ // FIXME Grid currently does not support undefined size
+ width = "400px";
+ height = "400px";
+ }
+
+ /**
+ * Columns in grid. Column order implicitly deferred from list order.
+ */
+ public List<GridColumnState> columns = new ArrayList<GridColumnState>();
+
+ /**
+ * Are the header row(s) visible. By default they are visible.
+ */
+ public boolean headerVisible = true;
+
+ /**
+ * Are the footer row(s) visible. By default they are visible.
+ */
+ public boolean footerVisible = true;
+
+}