use of com.vaadin.ui.PopupView.Content in project esup-ecandidat by EsupPortail.
the class CandidatureViewTemplate method addLegend.
/**
* @param isArchived
* @param isCanceled
*/
private void addLegend() {
/* Param sva */
final String alertSvaDat = parametreController.getAlertSvaDat();
/* Vérification qu'on a bien une légende à afficher */
if ((listeAlertesSva.size() == 0 || alertSvaDat == null || alertSvaDat.equals(NomenclatureUtils.CAND_DAT_NO_DAT)) && listeTags.size() == 0) {
return;
}
final VerticalLayout vlAlert = new VerticalLayout();
vlAlert.setMargin(true);
vlAlert.setSpacing(true);
/* Ajout de la légende d'alertes SVA */
if (listeAlertesSva.size() != 0 && alertSvaDat != null && !alertSvaDat.equals(NomenclatureUtils.CAND_DAT_NO_DAT)) {
final Label labelTitleSva = new Label(applicationContext.getMessage("alertSva.popup.title", new Object[] { alertSvaController.getLibelleDateSVA(parametreController.getAlertSvaDat()) }, UI.getCurrent().getLocale()));
labelTitleSva.addStyleName(ValoTheme.LABEL_LARGE);
labelTitleSva.addStyleName(ValoTheme.LABEL_BOLD);
vlAlert.addComponent(labelTitleSva);
listeAlertesSva.forEach(alert -> {
vlAlert.addComponent(new Label(getHtmlLegend(alert.getColorSva(), applicationContext.getMessage("alertSva.popup.alert", new Object[] { alert.getNbJourSva() }, UI.getCurrent().getLocale())), ContentMode.HTML));
});
}
/* Ajout de la légende de Tag */
if (listeTags.size() != 0) {
final Label labelTitleTag = new Label(applicationContext.getMessage("tag.popup.title", null, UI.getCurrent().getLocale()));
labelTitleTag.addStyleName(ValoTheme.LABEL_LARGE);
labelTitleTag.addStyleName(ValoTheme.LABEL_BOLD);
vlAlert.addComponent(labelTitleTag);
listeTags.forEach(tag -> {
vlAlert.addComponent(new Label(getHtmlLegend(tag.getColorTag(), tag.getLibTag()), ContentMode.HTML));
});
}
final Content content = new Content() {
@Override
public String getMinimizedValueAsHTML() {
return applicationContext.getMessage("legend.popup.link", null, UI.getCurrent().getLocale());
}
@Override
public Component getPopupComponent() {
return vlAlert;
}
};
/* Legende alertes SVA */
pvLegende.setContent(content);
pvLegende.setVisible(true);
}
use of com.vaadin.ui.PopupView.Content in project esup-ecandidat by EsupPortail.
the class CandidatureViewTemplate method createPopUpAstuce.
/**
* Créé la popup d'astuce
*/
private Content createPopUpAstuce() {
final VerticalLayout vlAstuce = new VerticalLayout();
vlAstuce.setMargin(true);
vlAstuce.setSpacing(true);
final Label labelTitle = new Label(applicationContext.getMessage("candidature.change.commission.astuce.title", null, UI.getCurrent().getLocale()));
labelTitle.addStyleName(ValoTheme.LABEL_LARGE);
labelTitle.addStyleName(ValoTheme.LABEL_BOLD);
vlAstuce.addComponent(labelTitle);
vlAstuce.addComponent(new Label(applicationContext.getMessage("candidature.change.commission.astuce.content", null, UI.getCurrent().getLocale()), ContentMode.HTML));
return new Content() {
@Override
public String getMinimizedValueAsHTML() {
return applicationContext.getMessage("candidature.change.commission.astuce.link", null, UI.getCurrent().getLocale());
}
@Override
public Component getPopupComponent() {
return vlAstuce;
}
};
}
Aggregations