Revision 6f0224b6
Added by Patrick Plitzner over 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionTableView.java | ||
---|---|---|
22 | 22 |
import com.vaadin.ui.ComboBox; |
23 | 23 |
import com.vaadin.ui.CustomComponent; |
24 | 24 |
import com.vaadin.ui.Notification; |
25 |
import com.vaadin.ui.Notification.Type; |
|
25 | 26 |
import com.vaadin.ui.Table; |
26 | 27 |
import com.vaadin.ui.Table.ColumnGenerator; |
27 | 28 |
import com.vaadin.ui.Window; |
... | ... | |
117 | 118 |
this.listener = listener; |
118 | 119 |
} |
119 | 120 |
|
120 |
@Override |
|
121 |
public void enter(ViewChangeEvent event) { |
|
122 |
} |
|
123 |
|
|
124 |
public void dataBinding() throws SQLException{ |
|
125 |
CdmSQLContainer container = listener.getSQLContainer(); |
|
121 |
@Override |
|
122 |
public void enter(ViewChangeEvent event) { |
|
123 |
CdmSQLContainer container = null; |
|
124 |
try { |
|
125 |
container = listener.getSQLContainer(); |
|
126 |
} catch (SQLException e) { |
|
127 |
Notification.show("Could not acces data base", Type.ERROR_MESSAGE); |
|
128 |
e.printStackTrace(); |
|
129 |
return; |
|
130 |
} |
|
126 | 131 |
|
127 | 132 |
table.setContainerDataSource(container); |
128 | 133 |
table.setColumnReorderingAllowed(true); |
... | ... | |
144 | 149 |
table.setColumnFooter(CdmQueryFactory.TAXON_COLUMN, "Total amount of Taxa displayed: " + container.size()); |
145 | 150 |
|
146 | 151 |
table.setCacheRate(20); |
147 |
|
|
152 |
|
|
148 | 153 |
//add generated columns for NamedAreas |
149 | 154 |
Collection<?> containerPropertyIds = table.getContainerPropertyIds(); |
150 | 155 |
for (Object object : containerPropertyIds) { |
151 | 156 |
if(termList.contains(object)){ |
152 |
table.addGeneratedColumn(object, new AreaColumnGenerator());
|
|
157 |
table.addGeneratedColumn(object, new AreaColumnGenerator()); |
|
153 | 158 |
} |
154 | 159 |
} |
155 | 160 |
} |
156 | 161 |
|
157 |
|
|
158 | 162 |
private void createEditClickListener(){ |
159 | 163 |
Button detailButton = toolbar.getDetailButton(); |
160 | 164 |
detailButton.setCaption("Detail View"); |
Also available in: Unified diff
ref #5458 Do view data binding in enter() method of table view