ref #7589 Confirm description deletion in character matrix
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 14 Jan 2019 07:43:45 +0000 (08:43 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 14 Jan 2019 09:41:05 +0000 (10:41 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties

index a1f988c7bbb69d0e9f8e2841ba029021ee7e39a6..2bbe9e748913913779c9905da2e611097512bb30 100644 (file)
@@ -40,6 +40,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -78,7 +79,7 @@ public class CharacterMatrixBottomToolbar extends Composite{
                 if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
                     return;
                 }
-                String error = "";
+                String error = ""; //$NON-NLS-1$
                 SpecimenSelectionDialog dialog = new SpecimenSelectionDialog(matrix.getShell(), matrix);
                 if(dialog.open()==Window.OK){
                     Collection<SpecimenNodeWrapper> wrappers = dialog.getSpecimen();
@@ -101,8 +102,8 @@ public class CharacterMatrixBottomToolbar extends Composite{
                         matrix.getSpecimenCache().remove(wrapper);
                     }
                     if(CdmUtils.isNotBlank(error)){
-                        MessagingUtils.warningDialog("Errors during row creation", this,
-                                String.format("Could not create rows for the following description:\n\n%s", error));
+                        MessagingUtils.warningDialog(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE, this,
+                                String.format(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE, error));
                     }
                 }
             }
@@ -118,6 +119,9 @@ public class CharacterMatrixBottomToolbar extends Composite{
                 if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
                     return;
                 }
+                if(!MessagingUtils.confirmDialog(Messages.CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE, Messages.CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE)){
+                    return;
+                }
                 int[] fullySelectedRowPositions = matrix.getBodyLayer().getSelectionLayer().getFullySelectedRowPositions();
                 List<RowWrapperDTO> toRemove = new ArrayList<>();
                 for (int i : fullySelectedRowPositions) {
@@ -137,7 +141,7 @@ public class CharacterMatrixBottomToolbar extends Composite{
          * Aggregate button
          */
         Button btnAggregate = new Button(this, SWT.PUSH);
-        btnAggregate.setText("Aggregate");
+        btnAggregate.setText(Messages.CharacterMatrixBottomToolbar_AGGREGATE);
         btnAggregate.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
@@ -150,11 +154,9 @@ public class CharacterMatrixBottomToolbar extends Composite{
                 TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
                 UUID taxonUuid = parentDto.getTaxonUuid();
                 int response = MessagingUtils.confirmDialog(
-                        "Choose location for the aggregated description",
-                        String.format("The aggregated description will be stored at "
-                                + "the common parent taxon of this data set:\n%s\n\n"
-                                + "Do you want to use this taxon?"
-                                , parentDto.getTaxonTitleCache()), "Yes", "Choose taxon", "Cancel");
+                        Messages.CharacterMatrixBottomToolbar_AGGREGATION_TITLE,
+                        String.format(Messages.CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE
+                                , parentDto.getTaxonTitleCache()), Messages.CharacterMatrixBottomToolbar_YES, Messages.CharacterMatrixBottomToolbar_CHOOSE_TAXON, Messages.CharacterMatrixBottomToolbar_CANCEL);
                 if(response==2){
                     return;
                 }
index 375faff8b6ddc08a798203e93e465faec5f7efab..a18bdcde7b7fc23b1ed7204a342cc26035e3ea0a 100644 (file)
@@ -60,6 +60,16 @@ public class Messages extends NLS {
     public static String CharacterMatrix_NO_DESCRIPTION_TITLE;
     public static String CharacterMatrix_NO_NODE_FOUND_MESSAGE;
     public static String CharacterMatrix_NO_NODE_FOUND_TITLE;
+    public static String CharacterMatrixBottomToolbar_AGGREGATE;
+    public static String CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE;
+    public static String CharacterMatrixBottomToolbar_AGGREGATION_TITLE;
+    public static String CharacterMatrixBottomToolbar_CANCEL;
+    public static String CharacterMatrixBottomToolbar_CHOOSE_TAXON;
+    public static String CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE;
+    public static String CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE;
+    public static String CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE;
+    public static String CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE;
+    public static String CharacterMatrixBottomToolbar_YES;
     public static String CharacterMatrixPart_COULD_NOT_OPEN;
     public static String CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE;
     public static String CharacterMatrixPart_LOADING_MATRIX;
index 8d4a592eba9bcacdfad8751520e24d2f14cda12c..832c39fbeab8eaa147151fa7b5a0881c7a5e08e0 100644 (file)
@@ -209,6 +209,16 @@ CharacterMatrix_SHOW_FLAT_LIST=Show flat list
 CharacterMatrix_SHOW_HIERARCHY=Show taxon hierarchy
 CharacterMatrix_TAXON=Unit
 CharacterMatrix_VIEW_CONFIG=View configuration
+CharacterMatrixBottomToolbar_AGGREGATE=Aggregate
+CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE=The aggregated description will be stored at the common parent taxon of this data set:\n%s\n\nDo you want to use this taxon?
+CharacterMatrixBottomToolbar_AGGREGATION_TITLE=Choose location for the aggregated description
+CharacterMatrixBottomToolbar_CANCEL=Cancel
+CharacterMatrixBottomToolbar_CHOOSE_TAXON=Choose taxon
+CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE=Do you really want to delete the selected element?
+CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE=Confirm delete
+CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE=Could not create rows for the following description:\n\n%s
+CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE=Errors during row creation
+CharacterMatrixBottomToolbar_YES=Yes
 CharacterMatrixPart_COULD_NOT_OPEN=Editor could not be opened
 CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=The descriptive data set has no feature tree selected.
 CharacterMatrixPart_LOADING_MATRIX=Loading matrix...
index 5ac8608ac4aa070bf38ad9ac68aeb001ea9f290a..96b519b6fd7aa0ecf96ade42c4063349d6631f70 100644 (file)
@@ -209,6 +209,16 @@ CharacterMatrix_SHOW_FLAT_LIST=Listenansicht
 CharacterMatrix_SHOW_HIERARCHY=Baumansicht
 CharacterMatrix_TAXON=Unit
 CharacterMatrix_VIEW_CONFIG=Ansicht konfigurieren
+CharacterMatrixBottomToolbar_AGGREGATE=Aggregation
+CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE=Die aggregierte Beschreibung wird an das gemeinsame, nächst-höhere Taxon dieses Datasets gehangen:\n%s\n\nSoll dieses Taxon verwenden werden?
+CharacterMatrixBottomToolbar_AGGREGATION_TITLE=Wählen Sie den Speicherort für die aggregierte Beschreibung
+CharacterMatrixBottomToolbar_CANCEL=Abbrechen
+CharacterMatrixBottomToolbar_CHOOSE_TAXON=Taxon wählen
+CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE=Wollen Sie wirklich das ausgewählte Element löschen?
+CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE=Löschen bestätigen
+CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE=Konnte keine Zeilen für die folgenden Beschreibungen erzeugen:\n\n%s
+CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE=Fehler bei der Erstellung der Zeilen
+CharacterMatrixBottomToolbar_YES=Ja
 CharacterMatrixPart_COULD_NOT_OPEN=Editor konnte nicht geöffnet werden
 CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=Das Dataset hat keinen Merkmalsbaum ausgewählt.
 CharacterMatrixPart_LOADING_MATRIX=Lade Matrix...