Revision af8569f7
Added by Andreas Kohlbecker about 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/phycobank/ListViewBean.java | ||
---|---|---|
21 | 21 |
import com.vaadin.navigator.View; |
22 | 22 |
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; |
23 | 23 |
import com.vaadin.server.FontAwesome; |
24 |
import com.vaadin.shared.ui.grid.HeightMode; |
|
24 | 25 |
import com.vaadin.spring.annotation.SpringView; |
25 | 26 |
import com.vaadin.ui.Alignment; |
26 | 27 |
import com.vaadin.ui.Grid; |
... | ... | |
95 | 96 |
public ListViewBean() { |
96 | 97 |
layout = new VerticalLayout(); |
97 | 98 |
layout.setSpacing(true); |
99 |
layout.setSizeFull(); |
|
98 | 100 |
|
99 | 101 |
Label title = new Label("Registrations"); |
100 | 102 |
title.setStyleName(ValoTheme.LABEL_HUGE); |
103 |
title.setWidthUndefined(); |
|
101 | 104 |
layout.addComponent(title); |
102 | 105 |
layout.setComponentAlignment(title, Alignment.TOP_CENTER); |
103 | 106 |
|
104 | 107 |
Label hint = new Label("This is the list of all your registrations in progress."); |
108 |
hint.setWidthUndefined(); |
|
105 | 109 |
layout.addComponent(hint); |
106 | 110 |
layout.setComponentAlignment(hint, Alignment.MIDDLE_CENTER); |
107 | 111 |
|
108 | 112 |
grid = buildGrid(); |
109 | 113 |
layout.addComponent(grid); |
114 |
layout.setExpandRatio(grid, 1); |
|
110 | 115 |
|
111 | 116 |
setCompositionRoot(layout); |
117 |
this.setSizeFull(); |
|
112 | 118 |
} |
113 | 119 |
|
114 | 120 |
private Grid buildGrid() { |
... | ... | |
118 | 124 |
grid.setId("registration-list"); |
119 | 125 |
grid.setCellStyleGenerator(cellRef -> cellRef.getPropertyId().toString()); |
120 | 126 |
grid.setSelectionMode(SelectionMode.NONE); |
127 |
grid.setHeightMode(HeightMode.CSS); |
|
121 | 128 |
// add status as class attribute to the rows to allow styling with css |
122 | 129 |
grid.setRowStyleGenerator(rowRef -> {return "status-" + rowRef.getItem().getItemProperty("status").getValue().toString();}); |
123 | 130 |
return grid; |
Also available in: Unified diff
ref #6169 list view layout improvements and coloring statuses