LayoutContainer linksPanel = new LayoutContainer();
linksPanel.setLayout(new RowLayout(Orientation.HORIZONTAL));
LayoutContainer topPanel = new LayoutContainer();
topPanel.setHeight(25);
topPanel.setLayout(new BorderLayout());
topPanel.add(linksPanel, new BorderLayoutData(LayoutRegion.EAST, 645));
topPanel.add(formPanel2, new BorderLayoutData(LayoutRegion.WEST, 500));
fldstNewFieldset_1.add(topPanel);
fldstNewFieldset_1.add(new HTML("<br>"));
saveLayout = new LayoutContainer();
HTML save = new HTML("<img src='./images/sauvegarder.png'/> " + messages.saveSynthese(), false);
save.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
save.setStyleName("actionHTML");
saveLayout.add(save);
saveLayout.setEnabled(false);
save.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
bus.fireEvent(new SyntheseEvent());
saveLayout.setEnabled(false);
bus.fireEvent(new IsEditEvent(false));
}
});
linksPanel.add(saveLayout);
if( isAdminOrContributor(role, user) ) {
save.setVisible(true);
chatierName.enable();
prorataTheorique.enable();
}
else {
save.setVisible(false);
chatierName.disable();
prorataTheorique.disable();
}
HTML printSubcontractor = new HTML("<img src='./images/imprimer.png'/> " + messages.printSubcontractor(), false);
printSubcontractor.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
printSubcontractor.setStyleName("actionHTML");
linksPanel.add(new HTML(LINKS_SPACE, false));
linksPanel.add(printSubcontractor);
printSubcontractor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
List<FicheStDto> allModels = new ArrayList<FicheStDto>();
allModels.addAll(ficheStGrid1.getStore().getModels());
allModels.addAll(ficheStGrid2.getStore().getModels());
CreateFicheSTPopUpReportWindow popUpReport = new CreateFicheSTPopUpReportWindow(bus, allModels, true);
popUpReport.show();
}
});
HTML printRefacturations = new HTML("<img src='./images/imprimer.png'/> " + messages.printRefacturations(), false);
printRefacturations.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
printRefacturations.setStyleName("actionHTML");
linksPanel.add(new HTML(LINKS_SPACE, false));
linksPanel.add(printRefacturations);
printRefacturations.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
List<FicheStDto> allModels = new ArrayList<FicheStDto>();
allModels.addAll(ficheStGrid1.getStore().getModels());
allModels.addAll(ficheStGrid2.getStore().getModels());
CreateFicheSTPopUpReportWindow popUpReport = new CreateFicheSTPopUpReportWindow(bus, allModels, false);
popUpReport.show();
}
});
ficheStGrid1 = createFicheStGrid(messages.totalSt());
fldstNewFieldset_1.add(ficheStGrid1);
// Honoraires lot type
ficheStGrid2 = createFicheStGrid("Honoraires");
ficheStGrid2.hideHeader();
// Hide it. Only show it if having data (check at loadFicheStData() method)
ficheStGrid2.hide();
fldstNewFieldset_1.add(ficheStGrid2);
loadFicheStData();
if( isAdminOrContributor(role, user) ) {
FlexTable ft1 = new FlexTable();
ft1.setWidget(0, 0, new HTML(SPACES_4));
HTML addRow = new HTML("<img src='./images/ajouter.png'/> " + messages.newSubcontractor(), false);
addRow.setStyleName("actionHTML2");
ft1.setWidget(0, 1, addRow);
addRow.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GuiUtil.gotoEcran(new FicheSTEcran(chantier, null, role, user));
/* bus.fireEvent(new LoadFichestEcranEvent(chantier)); */
}
});
fldstNewFieldset_1.add(ft1);
}
FieldSet transferPpFieldSet = new CustomFieldSet();
transferPpFieldSet.setHeading("SYNTHESE DES TRANSFERT PP");
transferPpFieldSet.setLayout(new BorderLayout());
setDefaultBackgroundColor(transferPpFieldSet);
saveLayout2 = new LayoutContainer();
HTML save2 = new HTML("<img src='./images/sauvegarder.png'/> Sauvegarder la synthèse", false);
save2.setStyleName("actionHTML");
save2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
save2.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if( !formPanel2.isValid() ) {
return;
}
bus.fireEvent(new SyntheseEvent());
saveLayout2.setEnabled(false);
}
});
saveLayout2.add(save2);
saveLayout2.setEnabled(false);
transferPpFieldSet.add(saveLayout2, new BorderLayoutData(LayoutRegion.EAST));
if( isAdminOrContributor(role, user) ) {
save2.setVisible(true);
}
else {
save2.setVisible(false);
}
createTransfertPpGrid(role, user, chantier);
transferPpFieldSet.add(transfertPpGrid, new BorderLayoutData(LayoutRegion.WEST, 1000));
add(transferPpFieldSet);
transferPpFieldSet.setHeight("430");
transfertPpGrid.addListener(Events.BeforeEdit, new Listener<GridEvent<TransfertPpSummaryDto>>() {
@Override