Project

General

Profile

Revision c397c928

IDc397c92824f3198e1112c4c5a3c7dac6068f0437
Parent dd8c884c
Child c6db362d

Added by Andreas Kohlbecker about 2 years ago

ref #7223 fixing field visibility of various reference types

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/reference/ReferencePopupEditor.java
259 259
        try {
260 260
            Map<String, String> fieldPropertyDefinition = ReferencePropertyDefinitions.fieldPropertyDefinition(referenceType);
261 261

  
262
            // Authors and inReference
263
            authorshipField.setVisible(fieldPropertyDefinition.containsKey("authorship"));
264
            String inRefCaption = fieldPropertyDefinition.get("inReference");
265
            inReferenceCombobox.setVisible(inRefCaption != null);
266
            if(inRefCaption != null){
267
                inReferenceCombobox.setCaption(propertyNameLabelMap.get(inRefCaption));
268
            }
269
            getField("title").setVisible(fieldPropertyDefinition.containsKey("title"));
270

  
271
            EnumSet<ReferenceType> hideNomTitle = EnumSet.of(ReferenceType.Article, ReferenceType.Section, ReferenceType.BookSection, ReferenceType.InProceedings);
272
//            EnumSet<ReferenceType> hideTitle = EnumSet.of(ReferenceType.Section, ReferenceType.BookSection);
273
            getField("abbrevTitle").setVisible(!hideNomTitle.contains(referenceType));
274

  
262 275
            for(String fieldName : adaptiveFields.keySet()){ // iterate over the LinkedHashMap to retain the original order of the fields
263 276
                if(fieldPropertyDefinition.containsKey(fieldName)){
264 277
                    Field<?> field = adaptiveFields.get(fieldName);
......
277 290
            getField("inReference").setCaption(propertyNameLabelMap.get("inReference"));
278 291
        }
279 292

  
280
        EnumSet<ReferenceType> hideNomTitle = EnumSet.of(ReferenceType.Article, ReferenceType.Section, ReferenceType.BookSection, ReferenceType.InProceedings, ReferenceType.PrintSeries);
281
        EnumSet<ReferenceType> hideTitle = EnumSet.of(ReferenceType.Section, ReferenceType.BookSection);
282
        getField("abbrevTitle").setVisible(!hideNomTitle.contains(referenceType));
283
        getField("title").setVisible(!hideTitle.contains(referenceType));
293

  
284 294

  
285 295
        return null;
286 296
    }
......
298 308
                for(int row = variableGridStartRow; row <= variableGridLastRow; row++){
299 309
                    for(int x=0; x < grid.getColumns(); x++){
300 310
                        Component c = grid.getComponent(x, row);
301
                        logger.debug("initAdaptiveFields() - y: " + row + " x: " + x + "  component:" + (c != null ? c.getClass().getSimpleName(): "NULL"));
311
                        logger.trace("initAdaptiveFields() - y: " + row + " x: " + x + "  component:" + (c != null ? c.getClass().getSimpleName(): "NULL"));
302 312
                        if(c != null && c instanceof Field){
303 313
                            Field<?> field = (Field<?>)c;
304 314
                            PropertyIdPath propertyIdPath = boundPropertyIdPath(field);
305
                            logger.debug("initAdaptiveFields() - " + field.getCaption() + " -> " + propertyIdPath);
315
                            logger.trace("initAdaptiveFields() - " + field.getCaption() + " -> " + propertyIdPath);
306 316
                            if(propertyIdPath != null && fieldNames.contains(propertyIdPath.toString())){
307 317
                                adaptiveFields.put(propertyIdPath.toString(), field);
308 318
                            }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)