Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe

Commits:

2 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
    ... ... @@ -49,8 +49,8 @@ import fr.ird.observe.dto.result.SaveResultDto;
    49 49
     import fr.ird.observe.services.service.actions.consolidate.dcp.ConsolidateFloatingObjectRequest;
    
    50 50
     import fr.ird.observe.services.service.actions.consolidate.dcp.ConsolidateFloatingObjectResult;
    
    51 51
     import fr.ird.observe.spi.DtoModelHelper;
    
    52
    -import org.apache.logging.log4j.Logger;
    
    53 52
     import org.apache.logging.log4j.LogManager;
    
    53
    +import org.apache.logging.log4j.Logger;
    
    54 54
     import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    55 55
     import org.nuiton.jaxx.runtime.swing.SwingUtil;
    
    56 56
     import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
    
    ... ... @@ -147,6 +147,8 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto,
    147 147
             Set<FloatingObjectPartReference> partsSet;
    
    148 148
             Form<FloatingObjectDto> form;
    
    149 149
             Optional<FloatingObjectPreset> floatingObjectReference;
    
    150
    +        boolean useReference = false;
    
    151
    +
    
    150 152
             if (dcpId == null) {
    
    151 153
     
    
    152 154
                 Optional<FloatingObjectPreset> ref = ObserveSwingApplicationContext.get().getFloatingObjectPresetsManager().getReferenceToUse();
    
    ... ... @@ -155,6 +157,7 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto,
    155 157
                 String floatingObjectReferenceId = ref.map(FloatingObjectPreset::getFloatingObjectId).orElse(null);
    
    156 158
                 form = getFloatingObjectService().preCreate(activityId, floatingObjectReferenceId);
    
    157 159
                 if (floatingObjectReferenceId != null) {
    
    160
    +                useReference = true;
    
    158 161
                     partsSet = getFloatingObjectService().getFloatingObjectPartByFloatingObject(floatingObjectReferenceId).toSet();
    
    159 162
                     for (FloatingObjectPartReference floatingObjectPartDtoDataReference : partsSet) {
    
    160 163
                         floatingObjectPartDtoDataReference.setId(null);
    
    ... ... @@ -180,7 +183,7 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto,
    180 183
     
    
    181 184
             model.reset();
    
    182 185
     
    
    183
    -        getUi().getTable().openTable(model, partsSet, bean.isPersisted());
    
    186
    +        getUi().getTable().openTable(model, partsSet, bean.isPersisted() || useReference);
    
    184 187
     
    
    185 188
             setContentMode(mode);
    
    186 189
     
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTable.java
    ... ... @@ -68,7 +68,7 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
    68 68
             return (FloatingObjectPartsTreeTableModel) super.getTreeTableModel();
    
    69 69
         }
    
    70 70
     
    
    71
    -    public void openTable(FloatingObjectUIModel model, Set<FloatingObjectPartReference> partsSet, boolean persisted) {
    
    71
    +    public void openTable(FloatingObjectUIModel model, Set<FloatingObjectPartReference> partsSet, boolean expandTree) {
    
    72 72
     
    
    73 73
             for (FloatingObjectPartReference p : partsSet) {
    
    74 74
                 String objectMaterialId = p.getObjectMaterialId();
    
    ... ... @@ -85,7 +85,7 @@ public class FloatingObjectPartsTreeTable extends JXTreeTable {
    85 85
             FloatingObjectPartsTreeTableModel treeTableModel = getTreeTableModel();
    
    86 86
             treeTableModel.reset();
    
    87 87
     
    
    88
    -        if (persisted) {
    
    88
    +        if (expandTree) {
    
    89 89
                 expandAll();
    
    90 90
             } else {
    
    91 91
                 // expand first level nodes (except if they are disabled)