use of fr.univlorraine.ecandidat.views.windows.AdminInesWindow in project esup-ecandidat by EsupPortail.
the class AdminVersionView method init.
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
final Label titleNom = new Label(applicationContext.getMessage("adminVersionView.title", null, UI.getCurrent().getLocale()));
titleNom.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleNom);
versionTable.addGeneratedColumn(SimpleTablePresentation.CHAMPS_ACTION, new ColumnGenerator() {
private static final long serialVersionUID = 7461290324017459118L;
@Override
public Object generateCell(final Table source, final Object itemId, final Object columnId) {
final SimpleTablePresentation bean = (SimpleTablePresentation) itemId;
final OneClickButton btnCheck = new OneClickButton(applicationContext.getMessage("btnCheck", null, UI.getCurrent().getLocale()), FontAwesome.ROTATE_RIGHT);
switch(bean.getCode()) {
case NomenclatureUtils.VERSION_DEMAT:
btnCheck.addClickListener(e -> {
fileController.testDemat(true);
});
return btnCheck;
case NomenclatureUtils.VERSION_SI_SCOL_COD:
btnCheck.addClickListener(e -> {
siScolController.testSiScolConnnexion();
});
return btnCheck;
case NomenclatureUtils.VERSION_WS:
btnCheck.addClickListener(e -> {
siScolController.testWSSiScolConnnexion();
});
return btnCheck;
case NomenclatureUtils.VERSION_WS_PJ:
btnCheck.addClickListener(e -> {
if (demoController.getDemoMode()) {
return;
}
final AdminWsPjWindow window = new AdminWsPjWindow();
UI.getCurrent().addWindow(window);
});
return btnCheck;
case NomenclatureUtils.VERSION_LS:
btnCheck.addClickListener(e -> {
formulaireController.testConnexionLS();
});
return btnCheck;
case NomenclatureUtils.VERSION_INES:
btnCheck.addClickListener(e -> {
final AdminInesWindow window = new AdminInesWindow();
UI.getCurrent().addWindow(window);
});
return btnCheck;
default:
return null;
}
}
});
versionTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (final String fieldName : FIELDS_ORDER) {
versionTable.setColumnHeader(fieldName, applicationContext.getMessage("version." + fieldName, null, UI.getCurrent().getLocale()));
}
versionTable.setSortContainerPropertyId(SimpleTablePresentation.CHAMPS_ORDER);
versionTable.setColumnCollapsingAllowed(false);
versionTable.setColumnReorderingAllowed(false);
versionTable.setSelectable(false);
versionTable.setImmediate(true);
versionTable.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 300);
versionTable.setCellStyleGenerator((components, itemId, columnId) -> {
if (columnId != null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)) {
return (ValoTheme.LABEL_BOLD);
}
return null;
});
addComponent(versionTable);
setExpandRatio(versionTable, 1);
}
Aggregations