From: Katja Luther Date: Tue, 19 Jul 2016 10:22:27 +0000 (+0200) Subject: translate some commands X-Git-Tag: 4.3.0^2~120 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/df601566fa0088ca7dca67e3fbc580ede9b0fbef translate some commands --- diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties index 486622a6c..e3f0fba1c 100644 --- a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties +++ b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties @@ -153,6 +153,9 @@ command.name.43 = Create Field Unit command.name.44 = Deep Delete command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon command.label.56 = Move Synonym (Homotypical Group) to another Accepted Taxon +command.name.57 = Set as Basionym of Homotypical Group +command.label.57 = Set as Basionym of Homotypical Group + markerContentGenerator.name = Validation Problems Marker Generator command.name.45 = Delete command.name.47 = Delete diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties index 01c978e1a..8c3d36882 100644 --- a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties +++ b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties @@ -26,7 +26,7 @@ command.label.5 = Medien command.label.6 = Konzeptrelationen command.label.7 = Konzeptgraph command.label.8 = \u00d6ffne Parent -menu.label = Neue +menu.label = Neu command.label.9 = Heterotypisches Synonym command.label.10 = Homotypisches Synonym command.label.11 = Synonym in Homotypischer Gruppe @@ -68,6 +68,7 @@ menu.label.3 = Neue command.label.43 = \u00d6ffne verbundenes Konzept command.label.44 = L\u00f6schen command.label.45 = Bearbeite Rechte +command.label.57 = Setze als Basionym der homotypischen Gruppe extension.name = Namensbefehle category.name.0 = -- Namenseditor command.name = \u00d6ffne Elter @@ -162,6 +163,7 @@ command.name.48 = L\u00f6schen command.name.49 = L\u00f6schen command.name.50 = L\u00f6schen command.name.51 = L\u00f6schen +command.name.57 = Setze als Basionym editor.name.DERIVATIVE_EDITOR = Specimen-Editor command.label.DERIVATIVE_EDITOR = Specimen-Editor diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml index 83c8015b8..ff2957452 100644 --- a/eu.etaxonomy.taxeditor.editor/plugin.xml +++ b/eu.etaxonomy.taxeditor.editor/plugin.xml @@ -610,6 +610,16 @@ definitionId="isSynonym"> + + + + + + + + + + + + + + @@ -1909,7 +1934,7 @@ class="eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester" id="eu.etaxonomy.taxeditor.editor.name.propertyTester" namespace="eu.etaxonomy.taxeditor.editor.name.propertyTester" - properties="isAcceptedTaxon,isSynonym,isMisapplication,isTaxonBase,hasEmptyNames,isAcceptedAndHasNoHomotypicSynonyms,isNotHomotypicSynonymOfAcceptedTaxon" + properties="isAcceptedTaxon,isSynonym,isMisapplication,isTaxonBase,hasEmptyNames,isAcceptedAndHasNoHomotypicSynonyms,isNotHomotypicSynonymOfAcceptedTaxon,isSynonymInHomotypicalGroupWithMoreSynonyms" type="org.eclipse.jface.viewers.IStructuredSelection"> GroupBasionymContributionItem class.

- * - * @author p.ciardelli - * @version $Id: $ - */ -public class GroupBasionymContributionItem extends CompoundContributionItem { - @SuppressWarnings("unused") - private static final Logger logger = Logger.getLogger(GroupBasionymContributionItem.class); - - /** - *

Constructor for GroupBasionymContributionItem.

- */ - public GroupBasionymContributionItem() {} - - /** - *

Constructor for GroupBasionymContributionItem.

- * - * @param id a {@link java.lang.String} object. - */ - public GroupBasionymContributionItem(String id) { - super(id); - } - - - /** {@inheritDoc} */ - @Override - protected IContributionItem[] getContributionItems() { - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - ISelectionService selectionService = window.getSelectionService(); - - ISelection selection = selectionService.getSelection(); - - if(selection instanceof IStructuredSelection){ - Object selectedObject = ((IStructuredSelection) selection).getFirstElement(); - - if(selectedObject != null && selectedObject instanceof TaxonBase){ - - TaxonNameBase name = (TaxonNameBase) HibernateProxyHelper.deproxy(((TaxonBase) selectedObject).getName()); - - if(name != null && name.getHomotypicalGroup().getTypifiedNames().size() > 1){ - - CommandContributionItemParameter parameter = - new CommandContributionItemParameter( - window, null, getCommand(name), SWT.NONE); - - parameter.label = getLabel(name); - - return new IContributionItem[] { - new CommandContributionItem(parameter) - }; - } - - } - } - - return new IContributionItem[]{}; - } - - /** - * @param name - * @return - */ - private String getCommand(TaxonNameBase name) { - if(name.isGroupsBasionym()){ - return "eu.etaxonomy.taxeditor.editor.name.removeBasionym" ; - } - return "eu.etaxonomy.taxeditor.editor.name.setBasionym"; - } - - /** - * @param name - * @return - */ - private String getLabel(TaxonNameBase name) { - ILabelImageStrategy strategy = LabelImageProvider.getLabelStrategy(name); - LabelImageProvider labelProvider = new LabelImageProvider(strategy); - return (name.isGroupsBasionym() ? "Remove" : "Set") - + " as " + labelProvider.getNameRelationTypeDescription(NameRelationshipType.BASIONYM()) + " for Homotypic Group"; - } -} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java index 856934698..f8a49eb01 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java @@ -36,7 +36,7 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P private static final String EMPTY_NAMES = "hasEmptyNames"; private static final String ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS = "isAcceptedAndHasNoHomotypicSynonyms"; private static final String NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isNotHomotypicSynonymOfAcceptedTaxon"; - + private static final String SYNONYM_WITH_HOMOTYPIC_SYNONYMS = "isSynonymInHomotypicalGroupWithMoreSynonyms"; /** *

Constructor for NameEditorMenuPropertyTester.

@@ -78,9 +78,13 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P } else if(ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS.equals(property)){ return isAcceptedAndHasNoHomotypicSynonyms(selectedElement); - }else if (NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){ + } + else if (NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){ return isNotHomotypicSynonymOfAcceptedTaxon(selectedElement); } + else if (SYNONYM_WITH_HOMOTYPIC_SYNONYMS.equals(property)){ + return isSynonymInHomotypicalGroupWithMoreSynonyms(selectedElement); + } } @@ -95,6 +99,15 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P } return false; } + + private boolean isSynonymInHomotypicalGroupWithMoreSynonyms(Object selectedElement) { + if (isSynonym(selectedElement)){ + Synonym synonym = (Synonym) selectedElement; + return synonym.getHomotypicGroup().getTypifiedNames().size()>1; + } + return false; + } + private boolean isNotHomotypicSynonymOfAcceptedTaxon(Object selectedElement) { if (isSynonym(selectedElement)){