Revision be6d7785
Added by Katja Luther over 2 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixConfigLabelAccumulator.java | ||
---|---|---|
240 | 240 |
} |
241 | 241 |
} |
242 | 242 |
} |
243 |
} |
|
244 |
if (!isApplicableCheck){ |
|
245 |
|
|
243 | 246 |
} |
244 | 247 |
return isApplicableCheck; |
245 | 248 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixLabelStyleConfiguration.java | ||
---|---|---|
84 | 84 |
notApplicableValueStyle.setAttributeValue( |
85 | 85 |
CellStyleAttributes.BACKGROUND_COLOR, |
86 | 86 |
GUIHelper.COLOR_GRAY); |
87 |
notApplicableValueStyle.setAttributeValue( |
|
88 |
CellStyleAttributes.FOREGROUND_COLOR, |
|
89 |
GUIHelper.COLOR_GRAY); |
|
87 | 90 |
configRegistry.registerConfigAttribute( |
88 | 91 |
CellConfigAttributes.CELL_STYLE, |
89 | 92 |
notApplicableValueStyle, |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/MatrixUtility.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.eclipse.swt.graphics.Image; |
14 | 14 |
|
15 |
import eu.etaxonomy.cdm.api.service.dto.CategoricalDataDto; |
|
16 |
import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto; |
|
17 |
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO; |
|
18 |
import eu.etaxonomy.cdm.api.service.dto.StateDataDto; |
|
15 | 19 |
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO; |
16 | 20 |
import eu.etaxonomy.cdm.model.description.DescriptionType; |
17 | 21 |
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet; |
... | ... | |
19 | 23 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
20 | 24 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
21 | 25 |
import eu.etaxonomy.cdm.persistence.dto.FeatureDto; |
26 |
import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto; |
|
27 |
import eu.etaxonomy.cdm.persistence.dto.TermDto; |
|
28 |
import eu.etaxonomy.cdm.persistence.dto.TermTreeDto; |
|
22 | 29 |
import eu.etaxonomy.taxeditor.model.ImageResources; |
23 | 30 |
|
24 | 31 |
/** |
... | ... | |
86 | 93 |
public static Image getDefaultDescriptionIcon() { |
87 | 94 |
return ImageResources.getImage(ImageResources.VALIDATE_ICON); |
88 | 95 |
} |
96 |
|
|
97 |
private boolean isApplicableCheck(FeatureDto feature, RowWrapperDTO<?> rowWrapperDTO, TermTreeDto tree) { |
|
98 |
// TermTreeDto tree = matrix.getDescriptiveDataSet().getDescriptiveSystem(); |
|
99 |
boolean isApplicableCheck = true; |
|
100 |
if (tree.getOnlyApplicable().containsKey(feature.getUuid())){ |
|
101 |
|
|
102 |
for (FeatureStateDto featureStateDto:tree.getOnlyApplicable().get(feature.getUuid())){ |
|
103 |
isApplicableCheck = false; |
|
104 |
FeatureDto dto = featureStateDto.getFeature(); |
|
105 |
TermDto stateDto = featureStateDto.getState(); |
|
106 |
Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid()); |
|
107 |
if (descEls != null){ |
|
108 |
for (DescriptionElementDto el:descEls){ |
|
109 |
if (el instanceof CategoricalDataDto){ |
|
110 |
for (StateDataDto stateData:((CategoricalDataDto) el).getStates()){ |
|
111 |
isApplicableCheck |= stateData.getState().getUuid().equals(stateDto.getUuid()); |
|
112 |
} |
|
113 |
} |
|
114 |
} |
|
115 |
} |
|
116 |
} |
|
117 |
} |
|
118 |
if (tree.getInapplicableMap().containsKey(feature.getUuid())){ |
|
119 |
for (FeatureStateDto featureStateDto:tree.getInapplicableMap().get(feature.getUuid())){ |
|
120 |
FeatureDto dto = featureStateDto.getFeature(); |
|
121 |
TermDto stateDto = featureStateDto.getState(); |
|
122 |
Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid()); |
|
123 |
if (descEls != null){ |
|
124 |
for (DescriptionElementDto el:descEls){ |
|
125 |
if (el instanceof CategoricalDataDto){ |
|
126 |
for (StateDataDto stateData:((CategoricalDataDto) el).getStates()){ |
|
127 |
isApplicableCheck &= !stateData.getState().getUuid().equals(stateDto.getUuid()); |
|
128 |
} |
|
129 |
} |
|
130 |
} |
|
131 |
} |
|
132 |
} |
|
133 |
} |
|
134 |
if (!isApplicableCheck){ |
|
135 |
|
|
136 |
} |
|
137 |
return isApplicableCheck; |
|
138 |
} |
|
89 | 139 |
|
90 | 140 |
// private static boolean hasType(TaxonRowWrapperDTO taxonRowWrapperDTO, DescriptionType descriptionType){ |
91 | 141 |
// return taxonRowWrapperDTO.getDescription().getTypes().stream() |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataCellEditor.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
@Override |
50 | 50 |
public void setCanonicalValue(Object canonicalValue) { |
51 |
if(canonicalValue==null){ |
|
52 |
Object rowWrapper = matrix.getBodyDataProvider().getRowObject(this.getRowIndex()); |
|
53 |
if(rowWrapper instanceof RowWrapperDTO){ |
|
54 |
FeatureDto feature = matrix.getIndexToFeatureMap().get(getColumnIndex()); |
|
55 |
// FIXME avoid creating empty CategoricalData |
|
56 |
// ((RowWrapperDTO) rowWrapper).addCategoricalData(feature); |
|
57 |
} |
|
58 |
|
|
59 |
} |
|
60 | 51 |
List canonicalValueList = new ArrayList<>(); |
61 | 52 |
|
62 | 53 |
if (canonicalValue instanceof String[]){ |
... | ... | |
83 | 74 |
@Override |
84 | 75 |
public void widgetSelected(SelectionEvent e) { |
85 | 76 |
matrix.setDirty(); |
86 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_MATRIX, originalCanonicalValue); |
|
87 | 77 |
} |
88 | 78 |
@Override |
89 | 79 |
public void widgetDefaultSelected(SelectionEvent e) { |
Also available in: Unified diff
ref #9861: do not show values when not applicable