Revision a5f65726
Added by Andreas Kohlbecker about 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/themes/valo/ValoMenuLayout.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.cdm.vaadin.themes.valo; |
|
10 |
|
|
11 |
import com.vaadin.ui.Component; |
|
12 |
import com.vaadin.ui.ComponentContainer; |
|
13 |
import com.vaadin.ui.CssLayout; |
|
14 |
import com.vaadin.ui.HorizontalLayout; |
|
15 |
import com.vaadin.ui.themes.ValoTheme; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author a.kohlbecker |
|
19 |
* @since Feb 24, 2017 |
|
20 |
* |
|
21 |
*/ |
|
22 |
@SuppressWarnings("serial") |
|
23 |
public class ValoMenuLayout extends HorizontalLayout { |
|
24 |
|
|
25 |
CssLayout contentArea = new CssLayout(); |
|
26 |
|
|
27 |
CssLayout menuArea = new CssLayout(); |
|
28 |
|
|
29 |
public ValoMenuLayout() { |
|
30 |
|
|
31 |
setSizeFull(); |
|
32 |
|
|
33 |
menuArea.setPrimaryStyleName(ValoTheme.MENU_ROOT); |
|
34 |
|
|
35 |
contentArea.setPrimaryStyleName("valo-content"); |
|
36 |
contentArea.addStyleName("v-scrollable"); |
|
37 |
contentArea.setSizeFull(); |
|
38 |
|
|
39 |
addComponents(menuArea, contentArea); |
|
40 |
setExpandRatio(contentArea, 1); |
|
41 |
} |
|
42 |
|
|
43 |
public ComponentContainer getContentContainer() { |
|
44 |
return contentArea; |
|
45 |
} |
|
46 |
|
|
47 |
public void addMenu(Component menu) { |
|
48 |
menu.addStyleName(ValoTheme.MENU_PART); |
|
49 |
menuArea.addComponent(menu); |
|
50 |
} |
|
51 |
|
|
52 |
} |
Also available in: Unified diff
attempt to create a responsive layout with menu