Fix Ticket #4729
authorAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 28 Apr 2015 14:19:55 +0000 (14:19 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 28 Apr 2015 14:19:55 +0000 (14:19 +0000)
.gitattributes
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/FixClassificationHierarchyHandler.java [deleted file]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/FixClassificationHierarchyHandler.java [new file with mode: 0644]

index 894042f..5c28b56 100644 (file)
@@ -391,7 +391,6 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
-eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/FixClassificationHierarchyHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
@@ -981,6 +980,7 @@ eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigatio
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/FixClassificationHierarchyHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveFactualDataHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveTaxonHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/NewClassificationHandler.java -text
index 9065d12..7e5c3e3 100644 (file)
@@ -152,6 +152,5 @@ command.name.41 = Show Only Individual Associations
 command.name.42 = Open Taxon Editor\r
 command.name.43 = Create Field Unit\r
 command.name.44 = Deep Delete\r
-command.name.45 = Fix Classification Hierarchy\r
 command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
 command.label.56 = Move Synonym (Homotypical Group) to another Accepted Taxon
\ No newline at end of file
index 3bb28d9..e46102d 100644 (file)
@@ -139,19 +139,18 @@ marker.field.2 = Attribut
 marker.field.3 = Problematischer Wert
 marker.field.4 = Problembeschreibung
 marker.field.5 = Validierer
-marker.field.6 = Entitätsklasse
-marker.field.7 = Entitäts ID
+marker.field.6 = Entittsklasse
+marker.field.7 = Entitts ID
 extension.name.0 = Validierungs-Fehler
 command.label.51 = \u00d6ffne Specimen-Editor
 command.label.52 = L\u00f6schen
 command.label.53 = Neue Field Unit
 command.label.54 = L\u00f6schen (mit Kindern)
 command.tooltip = Nur Individuals Associations anzeigen
-command.label.55 = \u00d6ffne zugehörige Specimens
+command.label.55 = \u00d6ffne zugehrige Specimens
 command.name.41 = Nur Individuals Associations anzeigen
 command.name.42 = \u00d6ffne Taxon Editor
 command.name.43 = Neue Field Unit
 command.name.44 = L\u00f6schen (mit Kindern)
-command.name.45 = Erzeuge Taxon-Hierarchie
 command.name.46 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
 command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
\ No newline at end of file
index f815f77..98e9b29 100644 (file)
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
       </handler>
-      <handler
-            class="eu.etaxonomy.taxeditor.editor.handler.FixClassificationHierarchyHandler"
-            commandId="eu.etaxonomy.taxeditor.editor.handler.FixClassificationHierarchyHandler">
-      </handler>
    </extension>
    <extension
          name="%extension.name"
             id="eu.etaxonomy.taxeditor.editor.derivate.deepDelete"
             name="%command.name.44">
       </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.FixClassificationHierarchyHandler"
-            id="eu.etaxonomy.taxeditor.editor.handler.OpenFixClassificationHierarchyHandler"
-            name="%command.name.45">
-      </command>
    </extension>
    <extension
          point="org.eclipse.core.expressions.definitions">
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/FixClassificationHierarchyHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/FixClassificationHierarchyHandler.java
deleted file mode 100644 (file)
index aeff573..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.handler;
-
-import org.apache.log4j.Logger;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.api.service.IClassificationService;
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-public class FixClassificationHierarchyHandler extends AbstractHandler {
-
-    private static final Logger logger = Logger.getLogger(FixClassificationHierarchyHandler.class);
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
-     * ExecutionEvent)
-     */
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        boolean isChecklistEditorActivated = PreferencesUtil.getPreferenceStore().getBoolean(
-                IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
-        if (isChecklistEditorActivated) {
-            ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-            if (currentSelection instanceof IStructuredSelection) {
-                Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
-                if (selectedElement instanceof Classification) {
-
-                    Classification classification = (Classification) selectedElement;
-                    try {
-                        IClassificationService service = CdmStore.getService(IClassificationService.class);
-
-                        // Map<String, List<TaxonNode>> sortedGenusList =
-                        // service.getSortedGenusList(classification.getAllNodes());
-
-                        Classification newClassification = service.createHierarchyInClassification(classification, null);
-
-                        MessagingUtils.messageDialog("Fix Hierarchy successful",
-                                FixClassificationHierarchyHandler.class, "Operation 'Fix Hierarchy' was successful. New classification is " + newClassification.getTitleCache());
-
-                    } catch (Exception e) {
-                        MessagingUtils.messageDialog("Failed to open Editor", FixClassificationHierarchyHandler.class,
-                                "Could not open ChecklistView. The hierarchy is corrupted!", e);
-                    }
-                }
-            }
-        }
-        return null;
-    }
-}
index e723afb..27da5fe 100644 (file)
@@ -25,6 +25,7 @@ menu.label.0 = Refresh
 command.label.17 = List\r
 command.label.18 = Key Nodes\r
 command.label.19 = Delete\r
