attempt to create a responsive layout with menu
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Mon, 27 Feb 2017 10:28:51 +0000 (11:28 +0100)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Mon, 27 Feb 2017 12:33:42 +0000 (13:33 +0100)
src/main/java/eu/etaxonomy/cdm/vaadin/themes/valo/ValoMenuLayout.java [new file with mode: 0644]

diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/themes/valo/ValoMenuLayout.java b/src/main/java/eu/etaxonomy/cdm/vaadin/themes/valo/ValoMenuLayout.java
new file mode 100644 (file)
index 0000000..409ac91
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.vaadin.themes.valo;
+
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.themes.ValoTheme;
+
+/**
+ * @author a.kohlbecker
+ * @since Feb 24, 2017
+ *
+ */
+@SuppressWarnings("serial")
+public class ValoMenuLayout extends HorizontalLayout {
+
+    CssLayout contentArea = new CssLayout();
+
+    CssLayout menuArea = new CssLayout();
+
+    public ValoMenuLayout() {
+
+        setSizeFull();
+
+        menuArea.setPrimaryStyleName(ValoTheme.MENU_ROOT);
+
+        contentArea.setPrimaryStyleName("valo-content");
+        contentArea.addStyleName("v-scrollable");
+        contentArea.setSizeFull();
+
+        addComponents(menuArea, contentArea);
+        setExpandRatio(contentArea, 1);
+    }
+
+    public ComponentContainer getContentContainer() {
+        return contentArea;
+    }
+
+    public void addMenu(Component menu) {
+        menu.addStyleName(ValoTheme.MENU_PART);
+        menuArea.addComponent(menu);
+    }
+
+}