import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
/**
* @author pplitzner
Object dataValue = cell.getDataValue();
if(dataValue!=null && dataValue instanceof DescriptionBaseDto){
- DescriptionBase descBase = ((DescriptionBaseDto)dataValue).getDescription();
+ DescriptionBaseDto descBase = (DescriptionBaseDto)dataValue;
part.getSelectionService().setSelection(new StructuredSelection(descBase));
return;
}
if(fullySelectedRowPositions.length==1){
Object rowObject = part.getMatrix().getBodyDataProvider().getRowObject(fullySelectedRowPositions[0]);
if(rowObject instanceof RowWrapperDTO){
- part.getSelectionService().setSelection(new StructuredSelection(((RowWrapperDTO) rowObject).getDescription().getDescription()));
+ part.getSelectionService().setSelection(new StructuredSelection(((RowWrapperDTO) rowObject).getDescription()));
return;
}
}
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.MeasurementUnit;
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.term.TermNode;
-import eu.etaxonomy.cdm.model.term.TermTree;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
// private Collection<RowWrapperDTO<?>> rowsToSave = new HashSet<>();
private HashMap<UUID, RowWrapperDTO<?>> rowsToMerge = new HashMap<>();
- private Map<Integer, Feature> indexToFeatureMap = new HashMap<>();
+ private Map<Integer, FeatureDto> indexToFeatureMap = new HashMap<>();
- private Map<Feature, List<TermDto>> categoricalFeatureToStateMap = new HashMap<>();
+ private Map<UUID, List<TermDto>> categoricalFeatureToStateMap = new HashMap<>();
private LinkedMap<String, String> propertyToLabelMap = new LinkedMap<>();
private Collection<SpecimenNodeWrapper> specimenCache = null;
- private Map<Feature, CategoricalDataHistogram> featureToHistogramMap = new HashMap<>();
+ private Map<FeatureDto, CategoricalDataHistogram> featureToHistogramMap = new HashMap<>();
private ListDataProvider<Object> bodyDataProvider;
private FreezeLayer freezeLayer;
- private List<Feature> features;
+ private List<FeatureDto> features;
private CharacterMatrixPart part;
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
//update label to current dataset
- toolbar.getWsLabel().setText(getDescriptiveDataSet().getLabel());
+ toolbar.getWsLabel().setText(getDescriptiveDataSet().getTitleCache());
toolbar.getWsLabel().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
toolbar.getWsLabel().getParent().layout();
getNatTableState().remove(PersistenceDialog.ACTIVE_VIEW_CONFIGURATION_KEY);
}
- private List<Feature> initFeatureList(TermNode<Feature> node){
- List<Feature> features = new ArrayList<>();
- List<TermNode<Feature>> childNodes = node.getChildNodes();
- for (TermNode<Feature> childNode : childNodes) {
+ private List<FeatureDto> initFeatureList(TermNodeDto node){
+ List<FeatureDto> features = new ArrayList<>();
+ List<TermNodeDto> childNodes = node.getChildren();
+ for (TermNodeDto childNode : childNodes) {
if (childNode != null){
- features.add(childNode.getTerm());
+ features.add((FeatureDto) childNode.getTerm());
features.addAll(initFeatureList(childNode));
}
}
public void initDescriptiveDataSet(){
//get features/columns stored in descriptive dataset
- TermTree<Feature> tree = getDescriptiveDataSet().getDescriptiveSystem();
+ TermTreeDto tree = getDescriptiveDataSet().getDescriptiveSystem();
features = initFeatureList(tree.getRoot());
- Set<Feature> duplicateFeatures = features.stream().filter(i -> Collections.frequency(features, i) >1)
+ Set<FeatureDto> duplicateFeatures = features.stream().filter(i -> Collections.frequency(features, i) >1)
.collect(Collectors.toSet());
if (!duplicateFeatures.isEmpty()) {
throw new IllegalArgumentException("Duplicate features found: "
- + duplicateFeatures.stream().map(feature -> feature.getLabel()).collect(Collectors.joining(",")));
+ + duplicateFeatures.stream().map(feature -> feature.getRepresentation_L10n()).collect(Collectors.joining(",")));
}
//init state data for categorical features
- features.forEach(feature->fetchSupportedStates(feature));
+// features.forEach(feature->fetchSupportedStates(feature));
+ fetchSupportedStates(features);
descriptions = new BasicEventList<>();
}
- private void fetchSupportedStates(Feature feature) {
- List<TermDto> supportedStates = CdmStore.getService(IDescriptiveDataSetService.class).getSupportedStatesForFeature(feature.getUuid());
- categoricalFeatureToStateMap.put(feature, supportedStates);
+ private void fetchSupportedStates(List<FeatureDto> features) {
+ Set<UUID> featureUuids = new HashSet<>();
+ features.forEach(i->featureUuids.add(i.getUuid()));
+ categoricalFeatureToStateMap = CdmStore.getService(IDescriptiveDataSetService.class).getSupportedStatesForFeature(featureUuids);
+
}
treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
TreeList<Object> treeList = new TreeList(sortedList, treeFormat, TreeList.NODES_START_COLLAPSED);
// wrap the SortedList with the TreeList
- treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
+// treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
/**
* data provider
propertyToLabelMap.put(IDENTIFIER_COLUMN, Messages.CharacterMatrix_IDENTIFIER);
propertyToLabelMap.put(COUNTRY_COLUMN, Messages.CharacterMatrix_COUNTRY);
for(int i=0;i<features.size();i++){
- Feature feature = features.get(i);
+ FeatureDto feature = features.get(i);
initLabels(i, feature);
}
// assemble the column groups
LinkedList<ColumnGroupWrapper> columnGroups = new LinkedList<>();
- List<TermNode<Feature>> rootChildren = getDescriptiveDataSet().getDescriptiveSystem().getRootChildren();
+ List<TermNodeDto> rootChildren = getDescriptiveDataSet().getDescriptiveSystem().getRoot().getChildren();
buildHeader(rootChildren, columnGroups);
bodyLayer = new MatrixBodyLayerStack(eventLayer, columnGroups);
ColumnGroupHeaderLayer groupLayerLevel1 = null;
ColumnGroupGroupHeaderLayer groupLayerLevel2 = null;
groupLayerLevel1 = new ColumnGroupHeaderLayer(columnHeaderLayer, selectionLayer, groupLevel1.getModel());
- for (Entry<TermNode<Feature>, TreeSet<Integer>> entry: groupLevel1.getColumnGroupToIndexMap().entrySet()) {
- TermNode<Feature> group = entry.getKey();
+ for (Entry<TermNodeDto, TreeSet<Integer>> entry: groupLevel1.getColumnGroupToIndexMap().entrySet()) {
+ TermNodeDto group = entry.getKey();
TreeSet<Integer> indexList = entry.getValue();
int[] intArray = indexList.stream().mapToInt(Integer::intValue).toArray();
groupLayerLevel1.addColumnsIndexesToGroup(group.getTerm().getTitleCache(), intArray);
if(columnGroups.size()>1){
ColumnGroupWrapper groupLevel2 = columnGroups.get(1);
groupLayerLevel2 = new ColumnGroupGroupHeaderLayer(groupLayerLevel1, selectionLayer, groupLevel2.getModel());
- for (Entry<TermNode<Feature>, TreeSet<Integer>> entry: groupLevel2.getColumnGroupToIndexMap().entrySet()) {
- TermNode<Feature> group = entry.getKey();
+ for (Entry<TermNodeDto, TreeSet<Integer>> entry: groupLevel2.getColumnGroupToIndexMap().entrySet()) {
+ TermNodeDto group = entry.getKey();
TreeSet<Integer> indexList = entry.getValue();
int[] intArray = indexList.stream().mapToInt(Integer::intValue).toArray();
groupLayerLevel2.addColumnsIndexesToGroup(group.getTerm().getTitleCache(), intArray);
}
- private TreeSet<Integer> recurseChildIndexes(TermNode<Feature> node){
+ private TreeSet<Integer> recurseChildIndexes(TermNodeDto node){
TreeSet<Integer> childIndexes = new TreeSet<>();
- if(node.getChildCount()>0){
- List<TermNode<Feature>> childNodes = node.getChildNodes();
- for (TermNode<Feature> childNode: childNodes) {
+ if(node.getChildren().size() >0){
+ List<TermNodeDto> childNodes = node.getChildren();
+ for (TermNodeDto childNode: childNodes) {
if (childNode != null){
childIndexes.addAll(recurseChildIndexes(childNode));
}
return childIndexes;
}
- private void buildHeader(List<TermNode<Feature>> nodes, LinkedList<ColumnGroupWrapper> columnGroups){
- Map<TermNode<Feature>, TreeSet<Integer>> columnGroupToIndexMap = new HashMap<>();
- List<TermNode<Feature>> childNodes = new ArrayList<>();
- for (TermNode<Feature> node : nodes) {
+ private void buildHeader(List<TermNodeDto> nodes, LinkedList<ColumnGroupWrapper> columnGroups){
+ Map<TermNodeDto, TreeSet<Integer>> columnGroupToIndexMap = new HashMap<>();
+ List<TermNodeDto> childNodes = new ArrayList<>();
+ for (TermNodeDto node : nodes) {
if (node != null){
TreeSet<Integer> childIndexes = recurseChildIndexes(node);
if(childIndexes.size()>1){
// filter out groups that only have one member
columnGroupToIndexMap.put(node, childIndexes);
}
- childNodes.addAll(node.getChildNodes());
+ childNodes.addAll(node.getChildren());
}
}
if(!columnGroupToIndexMap.isEmpty()){
}
}
- private void initLabels(int index, Feature feature) {
+ private void initLabels(int index, FeatureDto feature) {
indexToFeatureMap.put(index+LEADING_COLUMN_COUNT, feature);
- String label = feature.getLabel();
+ String label = feature.getTitleCache();
String property = feature.getUuid().toString();
//show unit for quantitative data
if(feature.isSupportsQuantitativeData()){
- Set<MeasurementUnit> recommendedMeasurementUnits = feature.getRecommendedMeasurementUnits();
+ Set<TermDto> recommendedMeasurementUnits = feature.getRecommendedMeasurementUnits();
// if(recommendedMeasurementUnits.size()>1){
// MessagingUtils.warningDialog(Messages.CharacterMatrix_INIT_PROBLEM, CharacterMatrix.class,
// String.format(Messages.CharacterMatrix_INIT_PROBLEM_MESSAGE, feature.getLabel()));
// }
if(recommendedMeasurementUnits.size()==1){
- MeasurementUnit unit = recommendedMeasurementUnits.iterator().next();
+ TermDto unit = recommendedMeasurementUnits.iterator().next();
label += " ["+unit.getIdInVocabulary()+"]"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
- public List<TermDto> getSupportedStatesForCategoricalFeature(Feature feature){
- return categoricalFeatureToStateMap.get(feature);
+ public List<TermDto> getSupportedStatesForCategoricalFeature(UUID featureUuid){
+ return categoricalFeatureToStateMap.get(featureUuid);
}
public Set<DescriptionBase> getDescriptionsToSave() {
this.descriptionsToSave.add(descriptionToSave);
}
- public Map<Integer, Feature> getIndexToFeatureMap() {
+ public Map<Integer, FeatureDto> getIndexToFeatureMap() {
return indexToFeatureMap;
}
return descriptions;
}
- public DescriptiveDataSet getDescriptiveDataSet() {
+ public DescriptiveDataSetBaseDto getDescriptiveDataSet() {
return part.getDescriptiveDataSet();
}
- public void setDescriptiveDataSet(DescriptiveDataSet dataSet) {
+ public void setDescriptiveDataSet(DescriptiveDataSetBaseDto dataSet) {
part.setDescriptiveDataSet(dataSet);
}
if (this.rowsToMerge == null){
this.rowsToMerge = new HashMap<>();
}
- this.rowsToMerge.put(rowToMerge.getDescription().getDescription().getUuid(), rowToMerge);
+ this.rowsToMerge.put(rowToMerge.getDescription().getDescriptionUuid(), rowToMerge);
}
public Properties getNatTableState() {
return new File(WorkbenchUtility.getBaseLocation(), CHARACTER_MATRIX_STATE_PROPERTIES);
}
- public List<Feature> getFeatures() {
+ public List<FeatureDto> getFeatures() {
return features;
}
- public Map<Feature, CategoricalDataHistogram> getFeatureToHistogramMap() {
+ public Map<FeatureDto, CategoricalDataHistogram> getFeatureToHistogramMap() {
return featureToHistogramMap;
}
}
dataSet = this.getCdmEntitiySession().load(dataSet, true);
// update local dataset
- this.setDescriptiveDataSet(dataSet);
+ DescriptiveDataSetBaseDto dto = DescriptiveDataSetBaseDto.fromDescriptiveDataSet(dataSet);
+ this.setDescriptiveDataSet(dto);
//these descriptions are already updated
for (SpecimenRowWrapperDTO row: specimenToAdd){
- this.rowsToMerge.remove(row.getDescription().getDescription().getUuid());
+ this.rowsToMerge.remove(row.getDescription().getDescriptionUuid());
}
specimenToAdd.clear();
return resultMap;
}
+ @Override
+ public void dispose () {
+ super.dispose();
+ descriptions.dispose();
+ descriptions = null;
+ this.natTable.dispose();
+ this.natTable = null;
+ categoricalFeatureToStateMap = null;
+ rowsToMerge.clear();
+ rowsToMerge = null;
+ indexToFeatureMap = null;
+ propertyToLabelMap = null;
+ specimenCache = null;
+ featureToHistogramMap = null;
+ bodyDataProvider = null;
+ freezeLayer = null;
+ features = null;
+ topMostLayer.dispose();
+ topMostLayer = null;
+ configRegistry = null;
+ bodyLayer.dispose();
+ bodyLayer = null;
+ toolbar.dispose();
+ toolbar = null;
+ treeFormat = null;
+ descriptionUuidsToDelete = null;
+ specimenToAdd = null;
+ mouseEventMatcher = null;
+ descriptionsToSave = null;
+ menuService = null;
+ sync = null;
+ part = null;
+
+ }
}
import org.eclipse.swt.widgets.Composite;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.api.service.description.AggregationMode;
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
-import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
return;
}
- Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getTaxonSubtreeFilter().stream()
- .map(node->new TaxonNodeDto(node))
- .collect(Collectors.toSet());
+ Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getSubTreeFilter();
TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
UUID taxonUuid = parentDto.getTaxonUuid();
int response = MessagingUtils.confirmDialog(
null, null);
IStructuredSelection sel = matrix.getSelection();
Object o = sel.getFirstElement();
- TaxonNodeFilter filter = TaxonNodeFilter.NewRankInstance(matrix.getDescriptiveDataSet().getMinRank(),
- matrix.getDescriptiveDataSet().getMaxRank());
- for (NamedArea namedArea : matrix.getDescriptiveDataSet().getGeoFilter()) {
+ TaxonNodeFilter filter = TaxonNodeFilter.NewRankInstance(matrix.getDescriptiveDataSet().getMinRank().getUuid(),
+ matrix.getDescriptiveDataSet().getMaxRank().getUuid());
+ for (TermDto namedArea : matrix.getDescriptiveDataSet().getGeoFilter()) {
filter = filter.orArea(namedArea.getUuid());
}
// for (TaxonNode taxonNode : matrix.getDescriptiveDataSet().getTaxonSubtreeFilter()) {
if (o instanceof TaxonNodeDto){
filter = filter.orSubtree(CdmStore.getService(ITaxonNodeService.class).load(((TaxonNodeDto)o).getUuid()));
}else{
- for (TaxonNode taxonNode : matrix.getDescriptiveDataSet().getTaxonSubtreeFilter()) {
- filter = filter.orSubtree(taxonNode);
+ for (TaxonNodeDto taxonNode : matrix.getDescriptiveDataSet().getSubTreeFilter()) {
+ filter = filter.orSubtree(taxonNode.getUuid());
}
}
config.setTaxonNodeFilter(filter);
}
else if(resultObject instanceof UpdateResult){
DescriptiveDataSet dataSet = (DescriptiveDataSet) ((UpdateResult) resultObject).getCdmEntity();
- dataSet = matrix.getCdmEntitiySession().load(dataSet, true);
+// dataSet = matrix.getCdmEntitiySession().load(dataSet, true);
+
+ DescriptiveDataSetBaseDto dto = CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(dataSet.getUuid());
// update local dataset
- matrix.setDescriptiveDataSet(dataSet);
+ matrix.setDescriptiveDataSet(dto);
matrix.loadDescriptions(false, false);
}
} catch (InterruptedException e) {
.collect(Collectors.joining("\n"))));
}
DescriptiveDataSet dataSet = (DescriptiveDataSet) result.getCdmEntity();
- dataSet = matrix.getCdmEntitiySession().load(dataSet, true);
+// dataSet = matrix.getCdmEntitiySession().load(dataSet, true);
+ // update local dataset
+ DescriptiveDataSetBaseDto dto = CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(dataSet.getUuid());
// update local dataset
- matrix.setDescriptiveDataSet(dataSet);
+ matrix.setDescriptiveDataSet(dto);
+// matrix.setDescriptiveDataSet(dataSet);
matrix.loadDescriptions(false, false);
}
} catch (InterruptedException e) {
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator;
+import eu.etaxonomy.cdm.api.service.dto.CategoricalDataDto;
import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
+import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
+import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.CategoricalData;
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.DescriptionType;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.QuantitativeData;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
/**
}
// check for existing default values
if(columnPosition>=CharacterMatrix.LEADING_COLUMN_COUNT){
- Feature feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
+ FeatureDto feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
if(hasDefaultValue(feature, taxonRowWrapper)){
configLabels.addLabel(HAS_DEFAULT);
if(hasDefaultOverriddenValue(feature, taxonRowWrapper)){
}
}
}
- //check for supplemental data
- if(!taxonRowWrapper.getDescription().getDescription().getSources().isEmpty() && columnPosition==0){
- configLabels.addLabel(CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
- }
+ //check for supplemental data TODO: add supplemental data to DTO
+// if(!taxonRowWrapper.getDescription().getSources().isEmpty() && columnPosition==0){
+// configLabels.addLabel(CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
+// }
configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DESCRIPTION);
}
configLabels.addLabel(CharacterMatrix.COUNTRY_COLUMN);
}
else{
- Feature feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
+ FeatureDto feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
configLabels.addLabel(MatrixUtility.getProperty(feature));
// check for default values
if(rowObject instanceof SpecimenRowWrapperDTO){
}
}
- private boolean hasDefaultOverriddenValue(Feature feature, RowWrapperDTO<?> rowWrapper) {
- DescriptionElementBase dataValueForFeature = rowWrapper.getDataValueForFeature(feature);
+ private boolean hasDefaultOverriddenValue(FeatureDto feature, RowWrapperDTO<?> rowWrapper) {
+ DescriptionElementDto dataValueForFeature = rowWrapper.getDataValueForFeature(feature.getUuid());
if(dataValueForFeature!=null){
- if(dataValueForFeature instanceof CategoricalData){
- return !((CategoricalData) dataValueForFeature).getStatesOnly().isEmpty();
+ if(dataValueForFeature instanceof CategoricalDataDto){
+ return !((CategoricalDataDto) dataValueForFeature).getStates().isEmpty();
}
- else if(dataValueForFeature instanceof QuantitativeData){
- return !((QuantitativeData) dataValueForFeature).getStatisticalValues().isEmpty();
+ else if(dataValueForFeature instanceof QuantitativeDataDto){
+ return !((QuantitativeDataDto) dataValueForFeature).getValues().isEmpty();
}
}
return false;
}
- private boolean hasDefaultValue(Feature feature, RowWrapperDTO<?> rowWrapperDTO) {
+ private boolean hasDefaultValue(FeatureDto feature, RowWrapperDTO<?> rowWrapperDTO) {
if(rowWrapperDTO instanceof SpecimenRowWrapperDTO
&& ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription()!=null){
- TaxonDescription taxDescription = (TaxonDescription)((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription().getDescription();
+ DescriptionBaseDto taxDescription = ((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription();
return hasDefaultValue(feature, taxDescription);
}
else if(rowWrapperDTO instanceof TaxonRowWrapperDTO){
TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO)rowWrapperDTO;
Set<DescriptionBaseDto> descriptions = taxonRowWrapper.getTaxonDescriptions();
for (DescriptionBaseDto taxonDescription : descriptions) {
- if(matrix.getDescriptiveDataSet().getDescriptions().contains(taxonDescription)
- && taxonDescription.getDescription().getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
- return hasDefaultValue(feature, (TaxonDescription)taxonDescription.getDescription());
- }
+// if(matrix.getDescriptiveDataSet().getDescriptions().contains(taxonDescription)
+// && taxonDescription.getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
+// return hasDefaultValue(feature, taxonDescription);
+// }
+ //TODO: correct implementation
+ return false;
}
}
return false;
}
- private boolean hasDefaultValue(Feature feature, TaxonDescription defaultDescription) {
+ private boolean hasDefaultValue(FeatureDto feature, DescriptionBaseDto defaultDescription) {
if(defaultDescription!=null){
- Optional<DescriptionElementBase> descriptionElement = defaultDescription.getElements().stream()
- .filter(element->element.getFeature().equals(feature))
+ Optional<DescriptionElementDto> descriptionElement = defaultDescription.getElements().stream()
+ .filter(element->element.getFeatureUuid().equals(feature.getUuid()))
.findAny();
- if(descriptionElement.isPresent() && descriptionElement.get() instanceof CategoricalData){
- return !((CategoricalData) descriptionElement.get()).getStatesOnly().isEmpty();
+ if(descriptionElement.isPresent() && descriptionElement.get() instanceof CategoricalDataDto){
+ return !((CategoricalDataDto) descriptionElement.get()).getStates().isEmpty();
}
- else if(descriptionElement.isPresent() && descriptionElement.get() instanceof QuantitativeData){
- return !((QuantitativeData) descriptionElement.get()).getStatisticalValues().isEmpty();
+ else if(descriptionElement.isPresent() && descriptionElement.get() instanceof QuantitativeDataDto){
+ return !((QuantitativeDataDto) descriptionElement.get()).getValues().isEmpty();
}
}
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
"maxRank", //$NON-NLS-1$
});
- private DescriptiveDataSet descriptiveDataSet;
+ private DescriptiveDataSetBaseDto descriptiveDataSet;
private ConversationHolder conversation;
label.setText(Messages.CharacterMatrixPart_LOADING_MATRIX);
stackLayout.topControl = label;
ContextInjectionFactory.inject(matrix, context);
+
}
public void init(UUID descriptiveDataSetUuid, boolean treeView) {
- this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class).load(descriptiveDataSetUuid, WS_PROPERTY_PATH);
+// this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class).load(descriptiveDataSetUuid, WS_PROPERTY_PATH);
+ this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(descriptiveDataSetUuid);
if(descriptiveDataSet!=null){
if(descriptiveDataSet.getDescriptiveSystem()==null
|| descriptiveDataSet.getDescriptiveSystem().getTermType()==null
return;
}
matrix.createTable(treeView, true, true);
- thisPart.setLabel(descriptiveDataSet.getLabel());
+ thisPart.setLabel(descriptiveDataSet.getTitleCache());
matrix.loadDescriptions( true, true);
}
}
this.dirty.setDirty(true);
}
- public DescriptiveDataSet getDescriptiveDataSet() {
+ public DescriptiveDataSetBaseDto getDescriptiveDataSet() {
return descriptiveDataSet;
}
- public void setDescriptiveDataSet(DescriptiveDataSet dataSet) {
+ public void setDescriptiveDataSet(DescriptiveDataSetBaseDto dataSet) {
this.descriptiveDataSet = dataSet;
}
descriptionResults.put(result.getUuid(), (DescriptionBase)result);
}
}
- List<Object> updateRows = matrix.getDescriptions().stream().filter(row->descriptionResults.keySet().contains(((RowWrapperDTO)row).getDescription().getDescription().getUuid())).collect(Collectors.toList());
+ List<Object> updateRows = matrix.getDescriptions().stream().filter(row->descriptionResults.keySet().contains(((RowWrapperDTO)row).getDescription().getDescriptionUuid())).collect(Collectors.toList());
for (Object updateRow: updateRows){
if (updateRow instanceof SpecimenRowWrapperDTO){
SpecimenRowWrapperDTO dto = (SpecimenRowWrapperDTO)updateRow;
- dto.getDescription().setDescription(descriptionResults.get(((SpecimenRowWrapperDTO) updateRow).getDescription().getDescription().getUuid()));
+ DescriptionBaseDto desc = DescriptionBaseDto.fromDescription(descriptionResults.get(((SpecimenRowWrapperDTO) updateRow).getDescription().getDescriptionUuid()));
+ dto.setDescription(desc);
}
}
// matrix.loadDescriptions(getDescriptiveDataSet().getUuid(), false);
cdmEntitySession.dispose();
cdmEntitySession = null;
}
+ descriptiveDataSet = null;
+ this.matrix.dispose();
dirty.setDirty(false);
}
@Override
public Collection<DescriptiveDataSet> getRootEntities() {
- return Collections.singleton(this.descriptiveDataSet);
+ //no dataset entity only dto
+ return null;
}
@Override
ComboViewer comboStates = new ComboViewer(this, SWT.DROP_DOWN);
Button btnManageState = new Button(this, SWT.PUSH);
Button btnExcelExport = new Button(this, SWT.PUSH);
+ Button btnRefresh = new Button(this, SWT.PUSH);
/**
* Toogle tree button
}
});
+ /**
+ * excel export
+ */
+// btnRefresh.setToolTipText(Messages.CharacterMatrix_REFFRESH);
+ btnRefresh.setImage(ImageResources.getImage(ImageResources.REFRESH));
+ btnRefresh.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (matrix != null && matrix.getPart() != null){
+
+ matrix.getPart().init(matrix.getDescriptiveDataSet().getUuid(), true);
+ matrix.initDescriptiveDataSet();
+ matrix.redraw();
+ }
+
+
+
+ }
+ });
+
}
private void persistTableState() {
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.term.TermNode;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
/**
* @author pplitzner
*/
public class ColumnGroupWrapper {
private ColumnGroupModel model;
- private Map<TermNode<Feature>, TreeSet<Integer>> columnGroupToIndexMap;
+ private Map<TermNodeDto, TreeSet<Integer>> columnGroupToIndexMap;
public ColumnGroupWrapper(ColumnGroupModel model,
- Map<TermNode<Feature>, TreeSet<Integer>> columnGroupToIndexMap) {
+ Map<TermNodeDto, TreeSet<Integer>> columnGroupToIndexMap) {
this.model = model;
this.columnGroupToIndexMap = columnGroupToIndexMap;
}
public void setModel(ColumnGroupModel model) {
this.model = model;
}
- public Map<TermNode<Feature>, TreeSet<Integer>> getColumnGroupToIndexMap() {
+ public Map<TermNodeDto, TreeSet<Integer>> getColumnGroupToIndexMap() {
return columnGroupToIndexMap;
}
- public void setColumnGroupToIndexMap(Map<TermNode<Feature>, TreeSet<Integer>> columnGroupToIndexMap) {
+ public void setColumnGroupToIndexMap(Map<TermNodeDto, TreeSet<Integer>> columnGroupToIndexMap) {
this.columnGroupToIndexMap = columnGroupToIndexMap;
}
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
-import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
*/
public class DescriptionTreeFormat implements TreeList.Format<Object> {
- private Rank maxRank;
+ private TermDto maxRank;
private Integer deepestTaxonLevel = null;
private Map<UUID, TaxonNodeDto> uuidToTaxonNodeDtoMap = new HashMap<>();
- public DescriptionTreeFormat(DescriptiveDataSet descriptiveDataSet) {
+ public DescriptionTreeFormat(DescriptiveDataSetBaseDto descriptiveDataSet) {
this.maxRank = descriptiveDataSet.getMaxRank();
}
level++;
if(node!=null){
- if(maxRank!=null && node.getRankOrderIndex()!=null && node.getRankOrderIndex()==maxRank.getOrderIndex()){
+ if(maxRank!=null && node.getRankOrderIndex()!=null && node.getRankOrderIndex().equals(maxRank.getOrderIndex())){
path.add(node);
return level;
}
if(parentNodeDto==null){
parentNodeDto = CdmStore.getService(ITaxonNodeService.class).parentDto(node.getUuid());
if(parentNodeDto!=null){
- uuidToTaxonNodeDtoMap.put(node.getParentUUID(), parentNodeDto);
+ uuidToTaxonNodeDtoMap.put(parentNodeDto.getUuid(), parentNodeDto);
}
}
- if(parentNodeDto!=null){
+ if (parentNodeDto != null){
level = addPathRecursive(path, parentNodeDto, level);
path.add(node);
}
+
+
+
}
return level;
}
import java.util.Comparator;
+import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionType;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoByNameComparator;
else{
// same taxon node
}
- DescriptionBase description1 = rowWrapper1.getDescription().getDescription();
- DescriptionBase description2 = rowWrapper2.getDescription().getDescription();
+ DescriptionBaseDto description1 = rowWrapper1.getDescription();
+ DescriptionBaseDto description2 = rowWrapper2.getDescription();
//compare by taxon description type
- if(description1 instanceof TaxonDescription){
- if(description2 instanceof SpecimenDescription){
+ if(description1.getTaxonDto() != null){
+ if(description2.getSpecimenDto() != null){
return -1;
}
}
else{
- if(description2 instanceof TaxonDescription){
+ if(description2.getTaxonDto() != null){
return 1;
}
}
//both descriptions are of the same type
- if(description1 instanceof SpecimenDescription){
+ if(description1.getSpecimenDto() != null){
//description2 has to also be a SpecimenDescription
- return compareSpecimenDescriptions((SpecimenDescription)description1, (SpecimenDescription)description2);
+ return compareSpecimenDescriptions(description1, description2);
}
- else if(description1 instanceof TaxonDescription){
+ else if(description1.getTaxonDto() != null){
//description2 has to also be a TaxonDescription
- return compareTaxonDescriptions((TaxonDescription)description1, (TaxonDescription)description2);
+ return compareTaxonDescriptions(description1, description2);
}
}
return o1.hashCode()-o2.hashCode();
}
- private int compareTaxonDescriptions(TaxonDescription taxonDescription1, TaxonDescription taxonDescription2) {
+ private int compareTaxonDescriptions(DescriptionBaseDto taxonDescription1, DescriptionBaseDto taxonDescription2) {
boolean isComputed1 = taxonDescription1.getTypes().stream()
.anyMatch(type -> type.equals(DescriptionType.AGGREGATED_STRUC_DESC));
boolean isComputed2 = taxonDescription2.getTypes().stream()
return taxonDescription1.hashCode()-taxonDescription2.hashCode();
}
- private int compareSpecimenDescriptions(SpecimenDescription specimenDescription1,
- SpecimenDescription specimenDescription2) {
- int id1 = specimenDescription1.getDescribedSpecimenOrObservation().getId();
- int id2 = specimenDescription2.getDescribedSpecimenOrObservation().getId();
+ private int compareSpecimenDescriptions(DescriptionBaseDto specimenDescription1,
+ DescriptionBaseDto specimenDescription2) {
+ int id1 = specimenDescription1.getSpecimenDto().getId();
+ int id2 = specimenDescription2.getSpecimenDto().getId();
return id1-id2;
}
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.taxeditor.model.ImageResources;
/**
* @param feature
* @return
*/
- public static String getProperty(Feature feature){
- return feature.getLabel();
+ public static String getProperty(FeatureDto feature){
+ return feature.getTitleCache();
}
/**
}
private static boolean hasType(TaxonRowWrapperDTO taxonRowWrapperDTO, DescriptionType descriptionType){
- return taxonRowWrapperDTO.getDescription().getDescription().getTypes().stream()
+ return taxonRowWrapperDTO.getDescription().getTypes().stream()
.anyMatch(type->type.equals(descriptionType));
}
public static Image getDefaultDescriptionIcon() {
return ImageResources.getImage(ImageResources.VALIDATE_ICON);
}
+
+// private static boolean hasType(TaxonRowWrapperDTO taxonRowWrapperDTO, DescriptionType descriptionType){
+// return taxonRowWrapperDTO.getDescription().getTypes().stream()
+// .anyMatch(type->type.equals(descriptionType));
+// }
}
*/
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.UUID;
-import java.util.stream.Collectors;
import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor;
-import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.State;
-import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* Property accessor class which maps setting and getting data for
default:
break;
}
- Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
- return rowWrapper.getDisplayDataForFeature(feature);
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
+ return rowWrapper.getDisplayDataForFeature(feature.getUuid());
}
else if(rowObject instanceof TaxonRowWrapperDTO){
TaxonRowWrapperDTO taxonWrapper = (TaxonRowWrapperDTO)rowObject;
if(columnIndex==0){
return taxonWrapper.getDescription();
}
- Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
- return taxonWrapper.getDisplayDataForFeature(feature);
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
+ if (feature == null){
+ return null;
+ }
+ return taxonWrapper.getDisplayDataForFeature(feature.getUuid());
}
else if (columnIndex == 0) {
if(rowObject instanceof RowWrapperDTO){
RowWrapperDTO rowWrapper = (RowWrapperDTO)rowObject;
- Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
if(feature.isSupportsCategoricalData()
&& newValue instanceof Collection
&& ((Collection) newValue).stream().allMatch(o->o instanceof TermDto)){
List<TermDto> dtos = (List<TermDto>)newValue;
- List<UUID> termUuids = dtos.stream().map(dto->dto.getUuid()).collect(Collectors.toList());
- List<DefinedTermBase> terms = CdmStore.getService(ITermService.class).load(termUuids, null);
- List<State> states = new ArrayList<>();
- for (DefinedTermBase definedTermBase : terms) {
- if(definedTermBase instanceof State){
- states.add((State) definedTermBase);
- }
- }
- rowWrapper.setDataValueForCategoricalData(feature, states);
+// List<UUID> termUuids = dtos.stream().map(dto->dto.getUuid()).collect(Collectors.toList());
+// List<DefinedTermBase> terms = CdmStore.getService(ITermService.class).load(termUuids, null);
+// List<State> states = new ArrayList<>();
+// for (DefinedTermBase definedTermBase : terms) {
+// if(definedTermBase instanceof State){
+// states.add((State) definedTermBase);
+// }
+// }
+ rowWrapper.setDataValueForCategoricalData(feature.getUuid(), dtos);
matrix.putRowToMerge(rowWrapper);
}
}
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider;
-import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
@Override
public List<?> getValues(int columnIndex, int rowIndex) {
- Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
- List<TermDto> supportedStatesForCategoricalFeature = matrix.getSupportedStatesForCategoricalFeature(feature);
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
+ List<TermDto> supportedStatesForCategoricalFeature = matrix.getSupportedStatesForCategoricalFeature(feature.getUuid());
return supportedStatesForCategoricalFeature;
}
import org.eclipse.swt.widgets.Control;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
/**
if(canonicalValue==null){
Object rowWrapper = matrix.getBodyDataProvider().getRowObject(this.getRowIndex());
if(rowWrapper instanceof RowWrapperDTO){
- Feature feature = matrix.getIndexToFeatureMap().get(getColumnIndex());
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(getColumnIndex());
// FIXME avoid creating empty CategoricalData
((RowWrapperDTO) rowWrapper).addCategoricalData(feature);
}
public Object canonicalToDisplayValue(Object canonicalValue) {
if(canonicalValue instanceof TermDto){
((TermDto) canonicalValue).localize(new TermRepresentation_L10n());
- return ((TermDto) canonicalValue).getRepresentation_L10n();
+ return ((TermDto) canonicalValue).getTitleCache();
}
else if (canonicalValue instanceof Collection) {
// Collection.toString() will add [ and ] around
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
-import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
nodeDtos.add((TaxonNodeDto)o);
}
}
- TaxonNodeFilter filter = TaxonNodeFilter.NewRankInstance(matrix.getDescriptiveDataSet().getMinRank(),
- matrix.getDescriptiveDataSet().getMaxRank());
- for (NamedArea namedArea : matrix.getDescriptiveDataSet().getGeoFilter()) {
+ TaxonNodeFilter filter = TaxonNodeFilter.NewRankInstance(matrix.getDescriptiveDataSet().getMinRank().getUuid(),
+ matrix.getDescriptiveDataSet().getMaxRank().getUuid());
+ for (TermDto namedArea : matrix.getDescriptiveDataSet().getGeoFilter()) {
filter = filter.orArea(namedArea.getUuid());
}
filter = filter.orSubtree(dto.getUuid());
}
}else{
- for (TaxonNode taxonNode : matrix.getDescriptiveDataSet().getTaxonSubtreeFilter()) {
- filter = filter.orSubtree(taxonNode);
+ for (TaxonNodeDto taxonNode : matrix.getDescriptiveDataSet().getSubTreeFilter()) {
+ filter = filter.orSubtree(taxonNode.getUuid());
}
}
config.setTaxonNodeFilter(filter);
DescriptiveDataSet dataSet = (DescriptiveDataSet) ((UpdateResult) resultObject).getCdmEntity();
dataSet = matrix.getCdmEntitiySession().load(dataSet, true);
// update local dataset
- matrix.setDescriptiveDataSet(dataSet);
+ DescriptiveDataSetBaseDto dto = DescriptiveDataSetBaseDto.fromDescriptiveDataSet(dataSet);
+ matrix.setDescriptiveDataSet(dto);
matrix.loadDescriptions(false, false);
}
} catch (InterruptedException e) {
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
import eu.etaxonomy.cdm.model.description.DescriptionType;
-import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
import eu.etaxonomy.taxeditor.store.CdmStore;
boolean canExecute = super.canExecute(activePart, menuItem);
if(canExecute){
CharacterMatrixPart matrixPart = (CharacterMatrixPart) activePart.getObject();
- DescriptiveDataSet descriptiveDataSet = matrixPart.getDescriptiveDataSet();
+ DescriptiveDataSetBaseDto descriptiveDataSet = matrixPart.getDescriptiveDataSet();
IStructuredSelection selection = ((CharacterMatrixPart)activePart.getObject()).getSelection();
TaxonNodeDto taxonNodeDto = (TaxonNodeDto) selection.getFirstElement();
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
import eu.etaxonomy.cdm.model.description.DescriptionType;
-import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
import eu.etaxonomy.taxeditor.store.CdmStore;
if(StoreUtil.promptCheckIsDirty(matrixPart)){
return;
}
- DescriptiveDataSet descriptiveDataSet = matrixPart.getDescriptiveDataSet();
+ DescriptiveDataSetBaseDto descriptiveDataSet = matrixPart.getDescriptiveDataSet();
TaxonNodeDto node = (TaxonNodeDto) matrixPart.getSelection().getFirstElement();
TaxonRowWrapperDTO taxonRowWrapperDTO = CdmStore.getService(IDescriptiveDataSetService.class)
.createTaxonDescription(descriptiveDataSet.getUuid(), node.getUuid(), getDescriptionType());
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.config.RemoveDescriptionsFromDescriptiveDataSetConfigurator;
+import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
// if(StoreUtil.promptCheckIsDirty(matrixPart)){
// return;
// }
- DescriptiveDataSet descriptiveDataSet = matrixPart.getDescriptiveDataSet();
+ DescriptiveDataSetBaseDto descriptiveDataSet = matrixPart.getDescriptiveDataSet();
RowWrapperDTO wrapper = (RowWrapperDTO) matrixPart.getSelection().getFirstElement();
- DescriptionBase description = wrapper.getDescription().getDescription();
+ DescriptionBaseDto description = wrapper.getDescription();
RemoveDescriptionsFromDescriptiveDataSetConfigurator deleteConfig = new RemoveDescriptionsFromDescriptiveDataSetConfigurator();
if (!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfig, shell, Messages.DeleteDescriptiveDataSetHandler_DELETE_TITLE, Messages.CharacterMatrix_DELETE_DESCRIPTION)){
return;
}
boolean ok = matrixPart.getMatrix().getDescriptions().remove(wrapper);
- matrixPart.getMatrix().addDescriptionToDelete(description.getUuid(), deleteConfig);
- if (description instanceof SpecimenDescription){
+ matrixPart.getMatrix().addDescriptionToDelete(description.getDescriptionUuid(), deleteConfig);
+ if (description.getSpecimenDto() != null){
UuidAndTitleCache<SpecimenOrObservationBase> uuidAndTitleCache = new UuidAndTitleCache<>(((SpecimenRowWrapperDTO)wrapper).getSpecimenDto().getUuid(), ((SpecimenRowWrapperDTO)wrapper).getSpecimenDto().getId(), ((SpecimenRowWrapperDTO)wrapper).getSpecimenDto().getLabel());
SpecimenNodeWrapper nodeWrapper = new SpecimenNodeWrapper(uuidAndTitleCache,
((SpecimenRowWrapperDTO)wrapper).getType(),
MHandledMenuItem menuItem){
CharacterMatrixPart matrixPart = (CharacterMatrixPart) activePart.getObject();
- DescriptiveDataSet descriptiveDataSet = matrixPart.getDescriptiveDataSet();
+ DescriptiveDataSetBaseDto descriptiveDataSet = matrixPart.getDescriptiveDataSet();
IStructuredSelection selection = ((CharacterMatrixPart)activePart.getObject()).getSelection();
boolean canExecute = selection.size()==1
import java.util.List;
import java.util.Set;
import java.util.UUID;
-import java.util.stream.Collectors;
import javax.inject.Named;
if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
return;
}
- Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getTaxonSubtreeFilter().stream()
- .map(node->new TaxonNodeDto(node))
- .collect(Collectors.toSet());
+ Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getSubTreeFilter();
TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
UUID taxonUuid = parentDto.getTaxonUuid();
int response = MessagingUtils.confirmDialog(
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.QuantitativeData;
-import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
/**
this.matrix = matrix;
}
- private QuantitativeData editorValue;
+ private QuantitativeDataDto editorValue;
private RowWrapperDTO<?> rowWrapperDTO;
private QuantitativeDataDialogComposite composite;
return composite;
}
- void setEditorValue(QuantitativeData editorValue) {
+ void setEditorValue(QuantitativeDataDto editorValue) {
this.editorValue = editorValue;
}
public boolean close() {
if(getReturnCode()==Window.OK){
//clear values
- editorValue.getStatisticalValues().clear();
+ editorValue.getValues().clear();
//add back all values from text fields
- Map<StatisticalMeasure, List<String>> measureToValueMap = new HashMap<>();
+ Map<TermDto, List<String>> measureToValueMap = new HashMap<>();
- Map<StatisticalMeasure, List<Text>> textFields = composite.getTextFields();
- Set<Entry<StatisticalMeasure,List<Text>>> entrySet = textFields.entrySet();
- for (Entry<StatisticalMeasure, List<Text>> entry : entrySet) {
- StatisticalMeasure statisticalMeasure = entry.getKey();
+ Map<TermDto, List<Text>> textFields = composite.getTextFields();
+ Set<Entry<TermDto,List<Text>>> entrySet = textFields.entrySet();
+ for (Entry<TermDto, List<Text>> entry : entrySet) {
+ TermDto statisticalMeasure = entry.getKey();
List<String> values = entry.getValue().stream()
.filter(text->text.isEnabled())
.map(text->text.getText())
.collect(Collectors.toList());
measureToValueMap.put(statisticalMeasure, values);
}
- rowWrapperDTO.setDataValueForQuantitativeData(editorValue.getFeature(), measureToValueMap, composite.getEditorValue().getUnit());
-// if (composite.getEditorValue().getUnit() == null && (composite.getEditorValue().getFeature().getRecommendedMeasurementUnits() != null && composite.getEditorValue().getFeature().getRecommendedMeasurementUnits().size() == 1)){
-// editorValue.setUnit(editorValue.getFeature().getRecommendedMeasurementUnits().iterator().next());
-// }else{
-// editorValue.setUnit(composite.getEditorValue().getUnit());
-// }
-
-// ((QuantitativeData)rowWrapperDTO.getDataValueForFeature(editorValue.getFeature())).setUnit(editorValue.getUnit());
+ rowWrapperDTO.setDataValueForQuantitativeData(editorValue.getFeatureDto().getUuid(), measureToValueMap, composite.getEditorValue().getMeasurementUnit());
+ if (composite.getEditorValue().getMeasurementUnit() == null && (composite.getEditorValue().getFeatureDto().getRecommendedMeasurementUnits() != null && composite.getEditorValue().getFeatureDto().getRecommendedMeasurementUnits().size() == 1)){
+ editorValue.setMeasurementUnit(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next());
+ }else{
+ editorValue.setMeasurementUnit(composite.getEditorValue().getMeasurementUnit());
+ }
+
+ ((QuantitativeDataDto)rowWrapperDTO.getDataValueForFeature(editorValue.getFeatureDto().getUuid())).setMeasurementUnit(editorValue.getMeasurementUnit());
matrix.putRowToMerge(rowWrapperDTO);
matrix.setDirty();
}
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
import eu.etaxonomy.cdm.common.CdmUtils;
-import eu.etaxonomy.cdm.model.description.MeasurementUnit;
-import eu.etaxonomy.cdm.model.description.QuantitativeData;
import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.model.ImageResources;
/**
*/
public class QuantitativeDataDialogComposite extends Composite {
- private Map<StatisticalMeasure, List<Text>> textFieldMap = new HashMap<>();
- QuantitativeData editorValue;
+ private Map<TermDto, List<Text>> textFieldMap = new HashMap<>();
+ QuantitativeDataDto editorValue;
Combo unitCombo;
- Map<MeasurementUnit, Integer> unitMap = null;
+ Map<TermDto, Integer> unitMap = null;
- public QuantitativeDataDialogComposite(Character initialInput, QuantitativeData editorVal, Composite parent, int style) {
+ public QuantitativeDataDialogComposite(Character initialInput, QuantitativeDataDto editorVal, Composite parent, int style) {
super(parent, style);
this.editorValue = editorVal;
- if (editorValue.getFeature().getRecommendedMeasurementUnits() != null && editorValue.getFeature().getRecommendedMeasurementUnits().size()>0){
+ if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size()>0){
unitMap = new HashMap<>();
Integer i = 0;
- for (MeasurementUnit unit: editorValue.getFeature().getRecommendedMeasurementUnits()){
+ for (TermDto unit: editorValue.getFeatureDto().getRecommendedMeasurementUnits()){
unitMap.put(unit, i);
i++;
}
Label lblNewLabel = new Label(composite_2, SWT.NONE);
lblNewLabel.setText("Measurement Unit");
lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- if (editorValue.getFeature().getRecommendedMeasurementUnits() != null && editorValue.getFeature().getRecommendedMeasurementUnits().size() == 1){
+ if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() == 1){
Label lblUnit = new Label(composite_2, SWT.BORDER);
- lblUnit.setText(editorValue.getFeature().getRecommendedMeasurementUnits().iterator().next().getLabel());
+ lblUnit.setText(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next().getIdInVocabulary());
lblUnit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- editorValue.setUnit(editorValue.getFeature().getRecommendedMeasurementUnits().iterator().next());
- }else if (editorValue.getFeature().getRecommendedMeasurementUnits() != null && editorValue.getFeature().getRecommendedMeasurementUnits().size() > 1){
+ editorValue.setMeasurementUnit(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next());
+ }else if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() > 1){
unitCombo = new Combo(composite_2, SWT.NONE | SWT.READ_ONLY);
unitCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- for (Entry<MeasurementUnit, Integer> unit: unitMap.entrySet()){
+ for (Entry<TermDto, Integer> unit: unitMap.entrySet()){
unitCombo.add(unit.getKey().getTitleCache(), unit.getValue());
unitCombo.setData(unit.getKey().getTitleCache(), unit.getKey());
}
- if (editorValue.getUnit()!= null){
- unitCombo.select(unitMap.get(editorValue.getUnit()));
+ if (editorValue.getMeasurementUnit()!= null){
+ unitCombo.select(unitMap.get(editorValue.getMeasurementUnit()));
}
unitCombo.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
String name = unitCombo.getText();
- editorValue.setUnit((MeasurementUnit)unitCombo.getData(name));
+ editorValue.setMeasurementUnit((TermDto)unitCombo.getData(name));
}
});
}
//add empty text field for exact value
- Text emptyTextField = addText(valuesComposite, StatisticalMeasure.EXACT_VALUE(), initialInput==null?null:initialInput.toString());
+ Text emptyTextField = addText(valuesComposite, TermDto.fromTerm(StatisticalMeasure.EXACT_VALUE()), initialInput==null?null:initialInput.toString());
emptyTextField.setFocus();
emptyTextField.setSelection(emptyTextField.getText().length());
//add existing exact values
- editorValue.getStatisticalValues().stream()
- .filter(measure->measure.getType().equals(StatisticalMeasure.EXACT_VALUE()))
+ editorValue.getValues().stream()
+ .filter(measure->measure.getType().getUuid().equals(StatisticalMeasure.EXACT_VALUE().getUuid()))
.forEach(exact->addText(valuesComposite, exact.getType(), exact.getValue().toString()));
//add aggregation values
- editorValue.getFeature().getRecommendedStatisticalMeasures()
+ editorValue.getFeatureDto().getRecommendedStatisticalMeasures()
.stream()
- .filter(sm->!sm.equals(StatisticalMeasure.EXACT_VALUE()))
+ .filter(sm->!sm.equals(TermDto.fromTerm(StatisticalMeasure.EXACT_VALUE())))
.forEach(measure->{
- BigDecimal specificStatisticalValue = editorValue.getSpecificStatisticalValue(measure);
+ BigDecimal specificStatisticalValue = editorValue.getSpecificStatisticalValue(measure.getUuid());
addText(valuesComposite, measure, specificStatisticalValue!=null?specificStatisticalValue.toString():null);
});
}
}
- private Text addText(Composite valuesComposite, StatisticalMeasure type, String value){
+ private Text addText(Composite valuesComposite, TermDto type, String value){
Composite composite_2 = new Composite(valuesComposite, SWT.NONE);
composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
GridLayout gl_composite_2 = new GridLayout(4, false);
composite_2.setLayout(gl_composite_2);
Label lblNewLabel = new Label(composite_2, SWT.NONE);
- lblNewLabel.setText(type.getLabel());
+ lblNewLabel.setText(type.getTitleCache());
Text text = new Text(composite_2, SWT.BORDER);
.forEach(aggEntry->aggEntry.getValue().forEach(aggText->aggText.setEnabled(enabled)));
}
- public Map<StatisticalMeasure, List<Text>> getTextFields() {
+ public Map<TermDto, List<Text>> getTextFields() {
return textFieldMap;
}
- public QuantitativeData getEditorValue() {
+ public QuantitativeDataDto getEditorValue() {
return editorValue;
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
+import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.QuantitativeData;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
/**
*/
public class QuantitativeDataDialogEditor extends AbstractDialogCellEditor {
- private QuantitativeData editorValue;
+ private QuantitativeDataDto editorValue;
private RowWrapperDTO<?> rowWrapperDTO;
private boolean closed;
private CharacterMatrix matrix;
@Override
public void setEditorValue(Object value) {
- ((QuantitativeDataDialog)this.dialog).setEditorValue((QuantitativeData) value);
+ ((QuantitativeDataDialog)this.dialog).setEditorValue((QuantitativeDataDto) value);
((QuantitativeDataDialog)this.dialog).setRowWrapper(rowWrapperDTO);
- this.editorValue = (QuantitativeData) value;
+ this.editorValue = (QuantitativeDataDto) value;
}
@Override
ICellEditHandler editHandler, ILayerCell cell, IConfigRegistry configRegistry) {
this.initialInput = null;
Object rowObject = matrix.getBodyDataProvider().getRowObject(cell.getRowIndex());
- Feature feature = matrix.getIndexToFeatureMap().get(cell.getColumnIndex());
- QuantitativeData quantitativeData = null;
+ FeatureDto feature = matrix.getIndexToFeatureMap().get(cell.getColumnIndex());
+ QuantitativeDataDto quantitativeData = null;
if(rowObject instanceof RowWrapperDTO){
rowWrapperDTO = (RowWrapperDTO<?>) rowObject;
- DescriptionElementBase dataValueForFeature = rowWrapperDTO.getDataValueForFeature(feature);
- if(dataValueForFeature instanceof QuantitativeData){
- quantitativeData = (QuantitativeData) dataValueForFeature;
+ DescriptionElementDto dataValueForFeature = rowWrapperDTO.getDataValueForFeature(feature.getUuid());
+ if(dataValueForFeature instanceof QuantitativeDataDto){
+ quantitativeData = (QuantitativeDataDto) dataValueForFeature;
}
//create new Quantitative Data
if (quantitativeData == null) {
import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
-import eu.etaxonomy.cdm.model.description.QuantitativeData;
+import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
/**
* Converts QuantitativeData of one cell of the character matrix to a String.
@Override
public Object canonicalToDisplayValue(Object canonicalValue) {
- if(canonicalValue instanceof QuantitativeData){
+ if(canonicalValue instanceof QuantitativeDataDto){
return canonicalValue;
}
if(canonicalValue!=null){
else if(HibernateProxyHelper.isInstanceOf(canonicalValue, NamedArea.class)){
displayValue = HibernateProxyHelper.deproxy(canonicalValue, NamedArea.class).getLabel();
}else if (canonicalValue instanceof RowWrapperDTO){
- displayValue = ((RowWrapperDTO)canonicalValue).getDescription().getDescription().getTitleCache();
+ displayValue = ((RowWrapperDTO)canonicalValue).getDescription().getTitleCache();
}else if (canonicalValue instanceof DescriptionBaseDto){
- displayValue = ((DescriptionBaseDto)canonicalValue).getDescription().getTitleCache();
+ displayValue = ((DescriptionBaseDto)canonicalValue).getTitleCache();
}
if(displayValue.isEmpty() && canonicalValue!=null){
import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.MeasurementUnit;
-import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
import eu.etaxonomy.taxeditor.editor.definedterm.e4.DefinedTermEditorE4;
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
FeatureDto featureDto = null;
if (term instanceof Feature){
Feature feature = (Feature)term;
- Set<TermVocabularyDto> supportedCategoricalEnumerations = new HashSet<>();
- if (feature.getSupportedCategoricalEnumerations()!= null && !feature.getSupportedCategoricalEnumerations().isEmpty()){
- for (TermVocabulary voc: feature.getSupportedCategoricalEnumerations()){
- supportedCategoricalEnumerations.add(TermVocabularyDto.fromVocabulary(voc));
- }
- }
- Set<TermVocabularyDto> recommendedModifierEnumerations = new HashSet<>();
- if (feature.getRecommendedModifierEnumeration()!= null && !feature.getRecommendedModifierEnumeration().isEmpty()){
- for (TermVocabulary voc: feature.getRecommendedModifierEnumeration()){
- recommendedModifierEnumerations.add(TermVocabularyDto.fromVocabulary(voc));
- }
- }
- Set<TermDto> recommendedMeasurementUnits = new HashSet<>();
- if (feature.getRecommendedMeasurementUnits()!= null && !feature.getRecommendedMeasurementUnits().isEmpty()){
- for (MeasurementUnit unit: feature.getRecommendedMeasurementUnits()){
- recommendedMeasurementUnits.add(TermDto.fromTerm(unit));
- }
- }
- Set<TermDto> recommendedStatisticalMeasures = new HashSet<>();
- if (feature.getRecommendedStatisticalMeasures()!= null && !feature.getRecommendedStatisticalMeasures().isEmpty()){
- for (StatisticalMeasure measures: feature.getRecommendedStatisticalMeasures()){
- recommendedStatisticalMeasures.add(TermDto.fromTerm(measures));
- }
- }
-
-
- featureDto = new FeatureDto(term.getUuid(), term.getRepresentations(), term.getPartOf() != null? term.getPartOf().getUuid(): null, term.getKindOf() != null? term.getKindOf().getUuid(): null,
- term.getVocabulary()!= null? term.getVocabulary().getUuid(): null, null, term.getIdInVocabulary(), term.getVocabulary()!= null?term.getVocabulary().getRepresentations(): null, feature.isAvailableForTaxon(),
- feature.isAvailableForTaxonName(),feature.isAvailableForOccurrence(), feature.getTitleCache(), feature.isSupportsCategoricalData(), feature.isSupportsQuantitativeData(),
- supportedCategoricalEnumerations, recommendedModifierEnumerations, recommendedMeasurementUnits, recommendedStatisticalMeasures);
-// featureDto = FeatureDto.fromFeature(feature);
-
+ featureDto = FeatureDto.fromFeature(feature);
}else{
dto = TermDto.fromTerm(term);
}
*/
public CdmCheckBoxTreeViewer(Tree tree) {
super(tree);
- // TODO Auto-generated constructor stub
}
@Override
isUseDescription = true;
}
}
- if (((DescriptionElementBase)input).getInDescription().isComputed() && PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+ if (((DescriptionElementBase)input).getInDescription() != null && ((DescriptionElementBase)input).getInDescription().isComputed() && PreferencesUtil.isComputedDesciptionHandlingDisabled()){
this.setDetailsEnabled(false);
}
if (isUseDescription == true && input instanceof CategoricalData) {