本文整理匯總了Java中com.vaadin.server.FontAwesome.PENCIL屬性的典型用法代碼示例。如果您正苦於以下問題:Java FontAwesome.PENCIL屬性的具體用法?Java FontAwesome.PENCIL怎麽用?Java FontAwesome.PENCIL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.vaadin.server.FontAwesome
的用法示例。
在下文中一共展示了FontAwesome.PENCIL屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
super.init();
setNavigationButton(CandidatAdresseView.NAME, (parametreController.getIsGetCursusInterne()?CandidatCursusInterneView.NAME:CandidatCursusExterneView.NAME));
/*Edition des donneés*/
OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnSaisir", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEdit.addClickListener(e -> {
candidatParcoursController.editBac(candidat, this);
});
addGenericButton(btnEdit, Alignment.MIDDLE_LEFT);
noInfoLabel = new Label(applicationContext.getMessage("infobac.noinfo", null, UI.getCurrent().getLocale()));
addGenericComponent(noInfoLabel);
/*Table de présentation*/
table.setSizeFull();
table.setVisibleColumns((Object[]) FIELDS_ORDER_BAC);
table.setColumnCollapsingAllowed(false);
table.setColumnReorderingAllowed(false);
table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
table.setSelectable(false);
table.setImmediate(true);
table.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 250);
table.setCellStyleGenerator((components, itemId, columnId)->{
if (columnId!=null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)){
return (ValoTheme.LABEL_BOLD);
}
return null;
});
addGenericComponent(table);
setGenericExpandRatio(table);
}
示例2: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
super.init();
setNavigationButton(CandidatInfoPersoView.NAME, CandidatBacView.NAME);
/*Edition des donneés d'adresse*/
OneClickButton btnEdit = new OneClickButton(FontAwesome.PENCIL);
btnEdit.setCaption(applicationContext.getMessage("adresse.edit.btn", null, UI.getCurrent().getLocale()));
btnEdit.addClickListener(e -> {
candidatController.editAdresse(cptMin, this);
});
addGenericButton(btnEdit, Alignment.MIDDLE_LEFT);
noInfoLabel.setValue(applicationContext.getMessage("adresse.noinfo", null, UI.getCurrent().getLocale()));
addGenericComponent(noInfoLabel);
/*L'adresse*/
table.setSizeFull();
table.setVisibleColumns((Object[]) FIELDS_ORDER);
table.setColumnCollapsingAllowed(false);
table.setColumnReorderingAllowed(false);
table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
table.setSelectable(false);
table.setImmediate(true);
table.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 250);
table.setCellStyleGenerator((components, itemId, columnId)->{
if (columnId!=null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)){
return (ValoTheme.LABEL_BOLD);
}
return null;
});
addGenericComponent(table);
setGenericExpandRatio(table);
}
示例3: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
Label titleParam = new Label(applicationContext.getMessage("typeTraitement.title", null, UI.getCurrent().getLocale()));
titleParam.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleParam);
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
addComponent(buttonsLayout);
OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEdit.setEnabled(false);
btnEdit.addClickListener(e -> {
if (typeTraitementTable.getValue() instanceof TypeTraitement) {
nomenclatureTypeController.editTypeTraitement((TypeTraitement) typeTraitementTable.getValue());
}
});
buttonsLayout.addComponent(btnEdit);
buttonsLayout.setComponentAlignment(btnEdit, Alignment.MIDDLE_LEFT);
/* Table des typeTraitements */
typeTraitementTable.setContainerDataSource(new BeanItemContainer<TypeTraitement>(TypeTraitement.class, nomenclatureTypeController.getTypeTraitements()));
typeTraitementTable.addGeneratedColumn(TypeTraitement_.i18nLibTypTrait.getName(), new ColumnGenerator() {
/*** serialVersionUID*/
private static final long serialVersionUID = 2101119091378513475L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final TypeTraitement typeTraitement = (TypeTraitement) itemId;
return i18nController.getI18nTraductionLibelle(typeTraitement.getI18nLibTypTrait());
}
});
typeTraitementTable.setSizeFull();
typeTraitementTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (String fieldName : FIELDS_ORDER) {
typeTraitementTable.setColumnHeader(fieldName, applicationContext.getMessage("typeTraitement.table." + fieldName, null, UI.getCurrent().getLocale()));
}
typeTraitementTable.setSortContainerPropertyId(TypeTraitement_.codTypTrait.getName());
typeTraitementTable.setColumnCollapsingAllowed(true);
typeTraitementTable.setColumnReorderingAllowed(true);
typeTraitementTable.setSelectable(true);
typeTraitementTable.setImmediate(true);
typeTraitementTable.addItemSetChangeListener(e -> typeTraitementTable.sanitizeSelection());
typeTraitementTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de typeTraitement sont actifs seulement si une typeTraitement est sélectionnée. */
boolean typeTraitementIsSelected = typeTraitementTable.getValue() instanceof TypeTraitement;
btnEdit.setEnabled(typeTraitementIsSelected);
});
typeTraitementTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
typeTraitementTable.select(e.getItemId());
btnEdit.click();
}
});
addComponent(typeTraitementTable);
setExpandRatio(typeTraitementTable, 1);
/* Inscrit la vue aux mises à jour de typeTraitement */
typeTraitementEntityPusher.registerEntityPushListener(this);
}
示例4: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
super.init();
setNavigationButton(CandidatCursusExterneView.NAME,CandidatFormationProView.NAME);
/*Indications pour le stage*/
setSubtitle(applicationContext.getMessage("stage.indication", null, UI.getCurrent().getLocale()));
OneClickButton btnNewStage = new OneClickButton(applicationContext.getMessage("stage.btn.new", null, UI.getCurrent().getLocale()), FontAwesome.PLUS);
btnNewStage.setEnabled(true);
btnNewStage.addClickListener(e -> {
candidatParcoursController.editStage(candidat, null, this);
});
addGenericButton(btnNewStage, Alignment.MIDDLE_LEFT);
OneClickButton btnEditStage = new OneClickButton(applicationContext.getMessage("btnModifier", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEditStage.setEnabled(false);
btnEditStage.addClickListener(e -> {
if (stageTable.getValue() instanceof CandidatStage) {
candidatParcoursController.editStage(candidat, (CandidatStage) stageTable.getValue(), this);
}
});
addGenericButton(btnEditStage, Alignment.MIDDLE_CENTER);
OneClickButton btnDeleteStage = new OneClickButton(applicationContext.getMessage("btnDelete", null, UI.getCurrent().getLocale()), FontAwesome.TRASH_O);
btnDeleteStage.setEnabled(false);
btnDeleteStage.addClickListener(e -> {
if (stageTable.getValue() instanceof CandidatStage) {
candidatParcoursController.deleteStage(candidat, (CandidatStage) stageTable.getValue(), this);
}
});
addGenericButton(btnDeleteStage, Alignment.MIDDLE_RIGHT);
/*Table stage*/
stageTable.setSizeFull();
stageTable.setVisibleColumns((Object[]) FIELDS_ORDER_STAGE);
for (String fieldName : FIELDS_ORDER_STAGE) {
stageTable.setColumnHeader(fieldName, applicationContext.getMessage("stage." + fieldName, null, UI.getCurrent().getLocale()));
}
stageTable.setColumnCollapsingAllowed(true);
stageTable.setColumnReorderingAllowed(true);
stageTable.setSelectable(true);
stageTable.setImmediate(true);
stageTable.setSortContainerPropertyId(CandidatStage_.anneeStage.getName());
stageTable.addItemSetChangeListener(e -> stageTable.sanitizeSelection());
stageTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de CandidatCursusPro sont actifs seulement si une CandidatCursusPro est sélectionnée. */
boolean stageIsSelected = stageTable.getValue() instanceof CandidatStage;
btnEditStage.setEnabled(stageIsSelected);
btnDeleteStage.setEnabled(stageIsSelected);
});
stageTable.addItemClickListener(e -> {
if (e.isDoubleClick() && !isLectureSeule && !isArchive) {
stageTable.select(e.getItemId());
btnEditStage.click();
}
});
addGenericComponent(stageTable);
setGenericExpandRatio(stageTable);
}
示例5: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
super.init();
setNavigationButton(CandidatStageView.NAME, CandidatCandidaturesView.NAME);
/*Indications pour les formations pro*/
setSubtitle(applicationContext.getMessage("formationpro.indication", null, UI.getCurrent().getLocale()));
OneClickButton btnNewFormationPro = new OneClickButton(applicationContext.getMessage("formationpro.btn.new", null, UI.getCurrent().getLocale()), FontAwesome.PLUS);
btnNewFormationPro.setEnabled(true);
btnNewFormationPro.addClickListener(e -> {
candidatParcoursController.editFormationPro(candidat, null, this);
});
addGenericButton(btnNewFormationPro, Alignment.MIDDLE_LEFT);
OneClickButton btnEditFormationPro = new OneClickButton(applicationContext.getMessage("btnModifier", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEditFormationPro.setEnabled(false);
btnEditFormationPro.addClickListener(e -> {
if (formationProTable.getValue() instanceof CandidatCursusPro) {
candidatParcoursController.editFormationPro(candidat, (CandidatCursusPro) formationProTable.getValue(), this);
}
});
addGenericButton(btnEditFormationPro, Alignment.MIDDLE_CENTER);
OneClickButton btnDeleteFormationPro = new OneClickButton(applicationContext.getMessage("btnDelete", null, UI.getCurrent().getLocale()), FontAwesome.TRASH_O);
btnDeleteFormationPro.setEnabled(false);
btnDeleteFormationPro.addClickListener(e -> {
if (formationProTable.getValue() instanceof CandidatCursusPro) {
candidatParcoursController.deleteFormationPro(candidat, (CandidatCursusPro) formationProTable.getValue(), this);
}
});
addGenericButton(btnDeleteFormationPro, Alignment.MIDDLE_RIGHT);
/*Table formationPro*/
formationProTable.setSizeFull();
formationProTable.setVisibleColumns((Object[]) FIELDS_ORDER_FORMATIONS);
for (String fieldName : FIELDS_ORDER_FORMATIONS) {
formationProTable.setColumnHeader(fieldName, applicationContext.getMessage("formationpro." + fieldName, null, UI.getCurrent().getLocale()));
}
formationProTable.setColumnCollapsingAllowed(true);
formationProTable.setColumnReorderingAllowed(true);
formationProTable.setSortContainerPropertyId(CandidatCursusPro_.anneeCursusPro.getName());
formationProTable.setSelectable(true);
formationProTable.setImmediate(true);
formationProTable.addItemSetChangeListener(e -> formationProTable.sanitizeSelection());
formationProTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de CandidatCursusPro sont actifs seulement si une CandidatCursusPro est sélectionnée. */
boolean formationProIsSelected = formationProTable.getValue() instanceof CandidatCursusPro;
btnEditFormationPro.setEnabled(formationProIsSelected);
btnDeleteFormationPro.setEnabled(formationProIsSelected);
});
formationProTable.addItemClickListener(e -> {
if (e.isDoubleClick() && !isLectureSeule && !isArchive) {
formationProTable.select(e.getItemId());
btnEditFormationPro.click();
}
});
addGenericComponent(formationProTable);
setGenericExpandRatio(formationProTable);
}
示例6: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
Label titleParam = new Label(applicationContext.getMessage("typeStatutPiece.title", null, UI.getCurrent().getLocale()));
titleParam.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleParam);
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
addComponent(buttonsLayout);
OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEdit.setEnabled(false);
btnEdit.addClickListener(e -> {
if (typeStatutPieceTable.getValue() instanceof TypeStatutPiece) {
typeStatutController.editTypeStatutPiece((TypeStatutPiece) typeStatutPieceTable.getValue());
}
});
buttonsLayout.addComponent(btnEdit);
buttonsLayout.setComponentAlignment(btnEdit, Alignment.MIDDLE_LEFT);
/* Table des typeStatutPieces */
BeanItemContainer<TypeStatutPiece> container = new BeanItemContainer<TypeStatutPiece>(TypeStatutPiece.class, typeStatutController.getTypeStatutPieces());
typeStatutPieceTable.setContainerDataSource(container);
typeStatutPieceTable.addGeneratedColumn(TypeStatutPiece_.i18nLibTypStatutPiece.getName(), new ColumnGenerator() {
/*** serialVersionUID*/
private static final long serialVersionUID = 2101119091378513475L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final TypeStatutPiece type = (TypeStatutPiece) itemId;
return i18nController.getI18nTraductionLibelle(type.getI18nLibTypStatutPiece());
}
});
typeStatutPieceTable.setSizeFull();
typeStatutPieceTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (String fieldName : FIELDS_ORDER) {
typeStatutPieceTable.setColumnHeader(fieldName, applicationContext.getMessage("typeStatutPiece.table." + fieldName, null, UI.getCurrent().getLocale()));
}
typeStatutPieceTable.setSortContainerPropertyId(TypeStatutPiece_.codTypStatutPiece.getName());
typeStatutPieceTable.setColumnCollapsingAllowed(true);
typeStatutPieceTable.setColumnReorderingAllowed(true);
typeStatutPieceTable.setSelectable(true);
typeStatutPieceTable.setImmediate(true);
typeStatutPieceTable.addItemSetChangeListener(e -> typeStatutPieceTable.sanitizeSelection());
typeStatutPieceTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de typeStatutPiece sont actifs seulement si une typeStatutPiece est sélectionnée. */
boolean typeStatutPieceIsSelected = typeStatutPieceTable.getValue() instanceof TypeStatutPiece;
btnEdit.setEnabled(typeStatutPieceIsSelected);
});
typeStatutPieceTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
typeStatutPieceTable.select(e.getItemId());
btnEdit.click();
}
});
addComponent(typeStatutPieceTable);
setExpandRatio(typeStatutPieceTable, 1);
/* Inscrit la vue aux mises à jour de typeStatutPiece */
typeStatutPieceEntityPusher.registerEntityPushListener(this);
}
示例7: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
Label titleParam = new Label(applicationContext.getMessage("message.title", null, UI.getCurrent().getLocale()));
titleParam.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleParam);
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
addComponent(buttonsLayout);
OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEdit.setEnabled(false);
btnEdit.addClickListener(e -> {
if (messageTable.getValue() instanceof Message) {
messageController.editMessage((Message) messageTable.getValue());
}
});
buttonsLayout.addComponent(btnEdit);
buttonsLayout.setComponentAlignment(btnEdit, Alignment.MIDDLE_LEFT);
/* Table des messages */
BeanItemContainer<Message> container = new BeanItemContainer<Message>(Message.class, cacheController.getMessages());
messageTable.setContainerDataSource(container);
messageTable.setSizeFull();
messageTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (String fieldName : FIELDS_ORDER) {
messageTable.setColumnHeader(fieldName, applicationContext.getMessage("message.table." + fieldName, null, UI.getCurrent().getLocale()));
}
messageTable.addGeneratedColumn(Message_.i18nValMessage.getName(), new ColumnGenerator() {
/*** serialVersionUID*/
private static final long serialVersionUID = -8469925144843229389L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final Message message = (Message) itemId;
return i18nController.getI18nTraductionLibelle(message.getI18nValMessage());
}
});
messageTable.setSortContainerPropertyId(Message_.codMsg.getName());
messageTable.addBooleanColumn(Message_.tesMsg.getName(), true);
messageTable.setColumnCollapsingAllowed(true);
messageTable.setColumnReorderingAllowed(true);
messageTable.setSelectable(true);
messageTable.setImmediate(true);
messageTable.addItemSetChangeListener(e -> messageTable.sanitizeSelection());
messageTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de message sont actifs seulement si une message est sélectionnée. */
boolean messageIsSelected = messageTable.getValue() instanceof Message;
btnEdit.setEnabled(messageIsSelected);
});
messageTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
messageTable.select(e.getItemId());
btnEdit.click();
}
});
addComponent(messageTable);
setExpandRatio(messageTable, 1);
/* Inscrit la vue aux mises à jour de message */
messageEntityPusher.registerEntityPushListener(this);
}
示例8: populateMailTypeDecLayout
private void populateMailTypeDecLayout(VerticalLayout layoutMailTypeDec) {
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
layoutMailTypeDec.addComponent(buttonsLayout);
OneClickButton btnNew = new OneClickButton(applicationContext.getMessage("mail.btnNouveau", null, UI.getCurrent().getLocale()), FontAwesome.PLUS);
btnNew.setEnabled(true);
btnNew.addClickListener(e -> {
mailController.editNewMail();
});
buttonsLayout.addComponent(btnNew);
buttonsLayout.setComponentAlignment(btnNew, Alignment.MIDDLE_LEFT);
OneClickButton btnEditMailTypeDec = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEditMailTypeDec.setEnabled(false);
btnEditMailTypeDec.addClickListener(e -> {
if (mailTypeDecTable.getValue() instanceof Mail) {
mailController.editMail((Mail) mailTypeDecTable.getValue());
}
});
buttonsLayout.addComponent(btnEditMailTypeDec);
buttonsLayout.setComponentAlignment(btnEditMailTypeDec, Alignment.MIDDLE_CENTER);
OneClickButton btnDelete = new OneClickButton(applicationContext.getMessage("btnDelete", null, UI.getCurrent().getLocale()), FontAwesome.TRASH_O);
btnDelete.setEnabled(false);
btnDelete.addClickListener(e -> {
if (mailTypeDecTable.getValue() instanceof Mail) {
mailController.deleteMail((Mail) mailTypeDecTable.getValue());
}
});
buttonsLayout.addComponent(btnDelete);
buttonsLayout.setComponentAlignment(btnDelete, Alignment.MIDDLE_RIGHT);
/* Table des mails avec type de decision */
BeanItemContainer<Mail> container = new BeanItemContainer<Mail>(Mail.class, mailController.getMailsTypeDecScol());
container.addNestedContainerProperty(Mail_.typeAvis.getName()+"."+TypeAvis_.libelleTypAvis.getName());
mailTypeDecTable.setContainerDataSource(container);
mailTypeDecTable.addBooleanColumn(Mail_.tesMail.getName());
mailTypeDecTable.setSizeFull();
mailTypeDecTable.setVisibleColumns((Object[]) MAIL_FIELDS_ORDER);
for (String fieldName : MAIL_FIELDS_ORDER) {
mailTypeDecTable.setColumnHeader(fieldName, applicationContext.getMessage("mail.table." + fieldName, null, UI.getCurrent().getLocale()));
}
mailTypeDecTable.setSortContainerPropertyId(Mail_.codMail.getName());
mailTypeDecTable.setColumnCollapsingAllowed(true);
mailTypeDecTable.setColumnReorderingAllowed(true);
mailTypeDecTable.setSelectable(true);
mailTypeDecTable.setImmediate(true);
mailTypeDecTable.addItemSetChangeListener(e -> mailTypeDecTable.sanitizeSelection());
mailTypeDecTable.addValueChangeListener(e -> {
/* Les boutons d'édition de mail sont actifs seulement si un mail est sélectionnée. */
boolean mailIsSelected = mailTypeDecTable.getValue() instanceof Mail;
btnEditMailTypeDec.setEnabled(mailIsSelected);
btnDelete.setEnabled(mailIsSelected);
});
mailTypeDecTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
mailTypeDecTable.select(e.getItemId());
btnEditMailTypeDec.click();
}
});
layoutMailTypeDec.addComponent(mailTypeDecTable);
layoutMailTypeDec.setExpandRatio(mailTypeDecTable, 1);
}
示例9: populateMailModelLayout
/**Rempli le layout de mail modele
* @param layoutMailModel
*/
private void populateMailModelLayout(VerticalLayout layoutMailModel) {
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
layoutMailModel.addComponent(buttonsLayout);
OneClickButton btnEditMailModel = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEditMailModel.setEnabled(false);
btnEditMailModel.addClickListener(e -> {
if (mailModelTable.getValue() instanceof Mail) {
mailController.editMail((Mail) mailModelTable.getValue());
}
});
buttonsLayout.addComponent(btnEditMailModel);
buttonsLayout.setComponentAlignment(btnEditMailModel, Alignment.MIDDLE_LEFT);
/* Table des mails */
BeanItemContainer<Mail> container = new BeanItemContainer<Mail>(Mail.class, mailController.getMailsModels());
container.addNestedContainerProperty(Mail_.typeAvis.getName()+"."+TypeAvis_.libelleTypAvis.getName());
mailModelTable.setContainerDataSource(container);
mailModelTable.addBooleanColumn(Mail_.tesMail.getName());
mailModelTable.setSizeFull();
mailModelTable.setVisibleColumns((Object[]) MAIL_FIELDS_ORDER);
for (String fieldName : MAIL_FIELDS_ORDER) {
mailModelTable.setColumnHeader(fieldName, applicationContext.getMessage("mail.table." + fieldName, null, UI.getCurrent().getLocale()));
}
mailModelTable.setSortContainerPropertyId(Mail_.codMail.getName());
mailModelTable.setColumnCollapsingAllowed(true);
mailModelTable.setColumnReorderingAllowed(true);
mailModelTable.setSelectable(true);
mailModelTable.setImmediate(true);
mailModelTable.addItemSetChangeListener(e -> mailModelTable.sanitizeSelection());
mailModelTable.addValueChangeListener(e -> {
/* Les boutons d'édition de mail sont actifs seulement si un mail est sélectionnée. */
boolean mailIsSelected = mailModelTable.getValue() instanceof Mail;
btnEditMailModel.setEnabled(mailIsSelected);
});
mailModelTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
mailModelTable.select(e.getItemId());
btnEditMailModel.click();
}
});
layoutMailModel.addComponent(mailModelTable);
layoutMailModel.setExpandRatio(mailModelTable, 1);
}
示例10: init
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
Label titleParam = new Label(applicationContext.getMessage("typeStatut.title", null, UI.getCurrent().getLocale()));
titleParam.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleParam);
/* Boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
addComponent(buttonsLayout);
OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnEdit", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
btnEdit.setEnabled(false);
btnEdit.addClickListener(e -> {
if (typeStatutTable.getValue() instanceof TypeStatut) {
nomenclatureTypeController.editTypeStatut((TypeStatut) typeStatutTable.getValue());
}
});
buttonsLayout.addComponent(btnEdit);
buttonsLayout.setComponentAlignment(btnEdit, Alignment.MIDDLE_LEFT);
/* Table des typeStatuts */
typeStatutTable.setContainerDataSource(new BeanItemContainer<TypeStatut>(TypeStatut.class, nomenclatureTypeController.getTypeStatuts()));
typeStatutTable.addGeneratedColumn(TypeStatut_.i18nLibTypStatut.getName(), new ColumnGenerator() {
/*** serialVersionUID*/
private static final long serialVersionUID = 2101119091378513475L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final TypeStatut type = (TypeStatut) itemId;
return i18nController.getI18nTraductionLibelle(type.getI18nLibTypStatut());
}
});
typeStatutTable.setSizeFull();
typeStatutTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (String fieldName : FIELDS_ORDER) {
typeStatutTable.setColumnHeader(fieldName, applicationContext.getMessage("typeStatut.table." + fieldName, null, UI.getCurrent().getLocale()));
}
typeStatutTable.setSortContainerPropertyId(TypeStatut_.codTypStatut.getName());
typeStatutTable.setColumnCollapsingAllowed(true);
typeStatutTable.setColumnReorderingAllowed(true);
typeStatutTable.setSelectable(true);
typeStatutTable.setImmediate(true);
typeStatutTable.addBooleanColumn(TypeStatut_.temCommVisible.getName());
typeStatutTable.setColumnWidth(TypeStatut_.temCommVisible, 250);
typeStatutTable.addItemSetChangeListener(e -> typeStatutTable.sanitizeSelection());
typeStatutTable.addValueChangeListener(e -> {
/* Les boutons d'édition et de suppression de typeStatut sont actifs seulement si une typeStatut est sélectionnée. */
boolean typeStatutIsSelected = typeStatutTable.getValue() instanceof TypeStatut;
btnEdit.setEnabled(typeStatutIsSelected);
});
typeStatutTable.addItemClickListener(e -> {
if (e.isDoubleClick()) {
typeStatutTable.select(e.getItemId());
btnEdit.click();
}
});
addComponent(typeStatutTable);
setExpandRatio(typeStatutTable, 1);
/* Inscrit la vue aux mises à jour de typeStatut */
typeStatutEntityPusher.registerEntityPushListener(this);
}