Revision c8edc5c9
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java | ||
---|---|---|
136 | 136 |
}else{ |
137 | 137 |
area = distribution.getArea().getTitleCache(); |
138 | 138 |
} |
139 |
|
|
139 | 140 |
}else{ |
140 | 141 |
continue; |
141 | 142 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java | ||
---|---|---|
5 | 5 |
import java.util.Set; |
6 | 6 |
import java.util.SortedSet; |
7 | 7 |
|
8 |
import org.apache.commons.lang.StringUtils; |
|
8 | 9 |
import org.apache.log4j.Logger; |
9 | 10 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
10 | 11 |
import org.eclipse.jface.viewers.CellEditor; |
... | ... | |
46 | 47 |
descriptionService = CdmStore.getService(IDescriptionService.class); |
47 | 48 |
editor = checklistEditor; |
48 | 49 |
cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY); |
49 |
cellEditor.setLabelProvider(new LabelProvider()); |
|
50 |
cellEditor.setLabelProvider(new LabelProvider(){ |
|
51 |
@Override |
|
52 |
public String getText(Object element) { |
|
53 |
if (element instanceof PresenceAbsenceTerm) { |
|
54 |
PresenceAbsenceTerm status = (PresenceAbsenceTerm)element; |
|
55 |
String result = null; |
|
56 |
if (PreferencesUtil.isShowSymbolInChecklistEditor() && !StringUtils.isBlank(status.getSymbol())){ |
|
57 |
result = status.getTitleCache() + "("+ status.getSymbol()+")"; |
|
58 |
}else{ |
|
59 |
result = status.getTitleCache(); |
|
60 |
} |
|
61 |
return result; |
|
62 |
} |
|
63 |
return null; |
|
64 |
} |
|
65 |
}); |
|
50 | 66 |
cellEditor.setContentProvider(new ArrayContentProvider()); |
51 | 67 |
// TODO set input |
52 | 68 |
// List<PresenceAbsenceTermBase> input = CdmStore.getTermManager() |
... | ... | |
69 | 85 |
protected Object getValue(Object element) { |
70 | 86 |
if (element instanceof Taxon) { |
71 | 87 |
Taxon taxon = (Taxon) element; |
88 |
String result = null; |
|
72 | 89 |
Distribution distributionForColumn = getDistributionForColumn(taxon); |
90 |
|
|
73 | 91 |
if (distributionForColumn != null) { |
92 |
PresenceAbsenceTerm status = distributionForColumn.getStatus(); |
|
74 | 93 |
if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){ |
75 |
if (distributionForColumn.getStatus().getIdInVocabulary() != null){
|
|
76 |
return distributionForColumn.getStatus().getIdInVocabulary();
|
|
94 |
if (status.getIdInVocabulary() != null){
|
|
95 |
result = status.getIdInVocabulary();
|
|
77 | 96 |
} else{ |
78 |
distributionForColumn.getStatus().getTitleCache();
|
|
97 |
result = status.getTitleCache();
|
|
79 | 98 |
} |
80 | 99 |
} else{ |
81 |
return distributionForColumn.getStatus().getTitleCache(); |
|
100 |
result = status.getTitleCache(); |
|
101 |
} |
|
102 |
if (PreferencesUtil.isShowSymbolInChecklistEditor() && status.getSymbol() != null){ |
|
103 |
result.concat(" ("+ status.getSymbol() + ")"); |
|
82 | 104 |
} |
83 | 105 |
} |
84 |
// return PresenceAbsenceTerms |
|
106 |
|
|
107 |
return result; |
|
85 | 108 |
} |
86 | 109 |
return null; |
87 | 110 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java | ||
---|---|---|
87 | 87 |
|
88 | 88 |
final Button showSymbol = new Button(child, SWT.CHECK); |
89 | 89 |
boolean isShowSymbol = PreferencesUtil.isShowSymbolInChecklistEditor(); |
90 |
showSymbol.setText("Show Symbol of the areas");
|
|
90 |
showSymbol.setText("Show Symbol of the Status, if existing");
|
|
91 | 91 |
showSymbol.setSelection(isShowSymbol); |
92 | 92 |
showSymbol.addSelectionListener(new SelectionAdapter(){ |
93 | 93 |
@Override |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitDetailElement.java | ||
---|---|---|
12 | 12 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
13 | 13 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
14 | 14 |
import eu.etaxonomy.cdm.model.common.TermType; |
15 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
|
15 | 16 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
16 | 17 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
17 | 18 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
... | ... | |
68 | 69 |
// Disable for now |
69 | 70 |
// text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style); |
70 | 71 |
text_fieldNotes = formFactory.createTextWithLabelElement(formElement, "Field Notes", entity.getFieldNotes(), style); |
71 |
|
|
72 |
text_lifeForm = formFactory.createTextWithLabelElement(formElement, "Life Form", entity.getLifeform(PreferencesUtil.getGlobalLanguage()), style); |
|
72 |
if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_LIFE_FORM)){ |
|
73 |
text_lifeForm = formFactory.createTextWithLabelElement(formElement, "Life Form", entity.getLifeform(PreferencesUtil.getGlobalLanguage()), style); |
|
74 |
} |
|
75 |
|
|
73 | 76 |
number_individualCount = formFactory.createNumberTextWithLabelElement(formElement, "Individual Count", entity.getIndividualCount(), style); |
74 | 77 |
combo_kindOfUnit= formFactory.createDefinedTermComboElement(TermType.KindOfUnit, formElement, "Kind Of Unit", entity.getKindOfUnit(), style); |
75 | 78 |
combo_lifeStage = formFactory.createDefinedTermComboElement(TermType.Stage, formElement, "Life Stage", entity.getLifeStage(), style); |
Also available in: Unified diff
ref #6927: add symbol to preferences of distribution editor