Changeset 14669 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-01-10T06:31:46+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r14613 r14669 27 27 import java.util.TreeMap; 28 28 import java.util.TreeSet; 29 import java.util.concurrent.atomic.AtomicBoolean; 29 30 30 31 import javax.swing.AbstractAction; … … 1098 1099 */ 1099 1100 class AddAction extends JosmAction { 1101 AtomicBoolean isPerforming = new AtomicBoolean(false); 1100 1102 AddAction() { 1101 1103 super(tr("Add"), /* ICON() */ "dialogs/add", tr("Add a new key/value pair to all objects"), … … 1105 1107 1106 1108 @Override 1107 public synchronizedvoid actionPerformed(ActionEvent e) {1108 if ( !isEnabled())1109 public void actionPerformed(ActionEvent e) { 1110 if (isPerforming.get()) 1109 1111 return; 1110 setEnabled(false);1112 isPerforming.set(true); 1111 1113 try { 1112 1114 editHelper.addTag(); 1113 1115 btnAdd.requestFocusInWindow(); 1114 1116 } finally { 1115 setEnabled(true);1117 isPerforming.set(false); 1116 1118 } 1117 1119 } … … 1122 1124 */ 1123 1125 class EditAction extends JosmAction implements ListSelectionListener { 1126 AtomicBoolean isPerforming = new AtomicBoolean(false); 1124 1127 EditAction() { 1125 1128 super(tr("Edit"), /* ICON() */ "dialogs/edit", tr("Edit the value of the selected key for all objects"), … … 1130 1133 1131 1134 @Override 1132 public synchronizedvoid actionPerformed(ActionEvent e) {1133 if ( !isEnabled())1135 public void actionPerformed(ActionEvent e) { 1136 if (isPerforming.get()) 1134 1137 return; 1135 setEnabled(false);1138 isPerforming.set(true); 1136 1139 try { 1137 1140 if (tagTable.getSelectedRowCount() == 1) { … … 1143 1146 } 1144 1147 } finally { 1145 setEnabled(true);1148 isPerforming.set(false); 1146 1149 } 1147 1150 }
Note:
See TracChangeset
for help on using the changeset viewer.