Project

General

Profile

« Previous | Next » 

Revision a8858124

Added by Patrick Plitzner over 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
                }

Also available in: Unified diff