Revision 5ca9eaf3
Added by Fabian Reimeier over 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/distributionStatus/DistributionTableViewBean.java | ||
---|---|---|
37 | 37 |
import com.vaadin.ui.UI; |
38 | 38 |
import com.vaadin.ui.Window; |
39 | 39 |
|
40 |
import eu.etaxonomy.cdm.i10n.Messages; |
|
40 | 41 |
import eu.etaxonomy.cdm.model.common.Language; |
41 | 42 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
42 | 43 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
... | ... | |
64 | 65 |
implements IDistributionTableView, AccessRestrictedView { |
65 | 66 |
|
66 | 67 |
private static final long serialVersionUID = 1L; |
67 |
public static final String NAME = "distGrid"; |
|
68 |
public static final String NAME = "distGrid"; //$NON-NLS-1$
|
|
68 | 69 |
|
69 | 70 |
@Autowired |
70 | 71 |
private DistributionToolbar toolbar; |
... | ... | |
85 | 86 |
private AbsoluteLayout initLayout() { |
86 | 87 |
AbsoluteLayout mainLayout = new AbsoluteLayout(); |
87 | 88 |
mainLayout.setImmediate(false); |
88 |
mainLayout.setWidth("100%"); |
|
89 |
mainLayout.setHeight("100%"); |
|
89 |
mainLayout.setWidth("100%"); //$NON-NLS-1$
|
|
90 |
mainLayout.setHeight("100%"); //$NON-NLS-1$
|
|
90 | 91 |
|
91 |
setWidth("100.0%"); |
|
92 |
setHeight("100.0%"); |
|
92 |
setWidth("100.0%"); //$NON-NLS-1$
|
|
93 |
setHeight("100.0%"); //$NON-NLS-1$
|
|
93 | 94 |
|
94 | 95 |
//Horizontal Toolbar |
95 |
mainLayout.addComponent(toolbar, "top:0.0px;right:0.0px;"); |
|
96 |
mainLayout.addComponent(toolbar, "top:0.0px;right:0.0px;"); //$NON-NLS-1$
|
|
96 | 97 |
|
97 | 98 |
// // table + formatting |
98 | 99 |
// table = new Table(){ |
... | ... | |
186 | 187 |
grid.setSizeFull(); |
187 | 188 |
grid.setEditorEnabled(true); |
188 | 189 |
grid.setFooterVisible(true); |
189 |
mainLayout.addComponent(grid, "top:75px;right:10.0px;left:10.0px;"); |
|
190 |
mainLayout.addComponent(grid, "top:75px;right:10.0px;left:10.0px;"); //$NON-NLS-1$
|
|
190 | 191 |
|
191 | 192 |
return mainLayout; |
192 | 193 |
} |
... | ... | |
266 | 267 |
uuidColumn.setHidden(true); |
267 | 268 |
Column taxonColumn = grid.getColumn(DistributionStatusQuery.TAXON_COLUMN); |
268 | 269 |
taxonColumn.setEditable(false); |
269 |
taxonColumn.setHeaderCaption("Taxon");
|
|
270 |
taxonColumn.setHeaderCaption(Messages.DistributionTableViewBean_TAXON);
|
|
270 | 271 |
taxonColumn.setLastFrozenColumn(); |
271 | 272 |
|
272 | 273 |
Converter<String, UUID> displayConverter = new PresenceAbsenceTermUuidTitleStringConverter(); |
... | ... | |
283 | 284 |
termSelect.setSizeFull(); |
284 | 285 |
termSelect.setContainerDataSource(getPresenter().getPresenceAbsenceTermContainer()); |
285 | 286 |
termSelect.setItemCaptionMode(ItemCaptionMode.PROPERTY); |
286 |
termSelect.setItemCaptionPropertyId("titleCache"); |
|
287 |
termSelect.setItemCaptionPropertyId("titleCache"); //$NON-NLS-1$
|
|
287 | 288 |
termSelect.setConverter(editorConverter); |
288 | 289 |
termSelect.setImmediate(true); |
289 | 290 |
c.setEditorField(termSelect); |
... | ... | |
314 | 315 |
}else { |
315 | 316 |
footerCell = footerRow.getCell(cells[0]); |
316 | 317 |
} |
317 |
footerCell.setText("Total amount of Taxa displayed: " + gridcontainer.size());
|
|
318 |
footerCell.setText(String.format(Messages.DistributionTableViewBean_TOTAL_TAXA, gridcontainer.size()));
|
|
318 | 319 |
} |
319 | 320 |
|
320 | 321 |
private void createEditClickListener(){ |
321 | 322 |
//details |
322 | 323 |
Button detailButton = toolbar.getDetailButton(); |
323 |
detailButton.setCaption("Taxon Details");
|
|
324 |
detailButton.setCaption(Messages.DistributionTableViewBean_TAXON_DETAILS);
|
|
324 | 325 |
detailButton.addClickListener(event -> { |
325 | 326 |
// Object selectedItemId = DistributionTableViewBean.this.table.getValue(); |
326 | 327 |
Object selectedItemId = DistributionTableViewBean.this.grid.getSelectedRow(); |
... | ... | |
336 | 337 |
getUI().addWindow(window); |
337 | 338 |
} |
338 | 339 |
else{ |
339 |
Notification.show("Please select a taxon", Type.HUMANIZED_MESSAGE);
|
|
340 |
Notification.show(Messages.DistributionTableViewBean_SELECT_TAXON, Type.HUMANIZED_MESSAGE);
|
|
340 | 341 |
} |
341 | 342 |
} |
342 | 343 |
); |
... | ... | |
358 | 359 |
if(distributionStatusConfigWindow==null){ |
359 | 360 |
distributionStatusConfigWindow = new DistributionStatusSettingsConfigWindow(this); |
360 | 361 |
} |
361 |
Window window = distributionStatusConfigWindow.createWindow("Status");
|
|
362 |
window.setWidth("25%"); |
|
363 |
window.setHeight("60%"); |
|
362 |
Window window = distributionStatusConfigWindow.createWindow(Messages.DistributionTableViewBean_STATUS);
|
|
363 |
window.setWidth("25%"); //$NON-NLS-1$
|
|
364 |
window.setHeight("60%"); //$NON-NLS-1$
|
|
364 | 365 |
UI.getCurrent().addWindow(window); |
365 | 366 |
} |
366 | 367 |
|
... | ... | |
372 | 373 |
if(areaAndTaxonConfigWindow==null){ |
373 | 374 |
areaAndTaxonConfigWindow = new AreaAndTaxonSettingsConfigWindow(this); |
374 | 375 |
} |
375 |
Window window = areaAndTaxonConfigWindow.createWindow("Areas and Taxa");
|
|
376 |
Window window = areaAndTaxonConfigWindow.createWindow(Messages.DistributionTableViewBean_AREAS_AND_TAXA);
|
|
376 | 377 |
UI.getCurrent().addWindow(window); |
377 | 378 |
} |
378 | 379 |
|
Also available in: Unified diff
ref #7097 added internationalization for distribution status app