+command.label.fixClassificationHierarchy = Create taxon hierarchy\r
 command.name = New Taxon Node\r
 command.name.0 = New classification\r
 command.name.1 = Edit\r
@@ -36,10 +37,11 @@ command.name.6 = New Polytomous Key
 command.name.7 = Edit Polytomous Key nodes\r
 command.name.8 = Refresh Polytomous Key list\r
 command.name.9 = Refresh Polytomous Key nodes\r
+command.name.10 = Fix Classification Hierarchy\r
+\r
 view.name.2 = Taxonomic Tree\r
 navigatorContent.name = Classification\r
 navigatorContent.name.0 = TaxonNode\r
 navigatorContent.name.1 = Synonyms (experimental)\r
-command.label.fixClassificationHierarchy = Create taxon hierarchy\r
 command.label.moveFactualData = Move factual data to another taxon\r
 command.name.moveFactualData = Move factual data
\ No newline at end of file
index a023560..12b1f13 100644 (file)
@@ -21,9 +21,11 @@ command.label.13 = Taxon
 command.label.14 = Klassifikation\r
 command.label.15 = Neu\r
 command.label.16 = Bearbeiten\r
+command.label.fixClassificationHierarchy = Erzeuge Taxon-Hierarchie\r
+\r
 menu.label.0 = Aktualisieren\r
 command.label.17 = Liste\r
-command.label.18 = Schlüsselknoten\r
+command.label.18 = Schlsselknoten\r
 command.label.19 = L\u00F6schen\r
 command.name = Neuer Taxonknoten\r
 command.name.0 = Neue Klassifikation\r
@@ -32,14 +34,14 @@ command.name.2 = Verschiebe Taxon
 command.name.3 = Aktualisieren\r
 command.name.4 = Kopieren\r
 command.name.5 = Verschiebe akzeptiertes Taxon in Synonymie\r
-command.name.6 = Neuer Polytomer Schlüssel\r
-command.name.7 = Bearbeite Schlüssel-Knoten\r
-command.name.8 = Aktualisiere Schlüssel-Liste\r
-command.name.9 = Aktualisiere Schlüssel-Knoten\r
+command.name.6 = Neuer Polytomer Schl�ssel\r
+command.name.7 = Bearbeite Schl�ssel-Knoten\r
+command.name.8 = Aktualisiere Schl�ssel-Liste\r
+command.name.9 = Aktualisiere Schl�ssel-Knoten\r
+command.name.10 = Erzeuge Taxon-Hierarchie\r
 view.name.2 = Taxonomiebaum\r
 navigatorContent.name = Klassifikation\r
 navigatorContent.name.0 = Taxonknoten\r
 navigatorContent.name.1 = Synonyme (experimentell)\r
-command.label.fixClassificationHierarchy = Erzeuge Taxon-Hierarchie\r
 command.label.moveFactualData = Verschiebe Faktendaten zu Taxon\r
 command.name.moveFactualData = Verschiebe Faktendaten
\ No newline at end of file
index 0031fff..39cbba9 100644 (file)
             </visibleWhen>
          </command>
          <command
-               commandId="eu.etaxonomy.taxeditor.editor.handler.OpenFixClassificationHierarchyHandler"
+               commandId="eu.etaxonomy.taxeditor.navigation.navigator.handler.OpenFixClassificationHierarchyHandler"
                label="%command.label.fixClassificationHierarchy"
                style="push">
             <visibleWhen
             id="eu.etaxonomy.taxeditor.navigation.moveFactualData"
             name="%command.name.moveFactualData">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.FixClassificationHierarchyHandler"
+            id="eu.etaxonomy.taxeditor.navigation.navigator.handler.OpenFixClassificationHierarchyHandler"
+            name="%command.name.10">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/FixClassificationHierarchyHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/FixClassificationHierarchyHandler.java
new file mode 100644 (file)
index 0000000..2505dfc
--- /dev/null
@@ -0,0 +1,54 @@
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class FixClassificationHierarchyHandler extends AbstractHandler {
+
+    private static final Logger logger = Logger.getLogger(FixClassificationHierarchyHandler.class);
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+     * ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+        if (currentSelection instanceof IStructuredSelection) {
+            Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+            if (selectedElement instanceof Classification) {
+
+                Classification classification = (Classification) selectedElement;
+                try {
+                    IClassificationService service = CdmStore.getService(IClassificationService.class);
+
+                    // Map<String, List<TaxonNode>> sortedGenusList =
+                    // service.getSortedGenusList(classification.getAllNodes());
+
+                    Classification newClassification = service.createHierarchyInClassification(classification, null);
+
+                    MessagingUtils.messageDialog("Fix Hierarchy successful",
+                            FixClassificationHierarchyHandler.class, "Operation 'Fix Hierarchy' was successful. New classification is " + newClassification.getTitleCache());
+
+                } catch (Exception e) {
+                    MessagingUtils.messageDialog("Failed to open Editor", FixClassificationHierarchyHandler.class,
+                            "Could not open ChecklistView. The hierarchy is corrupted!", e);
+                }
+            }
+        }
+        return null;
+    }
+}