Project

General

Profile

« Previous | Next » 

Revision a8858124

Added by Patrick Plitzner about 5 years ago

ref #7589 Confirm description deletion in character matrix

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java
40 40
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
41 41
import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
42 42
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
43
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
43 44
import eu.etaxonomy.taxeditor.model.ImageResources;
44 45
import eu.etaxonomy.taxeditor.model.MessagingUtils;
45 46
import eu.etaxonomy.taxeditor.store.CdmStore;
......
78 79
                if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
79 80
                    return;
80 81
                }
81
                String error = "";
82
                String error = ""; //$NON-NLS-1$
82 83
                SpecimenSelectionDialog dialog = new SpecimenSelectionDialog(matrix.getShell(), matrix);
83 84
                if(dialog.open()==Window.OK){
84 85
                    Collection<SpecimenNodeWrapper> wrappers = dialog.getSpecimen();
......
101 102
                        matrix.getSpecimenCache().remove(wrapper);
102 103
                    }
103 104
                    if(CdmUtils.isNotBlank(error)){
104
                        MessagingUtils.warningDialog("Errors during row creation", this,
105
                                String.format("Could not create rows for the following description:\n\n%s", error));
105
                        MessagingUtils.warningDialog(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE, this,
106
                                String.format(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE, error));
106 107
                    }
107 108
                }
108 109
            }
......
118 119
                if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
119 120
                    return;
120 121
                }
122
                if(!MessagingUtils.confirmDialog(Messages.CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE, Messages.CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE)){
123
                    return;
124
                }
121 125
                int[] fullySelectedRowPositions = matrix.getBodyLayer().getSelectionLayer().getFullySelectedRowPositions();
122 126
                List<RowWrapperDTO> toRemove = new ArrayList<>();
123 127
                for (int i : fullySelectedRowPositions) {
......
137 141
         * Aggregate button
138 142
         */
139 143
        Button btnAggregate = new Button(this, SWT.PUSH);
140
        btnAggregate.setText("Aggregate");
144
        btnAggregate.setText(Messages.CharacterMatrixBottomToolbar_AGGREGATE);
141 145
        btnAggregate.addSelectionListener(new SelectionAdapter() {
142 146
            @Override
143 147
            public void widgetSelected(SelectionEvent e) {
......
150 154
                TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
151 155
                UUID taxonUuid = parentDto.getTaxonUuid();
152 156
                int response = MessagingUtils.confirmDialog(
153
                        "Choose location for the aggregated description",
154
                        String.format("The aggregated description will be stored at "
155
                                + "the common parent taxon of this data set:\n%s\n\n"
156
                                + "Do you want to use this taxon?"
157
                                , parentDto.getTaxonTitleCache()), "Yes", "Choose taxon", "Cancel");
157
                        Messages.CharacterMatrixBottomToolbar_AGGREGATION_TITLE,
158
                        String.format(Messages.CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE
159
                                , parentDto.getTaxonTitleCache()), Messages.CharacterMatrixBottomToolbar_YES, Messages.CharacterMatrixBottomToolbar_CHOOSE_TAXON, Messages.CharacterMatrixBottomToolbar_CANCEL);
158 160
                if(response==2){
159 161
                    return;
160 162
                }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java
60 60
    public static String CharacterMatrix_NO_DESCRIPTION_TITLE;
61 61
    public static String CharacterMatrix_NO_NODE_FOUND_MESSAGE;
62 62
    public static String CharacterMatrix_NO_NODE_FOUND_TITLE;
63
    public static String CharacterMatrixBottomToolbar_AGGREGATE;
64
    public static String CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE;
65
    public static String CharacterMatrixBottomToolbar_AGGREGATION_TITLE;
66
    public static String CharacterMatrixBottomToolbar_CANCEL;
67
    public static String CharacterMatrixBottomToolbar_CHOOSE_TAXON;
68
    public static String CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE;
69
    public static String CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE;
70
    public static String CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE;
71
    public static String CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE;
72
    public static String CharacterMatrixBottomToolbar_YES;
63 73
    public static String CharacterMatrixPart_COULD_NOT_OPEN;
64 74
    public static String CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE;
65 75
    public static String CharacterMatrixPart_LOADING_MATRIX;
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties
209 209
CharacterMatrix_SHOW_HIERARCHY=Show taxon hierarchy
210 210
CharacterMatrix_TAXON=Unit
211 211
CharacterMatrix_VIEW_CONFIG=View configuration
212
CharacterMatrixBottomToolbar_AGGREGATE=Aggregate
213
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?
214
CharacterMatrixBottomToolbar_AGGREGATION_TITLE=Choose location for the aggregated description
215
CharacterMatrixBottomToolbar_CANCEL=Cancel
216
CharacterMatrixBottomToolbar_CHOOSE_TAXON=Choose taxon
217
CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE=Do you really want to delete the selected element?
218
CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE=Confirm delete
219
CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE=Could not create rows for the following description:\n\n%s
220
CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE=Errors during row creation
221
CharacterMatrixBottomToolbar_YES=Yes
212 222
CharacterMatrixPart_COULD_NOT_OPEN=Editor could not be opened
213 223
CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=The descriptive data set has no feature tree selected.
214 224
CharacterMatrixPart_LOADING_MATRIX=Loading matrix...
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties
209 209
CharacterMatrix_SHOW_HIERARCHY=Baumansicht
210 210
CharacterMatrix_TAXON=Unit
211 211
CharacterMatrix_VIEW_CONFIG=Ansicht konfigurieren
212
CharacterMatrixBottomToolbar_AGGREGATE=Aggregation
213
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?
214
CharacterMatrixBottomToolbar_AGGREGATION_TITLE=W?hlen Sie den Speicherort f?r die aggregierte Beschreibung
215
CharacterMatrixBottomToolbar_CANCEL=Abbrechen
216
CharacterMatrixBottomToolbar_CHOOSE_TAXON=Taxon w?hlen
217
CharacterMatrixBottomToolbar_CONFIRM_DELETE_MESSAGE=Wollen Sie wirklich das ausgew?hlte Element l?schen?
218
CharacterMatrixBottomToolbar_CONFIRM_DELETE_TITLE=L?schen best?tigen
219
CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE=Konnte keine Zeilen f?r die folgenden Beschreibungen erzeugen:\n\n%s
220
CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE=Fehler bei der Erstellung der Zeilen
221
CharacterMatrixBottomToolbar_YES=Ja
212 222
CharacterMatrixPart_COULD_NOT_OPEN=Editor konnte nicht ge?ffnet werden
213 223
CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=Das Dataset hat keinen Merkmalsbaum ausgew?hlt.
214 224
CharacterMatrixPart_LOADING_MATRIX=Lade Matrix...

Also available in: Unified diff