Changeset 3068 in josm for trunk


Ignore:
Timestamp:
2010-03-02T16:52:10+01:00 (10 years ago)
Author:
Gubaer
Message:

fixed #4599: relation-editor: delete key deletes whole tag row

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r3015 r3068  
    220220            switch(getSelectedColumnCount()) {
    221221            case 1:
    222                 if (isEditing()) {
    223                     getCellEditor().cancelCellEditing();
    224                     deleteTags();
    225                 } else if (getSelectedColumn() == 0) {
     222                if (getSelectedColumn() == 0) {
    226223                    deleteTagNames();
    227224                } else if (getSelectedColumn() == 1) {
    228225                    deleteTagValues();
    229                 } else
    230                     // should not happen
    231                     //
    232                     throw new IllegalStateException("unexpected selected column: getSelectedColumn() is " + getSelectedColumn());
     226                }
    233227                break;
    234228            case 2:
     
    390384        //
    391385        if (e.getKeyCode() == KeyEvent.VK_DELETE) {
     386            if (isEditing() && getSelectedColumnCount() == 1 && getSelectedRowCount() == 1)
     387                // if DEL was pressed and only the currently edited cell is selected,
     388                // don't run the delete action. DEL is handled by the CellEditor as normal
     389                // DEL in the text input.
     390                //
     391                return super.processKeyBinding(ks, e, condition, pressed);
    392392            getDeleteAction().run();
    393393        }
Note: See TracChangeset for help on using the changeset viewer.