Ignore:
Timestamp:
2012-03-01T12:43:17+01:00 (12 years ago)
Author:
akks
Message:

fix #7463: Ctrl-Shift-Up/Down shortcuts did't work if the properties window is active

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r5020 r5032  
    1919import java.awt.event.FocusAdapter;
    2020import java.awt.event.FocusEvent;
     21import java.awt.event.InputEvent;
    2122import java.awt.event.KeyEvent;
    2223import java.awt.event.MouseAdapter;
     
    4647import javax.swing.Box;
    4748import javax.swing.DefaultListCellRenderer;
     49import javax.swing.InputMap;
    4850import javax.swing.JComboBox;
    4951import javax.swing.JComponent;
     
    5961import javax.swing.KeyStroke;
    6062import javax.swing.ListSelectionModel;
     63import javax.swing.SwingUtilities;
    6164import javax.swing.event.ListSelectionEvent;
    6265import javax.swing.event.ListSelectionListener;
     
    840843                .put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),"onTableInsert");
    841844        propertyTable.getActionMap().put("onTableInsert",addAction);
    842                
     845       
     846        //  unassign some standard shortcuts for JTable to allow upload / download
     847        InputMap inputMap=SwingUtilities.getUIInputMap(propertyTable,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
     848        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP,InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK));
     849        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK));
     850        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP,InputEvent.ALT_MASK|InputEvent.SHIFT_MASK));
     851        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,InputEvent.ALT_MASK|InputEvent.SHIFT_MASK));
     852        SwingUtilities.replaceUIInputMap(propertyTable,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,inputMap);
     853       
    843854        // -- add action and shortcut
    844855        this.btnAdd = new SideButton(addAction);
Note: See TracChangeset for help on using the changeset viewer.