Ticket #11209: ButTheBugIsStillPresent2.patch
| File ButTheBugIsStillPresent2.patch, 2.9 KB (added by , 11 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
147 147 * @since 5653 148 148 */ 149 149 public void editTag(final int row, boolean focusOnKey) { 150 changedKey = null; 151 sel = Main.main.getInProgressSelection(); 152 if (sel == null || sel.isEmpty()) return; 153 154 String key = tagData.getValueAt(row, 0).toString(); 155 objKey=key; 156 157 @SuppressWarnings("unchecked") 158 final EditTagDialog editDialog = new EditTagDialog(key, 159 (Map<String, Integer>) tagData.getValueAt(row, 1), focusOnKey); 160 editDialog.showDialog(); 161 if (editDialog.getValue() != 1) return; 162 editDialog.performTagEdit(); 150 String inputValue = JOptionPane.showInputDialog("Please input a value"); 163 151 } 164 152 165 153 /** -
src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java
77 77 * Register this object as AWTEventListener 78 78 */ 79 79 public void register() { 80 try {81 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);82 } catch (SecurityException ex) {83 Main.warn(ex);84 }85 timer = new Timer(0, new ActionListener() {86 @Override87 public void actionPerformed(ActionEvent e) {88 timer.stop();89 if (set.remove(releaseEvent.getKeyCode()) && enabled) {90 if (isFocusInMainWindow()) {91 for (KeyPressReleaseListener q: keyListeners) {92 q.doKeyReleased(releaseEvent);93 }94 }95 }96 }97 });98 80 } 99 81 100 82 /** … … 102 84 * lists of listeners are not cleared! 103 85 */ 104 86 public void unregister() { 105 timer.stop();106 set.clear();107 if (!keyListeners.isEmpty()) {108 Main.warn(tr("Some of the key listeners forgot to remove themselves: {0}"), keyListeners.toString());109 }110 if (!modifierListeners.isEmpty()) {111 Main.warn(tr("Some of the key modifier listeners forgot to remove themselves: {0}"), modifierListeners.toString());112 }113 try {114 Toolkit.getDefaultToolkit().removeAWTEventListener(this);115 } catch (SecurityException ex) {116 Main.warn(ex);117 }118 87 } 119 88 120 89 private void processKeyEvent(KeyEvent e) {
