Revision eca2b6b0
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/vaadin/ui/view/ViewAreaBean.java | ||
---|---|---|
10 | 10 |
import com.vaadin.ui.CssLayout; |
11 | 11 |
import com.vaadin.ui.HorizontalLayout; |
12 | 12 |
|
13 |
import eu.etaxonomy.cdm.vaadin.toolbar.Toolbar; |
|
13 | 14 |
import eu.etaxonomy.vaadin.ui.MainMenu; |
14 | 15 |
|
15 | 16 |
/** |
... | ... | |
23 | 24 |
|
24 | 25 |
@SpringComponent |
25 | 26 |
@UIScope |
26 |
class ViewAreaBean extends HorizontalLayout implements ViewDisplay { |
|
27 |
class ViewAreaBean extends HorizontalLayout implements ViewDisplay, ToolbarDisplay {
|
|
27 | 28 |
|
28 | 29 |
private static final long serialVersionUID = -3763800167385449693L; |
29 | 30 |
|
30 | 31 |
private MainMenu mainMenu; |
31 | 32 |
|
33 |
private Component toolbar = null; |
|
34 |
|
|
32 | 35 |
private CssLayout contentArea; |
33 | 36 |
|
34 |
public ViewAreaBean() { |
|
35 |
setSizeFull(); |
|
37 |
private CssLayout mainArea; |
|
36 | 38 |
|
37 |
contentArea = new CssLayout(); |
|
38 |
contentArea.setPrimaryStyleName("valo-content"); |
|
39 |
contentArea.addStyleName("v-scrollable"); |
|
40 |
contentArea.setSizeFull(); |
|
39 |
public ViewAreaBean() { |
|
41 | 40 |
|
42 |
addComponent(contentArea); |
|
43 |
setExpandRatio(contentArea, 1); |
|
44 |
} |
|
41 |
setSizeFull(); |
|
42 |
|
|
43 |
mainArea = new CssLayout(); |
|
44 |
mainArea.setPrimaryStyleName("valo-toolbar"); |
|
45 |
mainArea.setSizeFull(); |
|
46 |
contentArea = new CssLayout(); |
|
47 |
contentArea.setPrimaryStyleName("valo-content"); |
|
48 |
contentArea.addStyleName("v-scrollable"); |
|
49 |
contentArea.setSizeFull(); |
|
50 |
|
|
51 |
mainArea.addComponent(contentArea); |
|
52 |
addComponent(mainArea); |
|
53 |
setExpandRatio(mainArea, 1); |
|
54 |
} |
|
45 | 55 |
|
46 | 56 |
@Autowired |
47 | 57 |
public void setMainMenu(MainMenu mainMenu) { |
... | ... | |
49 | 59 |
addComponentAsFirst(this.mainMenu.asComponent()); |
50 | 60 |
} |
51 | 61 |
|
52 |
// TODO was this needed to avoid bean loading problems? Otherwise remove it |
|
53 |
// private MainMenu mainMenuInstantiator; |
|
54 |
// @PostConstruct |
|
55 |
// protected void initialize() { |
|
56 |
// if (mainMenuInstantiator.isAmbiguous()) { |
|
57 |
// throw new RuntimeException("Ambiguous main menu implementations available, please refine your deployment"); |
|
58 |
// } |
|
59 |
// |
|
60 |
// if (!mainMenuInstantiator.isUnsatisfied()) { |
|
61 |
// mainMenu = mainMenuInstantiator.get(); |
|
62 |
// addComponentAsFirst(mainMenu.asComponent()); |
|
63 |
// } |
|
64 |
// } |
|
62 |
|
|
63 |
@Override |
|
64 |
public void setToolbar(Toolbar toolbar) { |
|
65 |
toolbar.initialize(); |
|
66 |
this.toolbar = toolbar.asComponent(); |
|
67 |
this.toolbar.setPrimaryStyleName("valo-navigation-bar"); |
|
68 |
mainArea.addComponentAsFirst(this.toolbar); |
|
69 |
} |
|
65 | 70 |
|
66 | 71 |
@Override |
67 | 72 |
public void showView(View view) { |
Also available in: Unified diff
fix #6997 toolbar with login logout and user name and icon