command.label.48 = Datasource\r
command.label.49 = Misapplication\r
command.label.50 = Use Existing Image\r
+command.label.60 = Pro Parte Synonym\r
command.name.36 = Create Misapplication\r
+command.name.60 = Create Pro Parte Synonym\r
command.name.37 = Use Existing Image\r
command.name.38 = Open Distribution Editor\r
command.name.39 = New Datasource\r
command.label.47 = Referenz
command.label.48 = Datenquelle
command.label.49 = Misapplication
+command.label.60 = Pro Parte Synonym
command.label.50 = Benutze vorhandenes Bild
command.name.36 = Erstelle Misapplication
+command.name.60 = Erstelle Pro Parte Synonym
command.name.37 = Benutze vorhandenes Bild
command.name.38 = \u00d6ffne Verbreitungs-Editor
command.name.39 = Neue Datenquelle
<handlers xmi:id="_WWqoMIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4" command="_UFDx8IvQEee7R4eqeQiXZg"/>
<handlers xmi:id="_edkd4IvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandlerE4" command="_b2nCsIvQEee7R4eqeQiXZg"/>
<handlers xmi:id="_lv9GYIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandlerE4" command="_jNvBQIvQEee7R4eqeQiXZg"/>
+ <handlers xmi:id="_g8QScFgWEeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4" command="_HSKdYFgXEeiQk_eTMvMviQ"/>
<menus xsi:type="menu:PopupMenu" xmi:id="_tLceQYl4Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.nameeditor">
<children xsi:type="menu:Menu" xmi:id="_R6buoIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menu.new" label="%menu.label">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_X1lWsEoREeiEhr9v9h_MoA" coreExpressionId="isNotMisapplication"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_MCsX0Il8Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.newMisapplication" label="%command.label.49" command="_c0byUIvPEee7R4eqeQiXZg">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_G1zjMEoOEeiEhr9v9h_MoA" coreExpressionId="isAcceptedTaxon"/>
</children>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_2S-_cFgWEeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.newProParteSynonym" label="%command.label.60" command="_HSKdYFgXEeiQk_eTMvMviQ">
+ <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_9tgQQFgWEeiQk_eTMvMviQ" coreExpressionId="isAcceptedTaxon"/>
+ </children>
</children>
<children xsi:type="menu:MenuSeparator" xmi:id="_bxjbgE3LEeiplYSgvvNXRQ" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.23"/>
<children xsi:type="menu:DynamicMenuContribution" xmi:id="_drYq8E3LEeiplYSgvvNXRQ" elementId="eu.etaxonomy.taxeditor.editor.dynamicmenucontribution.nameEditor.openInCdmViewer" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.CdmViewerContextMenuE4"/>
<elements xsi:type="commands:Command" xmi:id="_j2cfsJMmEeeR4YRjNqCKeA" elementId="eu.etaxonomy.taxeditor.editor.openSpecimenEditorForIndividualsAssociation" commandName="%command.name.OPEN_DERIVATIVE_EDITOR"/>
<elements xsi:type="commands:Command" xmi:id="_0DKb4E3kEeivZbtHG8C6kA" elementId="eu.etaxonomy.taxeditor.editor.openSpecimenEditorForSpecimenOrObservation" commandName="%command.name.OPEN_DERIVATIVE_EDITOR"/>
<elements xsi:type="commands:Command" xmi:id="_c3wW8FeBEeiJAP3GTkE0aQ" elementId="eu.etaxonomy.taxeditor.editor.command.descriptivedataseteditor.removeTaxon" commandName="%command.commandname.21"/>
+ <elements xsi:type="commands:Command" xmi:id="_HSKdYFgXEeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.createProParteSynonym" commandName="%command.name.60"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_pZmusEalEeeXMc6kSYO7Xg" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.navigation">
<elements xsi:type="menu:HandledMenuItem" xmi:id="_FPIHQKNwEeebGZ23ERGMGw" elementId="eu.etaxonomy.taxeditor.editor.showViewMenu.conceptGraph" label="%view.name.3" iconURI="" tooltip="%view.name.3" command="_WPjpoDSnEeek0dKsFNy--Q">
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_CREATEHETEROTYPICSYNONYMHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHeterotypicSynonymHandlerE4";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_CREATEHOMOTYPICSYNONYMHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHomotypicSynonymHandlerE4";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_CREATEMISAPPLICATIONHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateMisapplicationHandlerE4";
+ public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_CREATEPROPARTESYNONYMHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_CREATESYNONYMINHOMOTYPICALGROUPHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateSynonymInHomotypicalGroupHandlerE4";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_DELETEALLEMPTYNAMESHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteAllEmptyNamesHandlerE4";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_HANDLER_DELETETAXONBASEHANDLERE4 = "eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteTaxonBaseHandlerE4";
* @date Aug 24, 2017
*
*/
-public class MisapplicationContainerE4 extends AbstractGroupedContainerE4<Taxon> {
- TaxonRelationship misapplication;
+public class ConceptContainerE4 extends AbstractGroupedContainerE4<Taxon> {
+ TaxonRelationship relationship;
+ private boolean isMisapplication;
- public MisapplicationContainerE4(AbstractGroupE4 group, Taxon misappliedName) {
+ public ConceptContainerE4(AbstractGroupE4 group, Taxon misappliedName, boolean isMisapplication) {
super(group, misappliedName);
+ this.isMisapplication = isMisapplication;
}
TaxonNameEditorE4 editor = getEditor();
Taxon taxon = editor.getTaxon();
for (TaxonRelationship rel: taxon.getTaxonRelations(getMisappliedName())){
- if (rel.getType().isAnyMisappliedName()){
- misapplication = rel;
+ if (rel.getType().isAnyMisappliedName() && isMisapplication){
+ relationship = rel;
break;
+ }else if (rel.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR()) && !isMisapplication){
+ relationship = rel;
+ break;
}
}
showSec();
@Override
protected void updateIcon() {
- setIcon(MISAPPLIEDNAME_ICON);
+ if (isMisapplication){
+ setIcon(MISAPPLIEDNAME_ICON);
+ }else{
+ setIcon(CONCEPT_ICON);
+ }
}
private void showSec() {
}
String title = "";
String author = "";
- TaxonName misappliedNameName = HibernateProxyHelper.deproxy(getMisappliedName().getName());
- if (StringUtils.isNotBlank(misappliedNameName.getAuthorshipCache())){
- author = ", non " + misappliedNameName.getAuthorshipCache();
+ TaxonName conceptName = HibernateProxyHelper.deproxy(getMisappliedName().getName());
+ if (isMisapplication && StringUtils.isNotBlank(conceptName.getAuthorshipCache())){
+ author = ", non " + conceptName.getAuthorshipCache();
+ }else if (!isMisapplication && StringUtils.isNotBlank(conceptName.getAuthorshipCache())){
+ author = conceptName.getAuthorshipCache();
}
if (getMisappliedName().getSec() == null) {
if (getMisappliedName().getAppendedPhrase() != null ){
title = getMisappliedName().getAppendedPhrase();
- }else{
+ }else if (isMisapplication){
title = "auct.";
}
title += sec + getMisappliedName().getSec().getCacheStrategy().getCitation(getMisappliedName().getSec());
}
- if (misapplication.getType().equals(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR()) ){
+ if (relationship.getType().equals(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR()) || relationship.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR())){
title += " p.p. ";
}
title += author;
@Override
protected void createContainers() {
for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames(true)){
- MisapplicationContainerE4 container = new MisapplicationContainerE4(this, misapplication);
+
+ ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, true);
this.add(container);
container.createContent();
}
+ for(Taxon misapplication : getEditor().getTaxon().getProParteSynonyms()){
+ ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, false);
+ this.add(container);
+ container.createContent();
+ }
}
@Override
private boolean redrawNeeded() {
Set<Taxon> misapplications = getEditor().getTaxon().getMisappliedNames(true);
+ misapplications.addAll(getEditor().getTaxon().getProParteSynonyms());
Set<Taxon> presentMisapplication = new HashSet<Taxon>();
--- /dev/null
+/**
+* Copyright (C) 2018 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.name.e4.handler;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
+import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.parser.ParseHandler;
+
+/**
+ * @author k.luther
+ * @since 15.05.2018
+ *
+ */
+public class CreateProParteSynonymHandlerE4 {
+
+
+ @Execute
+ public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
+ MHandledMenuItem menuItem,
+ UISynchronize sync) {
+
+ TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+
+ TaxonName conceptName = ParseHandler.createEmptyName();
+ Taxon concept = Taxon.NewInstance(conceptName, null);
+
+ TaxonRelationshipType type = TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR();
+
+ AbstractPostOperation<?> operation;
+ operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(),
+ editor.getUndoContext(), editor.getTaxon(), concept, type, editor);
+ AbstractUtility.executeOperation(operation, sync);
+ }
+
+
+ @CanExecute
+ public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+ MHandledMenuItem menuItem){
+ boolean canExecute = false;
+ Object selectedElement = selection.getFirstElement();
+ canExecute = NameEditorMenuPropertyTester.isAccepted(selectedElement)
+ && !NameEditorMenuPropertyTester.isProParteSynonym(selectedElement);
+ return canExecute;
+ }
+
+
+}
}
return false;
}
+
+ /**
+ * @param selectedElement
+ * @return
+ */
+ public static boolean isProParteSynonym(Object selectedElement) {
+ if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isMisapplication()){
+ return true;
+ }
+ return false;
+ }
}
Collection<DescriptionElementBase> descriptionElements = new ArrayList<DescriptionElementBase>();
boolean isCopy = getCurrentOperation() == DND.DROP_COPY ? true : false;
-
+ DescriptionBase<?> description = null;
// cannot drop a feature node onto itself
if (droppedElements != null){
for (Object droppedElement : droppedElements) {
if (descriptionElement.getInDescription().equals(target)) {
return false;
}
- DescriptionBase<?> description = descriptionElement.getInDescription();
+ description = descriptionElement.getInDescription();
description.removeElement(descriptionElement);
target.addElement(descriptionElement);
TaxonNameEditorE4 editor = null;
Object activePart = EditorUtil.getActivePart();
if (activePart instanceof FactualDataPartE4){
- MPart selectionProvidingPart =(MPart) ((FactualDataPartE4)activePart).getSelectionProvidingPart();
+ MPart selectionProvidingPart =((FactualDataPartE4)activePart).getSelectionProvidingPart();
Object obj = selectionProvidingPart.getObject();
if (obj instanceof TaxonNameEditorE4){
editor = (TaxonNameEditorE4) obj;
}
}
- AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(Messages.DescriptionElementDropAdapter_MOVE_DESC, EditorUtil.getUndoContext(), target, descriptionElements, isCopy, null, sync);
+ AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(Messages.DescriptionElementDropAdapter_MOVE_DESC, EditorUtil.getUndoContext(), target, description, descriptionElements, isCopy, null, sync);
editor.getEditorInput().addOperation(operation);
editor.setDirty();
private Collection<DescriptionElementBase> descriptionElements;
private DescriptionBase targetDescription;
+ private DescriptionBase sourceDescription;
private IDescriptionService service;
private UUID targetTaxonUuid;
+
private String moveMessage;
private boolean isCopy;
private UISynchronize sync;
* @param postOperationEnabled
*/
public MoveDescriptionElementsOperation(String label,
- IUndoContext undoContext, DescriptionBase targetDescription,
+ IUndoContext undoContext, DescriptionBase targetDescription, DescriptionBase sourceDescription,
Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
IPostOperationEnabled postOperationEnabled, UISynchronize sync) {
super(label, undoContext, postOperationEnabled);
this.targetDescription = targetDescription;
+ this.sourceDescription = sourceDescription;
this.descriptionElements = descriptionElements;
this.isCopy = isCopy;
this.sync = sync;
}
public MoveDescriptionElementsOperation(String label,
- IUndoContext undoContext, UUID targetTaxonUuid,String moveMessage,
+ IUndoContext undoContext, UUID targetTaxonUuid, String moveMessage,
Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
IPostOperationEnabled postOperationEnabled, UISynchronize sync) {
super(label, undoContext, postOperationEnabled);
} else {
UUID targetDescriptionUuid = targetDescription.getUuid();
+ UUID sourceDescriptionUuid = sourceDescription.getUuid();
result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetDescriptionUuid, isCopy);
}