Revision a452be91
Added by Katja Luther about 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/AbstractComboElement.java | ||
---|---|---|
80 | 80 |
|
81 | 81 |
Color color = AbstractUtility.getColor(colorId); |
82 | 82 |
combo.setBackground(color); |
83 |
if (label != null) { |
|
84 |
label.setBackground(color); |
|
85 |
} |
|
86 |
colorId = !irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT |
|
87 |
: Resources.COLOR_COMPOSITE_BACKGROUND; |
|
88 |
color = AbstractUtility.getColor(colorId); |
|
89 |
combo.setForeground(color); |
|
90 |
|
|
83 | 91 |
} |
84 | 92 |
|
85 | 93 |
public void setVisibleItemCount(int count){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java | ||
---|---|---|
135 | 135 |
combo.addSelectionListener(this); |
136 | 136 |
} |
137 | 137 |
|
138 |
|
|
139 |
|
|
138 | 140 |
private String getDefaultLabelString() { |
139 | 141 |
if(enumType.equals(ReferenceType.class)){ |
140 | 142 |
return "Reference Type"; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java | ||
---|---|---|
126 | 126 |
super.setEntity(entity); |
127 | 127 |
setSectionTitle(); |
128 | 128 |
layout(); |
129 |
|
|
129 | 130 |
} |
130 | 131 |
|
131 | 132 |
protected void setSectionTitle() { |
... | ... | |
137 | 138 |
if (label == null){ |
138 | 139 |
label = ((DefinedTermBase<?>)getEntity()).getLabel(); |
139 | 140 |
} |
140 |
|
|
141 |
|
|
141 | 142 |
} else if (getEntity() instanceof TextData){ |
142 | 143 |
label = ((TextData)getEntity()).getLanguageText(PreferencesUtil.getGlobalLanguage()).getText(); |
143 | 144 |
if (label == null){ |
... | ... | |
147 | 148 |
label =((IdentifiableEntity) getEntity()).getTitleCache(); |
148 | 149 |
} |
149 | 150 |
title = ": " + label; |
150 |
|
|
151 |
|
|
151 | 152 |
// we have to duplicate ampersands otherwise they are treated as |
152 | 153 |
// mnenomic (see Label.setText() documentation) |
153 | 154 |
// see also #4302 |
... | ... | |
173 | 174 |
@Override |
174 | 175 |
public void setIrrelevant(boolean irrelevant) { |
175 | 176 |
if (detailElement != null) { |
177 |
|
|
176 | 178 |
detailElement.setIrrelevant(irrelevant); |
177 | 179 |
} |
178 | 180 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.ui.section.name; |
11 | 11 |
|
12 | 12 |
import java.util.Arrays; |
13 |
import java.util.Collection; |
|
13 | 14 |
|
14 | 15 |
import org.apache.log4j.Logger; |
15 | 16 |
import org.eclipse.swt.SWT; |
... | ... | |
19 | 20 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
20 | 21 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
21 | 22 |
import eu.etaxonomy.cdm.model.name.Rank; |
22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
23 | 23 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
24 | 24 |
import eu.etaxonomy.cdm.model.name.ZoologicalName; |
25 | 25 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
... | ... | |
108 | 108 |
text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style); |
109 | 109 |
} |
110 | 110 |
} |
111 |
|
|
111 | 112 |
} |
112 | 113 |
|
113 | 114 |
/** |
... | ... | |
131 | 132 |
} |
132 | 133 |
|
133 | 134 |
super.updateContent(); |
135 |
toggleable_cache.setEnabled(getEntity().isProtectedNameCache()); |
|
134 | 136 |
if (isAdvancedView){ |
135 | 137 |
if(isIrrelevant()){ |
136 | 138 |
setIrrelevant(isIrrelevant()); |
... | ... | |
224 | 226 |
if (eventSource == toggleable_cache) { |
225 | 227 |
getEntity().setNameCache(toggleable_cache.getText(), |
226 | 228 |
toggleable_cache.getState()); |
227 |
if (!isIrrelevant()) { |
|
229 |
//if (!isIrrelevant()) {
|
|
228 | 230 |
setIrrelevant(toggleable_cache.getState(), |
229 | 231 |
Arrays.asList(new Object[] { toggleable_cache })); |
230 |
} |
|
232 |
//}
|
|
231 | 233 |
} |
232 | 234 |
else if(eventSource == combo_rank){ |
233 | 235 |
getEntity().setRank(combo_rank.getSelection()); |
... | ... | |
289 | 291 |
updateToggleableCacheField(); |
290 | 292 |
} |
291 | 293 |
|
294 |
@Override |
|
295 |
public void setIrrelevant(boolean irrelevant, Collection<Object> except){ |
|
296 |
if (toggleable_cache != null){ |
|
297 |
if (toggleable_cache.getState() == irrelevant){ |
|
298 |
super.setIrrelevant(irrelevant, except); |
|
299 |
} |
|
300 |
if (except == null || except.isEmpty()){ |
|
301 |
toggleable_cache.setIrrelevant(irrelevant); |
|
302 |
} |
|
303 |
} |
|
304 |
|
|
305 |
} |
|
306 |
|
|
292 | 307 |
|
293 | 308 |
|
294 | 309 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java | ||
---|---|---|
113 | 113 |
@Override |
114 | 114 |
protected void updateContent() { |
115 | 115 |
super.updateContent(); |
116 |
|
|
117 | 116 |
// disable nomenclatural code, because changing of nom.code is not |
118 | 117 |
// implemented on library side |
119 | 118 |
if(combo_nomenclaturalCode!=null){ |
120 | 119 |
combo_nomenclaturalCode.setEnabled(false); |
121 | 120 |
} |
122 |
|
|
121 |
toggleable_cache.setEnabled(getEntity().isProtectedTitleCache() || getEntity().isProtectedFullTitleCache()); |
|
123 | 122 |
if(toggleable_cache!=null){ |
124 | 123 |
setIrrelevant(toggleable_cache.getState(), |
125 |
Arrays.asList(new Object[] { toggleable_cache })); |
|
124 |
Arrays.asList(new Object[] { toggleable_cache, textLsid }));
|
|
126 | 125 |
} |
127 | 126 |
} |
128 | 127 |
|
Also available in: Unified diff
fix #3737: improve handling of protected/not protected cache fields