Revision 388cf82b
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/vaadin/ui/view/ViewAreaBean.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import com.vaadin.navigator.View; |
6 | 6 |
import com.vaadin.navigator.ViewDisplay; |
7 |
import com.vaadin.shared.ui.MarginInfo; |
|
7 | 8 |
import com.vaadin.spring.annotation.SpringComponent; |
8 | 9 |
import com.vaadin.spring.annotation.UIScope; |
9 | 10 |
import com.vaadin.ui.Component; |
10 |
import com.vaadin.ui.CssLayout; |
|
11 | 11 |
import com.vaadin.ui.HorizontalLayout; |
12 |
import com.vaadin.ui.VerticalLayout; |
|
12 | 13 |
|
13 | 14 |
import eu.etaxonomy.cdm.vaadin.toolbar.Toolbar; |
14 | 15 |
import eu.etaxonomy.vaadin.ui.MainMenu; |
... | ... | |
32 | 33 |
|
33 | 34 |
private Component toolbar = null; |
34 | 35 |
|
35 |
private CssLayout contentArea;
|
|
36 |
// private VerticalLayout contentArea;
|
|
36 | 37 |
|
37 |
private CssLayout mainArea; |
|
38 |
private VerticalLayout mainArea; |
|
39 |
|
|
40 |
private Component currentViewComponent = null; |
|
38 | 41 |
|
39 | 42 |
public ViewAreaBean() { |
40 | 43 |
|
41 | 44 |
setSizeFull(); |
42 | 45 |
|
43 |
mainArea = new CssLayout();
|
|
46 |
mainArea = new VerticalLayout();
|
|
44 | 47 |
mainArea.setPrimaryStyleName("valo-toolbar"); |
45 | 48 |
mainArea.setSizeFull(); |
46 |
contentArea = new CssLayout(); |
|
47 |
contentArea.setPrimaryStyleName("valo-content"); |
|
48 |
contentArea.addStyleName("v-scrollable"); |
|
49 |
contentArea.setSizeFull(); |
|
49 |
mainArea.setMargin(new MarginInfo(false, false, true, false)); |
|
50 | 50 |
|
51 |
mainArea.addComponent(contentArea); |
|
52 | 51 |
addComponent(mainArea); |
53 | 52 |
setExpandRatio(mainArea, 1); |
54 | 53 |
} |
... | ... | |
70 | 69 |
|
71 | 70 |
@Override |
72 | 71 |
public void showView(View view) { |
73 |
contentArea.removeAllComponents(); |
|
74 |
contentArea.addComponent(Component.class.cast(view)); |
|
72 |
if(currentViewComponent != null){ |
|
73 |
mainArea.removeComponent(currentViewComponent); |
|
74 |
} |
|
75 |
currentViewComponent = Component.class.cast(view); |
|
76 |
mainArea.addComponent(currentViewComponent); |
|
77 |
mainArea.setExpandRatio(Component.class.cast(view), 1); |
|
75 | 78 |
} |
76 | 79 |
|
77 | 80 |
} |
Also available in: Unified diff
solving layout problems related to hight and scrolling