Changeset 3688 in josm


Ignore:
Timestamp:
2010-12-01T11:09:42+01:00 (11 years ago)
Author:
bastiK
Message:

fixed #5678 - Layer panel should not take focus when pressing layer icons (it still takes focus, but does no longer occupies certain shortcuts)

File:
1 edited

Legend:

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

    r3680 r3688  
    1111import java.awt.Rectangle;
    1212import java.awt.event.ActionEvent;
     13import java.awt.event.InputEvent;
    1314import java.awt.event.KeyEvent;
    1415import java.awt.event.MouseEvent;
     
    3738import javax.swing.ListSelectionModel;
    3839import javax.swing.UIManager;
    39 import javax.swing.event.ListDataEvent;
    4040import javax.swing.event.ListSelectionEvent;
    4141import javax.swing.event.ListSelectionListener;
     
    191191        layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer());
    192192        layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JTextField()));
     193        for (KeyStroke ks : new KeyStroke[] {
     194                KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
     195                KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
     196                KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_MASK),
     197                KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
     198                KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK),
     199                KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK),
     200                KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
     201                KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
     202                })
     203        {
     204            layerList.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, new Object());
     205        }
    193206
    194207        add(new JScrollPane(layerList), BorderLayout.CENTER);
Note: See TracChangeset for help on using the changeset viewer.