import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.services.EMenuService;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.ITermService;
-import eu.etaxonomy.cdm.model.description.Character;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
+import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.name.Rank;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
-import eu.etaxonomy.cdm.model.term.FeatureTree;
+import eu.etaxonomy.cdm.model.term.TermTree;
import eu.etaxonomy.cdm.model.term.TermType;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.IDescriptiveDataSetEditor;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
*
*/
public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEnabled, ICdmEntitySessionEnabled,
-IPartContentHasDetails, IPartContentHasSupplementalData, IDirtyMarkable {
+IPartContentHasDetails, IPartContentHasSupplementalData, IDirtyMarkable, IDescriptiveDataSetEditor {
private DescriptiveDataSetComposite composite;
@Inject
private MDirtyable dirty;
+ @Inject
+ private MPart thisPart;
+
@Inject
private ESelectionService selectionService;
@Override
public void modifyText(ModifyEvent e) {
descriptiveDataSet.setLabel(composite.getTxt_label().getText());
+ EventUtility.postSyncEvent(WorkbenchEventConstants.REFRESH_DATASET_NAVIGATOR, descriptiveDataSet);
dirty.setDirty(true);
}
};
}
});
selectionService.setSelection(new StructuredSelection(descriptiveDataSet));
+ thisPart.setLabel(descriptiveDataSet.getLabel());
}
public void addTaxonNode(TaxonNodeDto taxonNodeDto){
}
}
}
- FeatureTree<Character> characters = composite.getCharacters();
+ TermTree<Feature> characters = composite.getCharacters();
if(characters!=null){
//save characters because they can be modified in this editor
- characters.getDistinctFeatures().forEach(character->CdmStore.getService(ITermService.class).merge(character,true));
+ characters.getDistinctTerms().forEach(character->CdmStore.getService(ITermService.class).merge(character,true));
}
conversation.commit();
CdmStore.getService(IDescriptiveDataSetService.class).merge(descriptiveDataSet, true);
-
+ //event for updatin matrix
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DESCRIPTIVE_DATASET, descriptiveDataSet.getUuid());
dirty.setDirty(false);
}
cdmEntitySession = null;
}
dirty.setDirty(false);
+ selectionService.setSelection(null);
}
@Focus