Project

General

Profile

Revision 483d1f1c

ID483d1f1c364704d18b166ce2d7ab11c99fa8184b
Parent 36e0ed0b
Child 3319e347

Added by Katja Luther over 1 year ago

some more changes in checklist editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
239 239
//        	});
240 240
        labelProvider = new ChecklistLabelProvider(this.viewer);
241 241

  
242
        terms = labelProvider.getNamedAreas();
242
        terms = labelProvider.getNamedAreas(false);
243 243
        if (terms == null){
244 244
			MessagingUtils.informationDialog(Messages.ChecklistEditor_NO_AREAS, Messages.ChecklistEditor_NO_AREAS_MESSAGE);
245 245
			this.dispose();
......
561 561
//    	} else{
562 562
//    	    terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(), CdmStore.getDefaultLanguage());
563 563
//    	}
564
    	SortedSet<DefinedTermBase> newTerms = labelProvider.getNamedAreas();
564
    	SortedSet<DefinedTermBase> newTerms = labelProvider.getNamedAreas(true);
565 565
    	toolItem.removeSelectionListener(dropListener);
566 566
    	hideDistributionColumns(oldTerms);
567 567
    	createToolbarItems();
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
53 53

  
54 54
    public static final String DEFAULT_ENTRY = ""; //$NON-NLS-1$
55 55
    private IDescriptionService descriptionService;
56
    private final SortedSet<DefinedTermBase> namedAreas;
56
    private SortedSet<DefinedTermBase> namedAreas;
57 57
    TableViewer viewer = null;
58 58

  
59 59
    /**
......
219 219
    /**
220 220
     * @return the namedAreas
221 221
     */
222
    public SortedSet<DefinedTermBase> getNamedAreas() {
222
    public SortedSet<DefinedTermBase> getNamedAreas(boolean load) {
223
        if (load){
224
            namedAreas = loadNamedAreas();
225
        }
223 226
        return namedAreas;
224 227
    }
225 228

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
190 190

  
191 191
        labelProvider = new ChecklistLabelProvider(this.viewer);
192 192

  
193
        terms = labelProvider.getNamedAreas();
193
        terms = labelProvider.getNamedAreas(false);
194 194
        if (terms == null){
195 195
			MessagingUtils.informationDialog(Messages.ChecklistEditor_NO_AREAS, Messages.ChecklistEditor_NO_AREAS_MESSAGE);
196 196
			this.dispose();
......
524 524
//    	} else{
525 525
//    	    terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(), CdmStore.getDefaultLanguage());
526 526
//    	}
527
    	SortedSet<DefinedTermBase> newTerms = labelProvider.getNamedAreas();
527
    	SortedSet<DefinedTermBase> newTerms = labelProvider.getNamedAreas(true);
528 528
    	toolItem.removeSelectionListener(dropListener);
529 529
    	hideDistributionColumns(oldTerms);
530 530
    	createToolbarItems();
531 531
    	toolItem.addSelectionListener(dropListener);
532
    	
532

  
533 533
    	for(DefinedTermBase term:newTerms){
534 534
    		int count = viewer.getTable().getColumnCount();
535 535
    		String termLable = term.getTitleCache();;
536 536
    		if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
537 537
    			if (term.getIdInVocabulary() != null){
538 538
    				termLable = term.getIdInVocabulary();
539
    	        } 
539
    	        }
540 540
    		}
541 541
    		addTableViewerColumn(termLable, 200, count);
542 542
    		acitivateNewColumnInDropDownMenu(term);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditingSupportE4.java
205 205
    private void createDistributionForColumn(Taxon taxon, PresenceAbsenceTerm occurenceStatus) {
206 206
        TableColumn column = viewer.getTable().getColumn(columnIndex);
207 207

  
208
        SortedSet<DefinedTermBase> namedAreas = this.editor.getLabelProvider().getNamedAreas();
208
        SortedSet<DefinedTermBase> namedAreas = this.editor.getLabelProvider().getNamedAreas(false);
209 209

  
210 210

  
211 211
        if (namedAreas != null) {
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java
17 17
import org.eclipse.swt.widgets.Composite;
18 18
import org.eclipse.swt.widgets.TableColumn;
19 19

  
20
import eu.etaxonomy.cdm.api.service.IDescriptionService;
21 20
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
22 21
import eu.etaxonomy.cdm.model.common.TermType;
23 22
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
......
86 85
            Taxon taxon = (Taxon) element;
87 86
            String result = null;
88 87
            Distribution distributionForColumn = getDistributionForColumn(taxon);
89
           
88

  
90 89
            if (distributionForColumn != null) {
91 90
                PresenceAbsenceTerm status = distributionForColumn.getStatus();
92 91
                if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
......
102 101
                	result.concat(" ("+ status.getSymbol() + ")");
103 102
                }
104 103
            }
105
           
104

  
106 105
            return result;
107 106
        }
108 107
        return null;
......
166 165
    private void createDistributionForColumn(Taxon taxon, PresenceAbsenceTerm occurenceStatus) {
167 166
        TableColumn column = viewer.getTable().getColumn(columnIndex);
168 167

  
169
        SortedSet<DefinedTermBase> namedAreas = this.editor.getLabelProvider().getNamedAreas();
168
        SortedSet<DefinedTermBase> namedAreas = this.editor.getLabelProvider().getNamedAreas(false);
170 169

  
171 170

  
172 171
        if (namedAreas != null) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)