From: Patrick Plitzner Date: Mon, 14 Jan 2019 07:43:45 +0000 (+0100) Subject: ref #7589 Confirm description deletion in character matrix X-Git-Tag: 5.5.0^2~223 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/a8858124b516c29683da8f87d7b316625c24800e ref #7589 Confirm description deletion in character matrix --- diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java index a1f988c7b..2bbe9e748 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java @@ -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 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 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; } diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java index 375faff8b..a18bdcde7 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java @@ -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; diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties index 8d4a592eb..832c39fbe 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties @@ -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... diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties index 5ac8608ac..96b519b6f 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties @@ -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...