Project

General

Profile

« Previous | Next » 

Revision aa312f10

Added by Patrick Plitzner over 4 years ago

ref #8475 Enhance FeatureStateWizard

  • Pre-select single parent feature if exists
  • filter out features without supported categorical states

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureStateWizardPage.java
51 51
        super.createControl(parent);
52 52

  
53 53
        comboFeature = formFactory.createDefinedTermComboElement(Collections.EMPTY_LIST, rootElement, "Parent Feature", null, SWT.NONE);
54
        updateFeatureCombo();
55 54

  
56 55
        comboState = formFactory.createDefinedTermComboElement(Collections.EMPTY_LIST, rootElement, comboLabel, null, SWT.NONE);
57 56
        comboState.setEnabled(false);
58 57

  
59 58
        formFactory.addPropertyChangeListener(this);
59

  
60
        updateFeatureCombo();
60 61
    }
61 62

  
62 63
    FeatureState getFeatureState(){
......
67 68
        List<Feature> features = new ArrayList<>();
68 69
        TermNode<? extends Feature> parent = termNode.getParent();
69 70
        while(parent!=null){
70
            features.add(parent.getTerm());
71
            Feature parentTerm = parent.getTerm();
72
            if(parentTerm!=null
73
                    && parentTerm.isSupportsCategoricalData()
74
                    && !parentTerm.getSupportedCategoricalEnumerations().isEmpty()){
75
                features.add(parentTerm);
76
            }
71 77
            parent = parent.getParent();
72 78
        }
73 79
        comboFeature.setTerms(features);
80
        if(features.size()==1){
81
            Feature feature = features.get(0);
82
            comboFeature.setSelection(feature);
83
            updateStateCombo(feature);
84
        }
74 85
    }
75 86

  
76 87
    private void updateStateCombo(Feature feature){

Also available in: Unified diff