Project

General

Profile

Revision e10f18ed

IDe10f18ed971baea3e9e785e9d01f065f68e6c37d
Parent b40f38ec
Child 62306db3

Added by Katja Luther about 2 years ago

ref #6159:dirty flag only if status has changed in distribution editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditingSupportE4.java
76 76
        	    	 Representation rep = status.getPreferredRepresentation(CdmStore.getDefaultLanguage());
77 77
        	    	 String label = null;
78 78
        	    	 if (rep != null){
79
        	    	     label = rep.getAbbreviatedLabel();
80
            	    	 if (label == null){
81
            	    	     label = rep.getLabel();
82
            	    	 }
79
        	    	     label = rep.getLabel();
80

  
83 81
        	    	 }else{
84 82
        	    	     label = status.getTitleCache();
85 83
        	    	 }
......
162 160
            Taxon taxon = (Taxon) element;
163 161
            PresenceAbsenceTerm occurenceStatus = (PresenceAbsenceTerm) value;
164 162
            Distribution distribution = getDistributionForColumn(taxon);
165

  
163
            boolean changed = false;
166 164
            if (distribution != null) {
167 165
                // change status for already exsiting distribution
168 166
                if (occurenceStatus.getTitleCache().equals(" ")){
169 167
                    TaxonDescription descr = (TaxonDescription)distribution.getInDescription();
170 168
                    descr.removeElement(distribution);
169
                    changed = true;
171 170
                }else{
172
                    distribution.setStatus(occurenceStatus);
171
                    if (!distribution.getStatus().equals(occurenceStatus)){
172
                        changed = true;
173
                        distribution.setStatus(occurenceStatus);
174
                    }
175

  
173 176
                }
174 177
            } else {
175 178
                if (!occurenceStatus.getTitleCache().equals(" ")){
176 179
                    createDistributionForColumn(taxon, occurenceStatus);
180
                    changed = true;
177 181
                }
178 182
            }
179 183

  
180

  
181
            editor.changed(element);
184
            if (changed){
185
                editor.changed(element);
186
            }
182 187
            getViewer().refresh();
183 188

  
184 189
            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_TAXON_DETAILS, true);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)