Ticket #23447: 23447.patch
| File 23447.patch, 2.5 KB (added by , 2 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
156 156 */ 157 157 private final CancelAction cancelAction; 158 158 /** 159 * Action for performing the {@link DeleteCurrentRelationAction} 160 */ 161 private final DeleteCurrentRelationAction deleteAction; 162 /** 159 163 * A list of listeners that need to be notified on clipboard content changes. 160 164 */ 161 165 private final ArrayList<FlavorListener> clipboardListeners = new ArrayList<>(); … … 265 269 // Action for performing the {@link DuplicateRelationAction} 266 270 final DuplicateRelationAction duplicateAction = new DuplicateRelationAction(actionAccess); 267 271 // Action for performing the {@link DeleteCurrentRelationAction} 268 final DeleteCurrentRelationActiondeleteAction = new DeleteCurrentRelationAction(actionAccess);272 deleteAction = new DeleteCurrentRelationAction(actionAccess); 269 273 270 274 this.memberTableModel.addTableModelListener(applyAction); 271 275 this.tagEditorPanel.getModel().addTableModelListener(applyAction); … … 405 409 /** 406 410 * builds the panel with the OK and the Cancel button 407 411 * @param okAction OK action 412 * @param deleteAction Delete action 408 413 * @param cancelAction Cancel action 409 414 * 410 415 * @return the panel with the OK and the Cancel button … … 1076 1081 1077 1082 @Override 1078 1083 public void commandChanged(int queueSize, int redoSize) { 1084 deleteAction.updateEnabledState(); 1079 1085 Relation r = getRelation(); 1080 1086 if (r != null && r.getDataSet() == null) { 1081 1087 // see #19915 -
src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java
39 39 } 40 40 41 41 @Override 42 protected void updateEnabledState() { 43 setEnabled(getEditor().getRelationSnapshot() != null); 42 public void updateEnabledState() { 43 Relation r = getEditor().getRelation(); 44 setEnabled(r != null && !r.isDeleted()); 44 45 } 45 46 46 47 @Override
